mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-11 14:08:20 -05:00
39cc86c260
subrepo: subdir: "soh" merged: "ba904bbd0" upstream: origin: "https://github.com/HarbourMasters/soh.git" branch: "master" commit: "ba904bbd0" git-subrepo: version: "0.4.1" origin: "???" commit: "???"
29 lines
571 B
C
29 lines
571 B
C
#include "global.h"
|
|
|
|
void Sleep_Cycles(OSTime cycles) {
|
|
OSMesgQueue mq;
|
|
OSMesg msg;
|
|
OSTimer timer;
|
|
|
|
osCreateMesgQueue(&mq, &msg, OS_MESG_BLOCK);
|
|
osSetTimer(&timer, cycles, 0, &mq, NULL);
|
|
osRecvMesg(&mq, NULL, OS_MESG_BLOCK);
|
|
}
|
|
|
|
void Sleep_Nsec(u32 nsec) {
|
|
Sleep_Cycles(OS_NSEC_TO_CYCLES(nsec));
|
|
}
|
|
|
|
void Sleep_Usec(u32 usec) {
|
|
Sleep_Cycles(OS_USEC_TO_CYCLES(usec));
|
|
}
|
|
|
|
// originally "msleep"
|
|
void Sleep_Msec(u32 ms) {
|
|
Sleep_Cycles((ms * OS_CPU_COUNTER) / 1000ull);
|
|
}
|
|
|
|
void Sleep_Sec(u32 sec) {
|
|
Sleep_Cycles(sec * OS_CPU_COUNTER);
|
|
}
|