Some fixes. Added void csleep(void);

This commit is contained in:
mibi88 2023-01-16 18:55:59 +01:00
parent 33fb421d2a
commit 2458478835
4 changed files with 29 additions and 6 deletions

View File

@ -108,7 +108,7 @@ void tsleep_ms(int ms);
Get 1/128 seconds ticks since midnight.
*/
void tgetticks(void);
int tgetticks(void);
/* int tiselapsed(int start, int ms);
@ -119,5 +119,14 @@ Returns 1 if ms is elapsed and 0 if it is not.
int tiselapsed(int start, int ms);
#endif
/******* CPU *******/
/* void csleep(void);
Uses asm sleep instruction.
Can be used to reduce battery usage of some loops.
*/
void csleep(void);
#endif

View File

@ -104,11 +104,16 @@ void tsleep_ms(int ms) {
_Sleep(ms);
}
void tgetticks(void) {
_RTC_GetTicks();
int tgetticks(void) {
return _RTC_GetTicks();
}
int tiselapsed(int start, int ms) {
return _RTC_Elapsed_ms(start, ms);
}
/******* CPU *******/
void csleep(void) {
__asm__("sleep");
}

View File

@ -108,7 +108,7 @@ void tsleep_ms(int ms);
Get 1/128 seconds ticks since midnight.
*/
void tgetticks(void);
int tgetticks(void);
/* int tiselapsed(int start, int ms);
@ -119,5 +119,14 @@ Returns 1 if ms is elapsed and 0 if it is not.
int tiselapsed(int start, int ms);
#endif
/******* CPU *******/
/* void csleep(void);
Uses asm sleep instruction.
Can be used to reduce battery usage of some loops.
*/
void csleep(void);
#endif

Binary file not shown.