]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Lib/delay.h
Adding 72 MHz clock support for mk20dx256vlh7
[kiibohd-controller.git] / Lib / delay.h
index 76f20060e47a2e730f98f979eb46b8922bbd281c..992fcdac8e94695fdd4d11bd7280eeb305e11413 100644 (file)
@@ -63,15 +63,17 @@ static inline void delayMicroseconds(uint32_t usec)
 {
 #if F_CPU == 96000000
        uint32_t n = usec << 5;
+#elif F_CPU == 72000000
+       uint32_t n = usec << 5; // XXX Not accurate, assembly snippet needs to be updated
 #elif F_CPU == 48000000
        uint32_t n = usec << 4;
 #elif F_CPU == 24000000
        uint32_t n = usec << 3;
 #endif
        asm volatile(
-               "L_%=_delayMicroseconds:"               "\n\t"
-               "subs   %0, #1"                         "\n\t"
-               "bne    L_%=_delayMicroseconds"         "\n"
+               "L_%=_delayMicroseconds:"               "\n\t"
+               "subs   %0, #1"                         "\n\t"
+               "bne    L_%=_delayMicroseconds"         "\n"
                : "+r" (n) :
        );
 }