Include sleep into library

This commit is contained in:
Matte23
2024-11-03 15:01:54 +01:00
parent 6d0a60881c
commit ba22538626
5 changed files with 19 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
#define CLOCK_FREQUENCY 120000
#define CLOCK_FREQUENCY 168000ULL
unsigned int ms_to_ticks(unsigned int ms) {
return ms * (CLOCK_FREQUENCY/3);
@@ -6,10 +6,9 @@ unsigned int ms_to_ticks(unsigned int ms) {
void delay_routine(unsigned int delay_counter) {
asm("mov r1, %[input]\n"
"loop_2:\n"
"delay_loop:\n"
"subs r1, #1\n"
"cmp r1, #0\n"
"bne loop_2\n"
"bne delay_loop\n"
: [input] "=r" (delay_counter));
}