diff --git a/Telem_Debug/Debug_UART-USB/SunseekerTelemetry2021.h b/Telem_Debug/Debug_UART-USB/SunseekerTelemetry2021.h index 6b50af6..a57f11b 100644 --- a/Telem_Debug/Debug_UART-USB/SunseekerTelemetry2021.h +++ b/Telem_Debug/Debug_UART-USB/SunseekerTelemetry2021.h @@ -20,16 +20,24 @@ void clock_init(void); -static inline void delay(void) -{ +static inline void delay(void){ volatile int jj; volatile int ii; // Using count-down since it uses one less instruction to compare (not really necessary here, but CCS recommends it anyway): Ultra-Low Power Advisor > Rule 13.1 (https://software-dl.ti.com/ccs/esd/documents/dmed/HTML/MSP430/1544.html) - for (ii = 4; ii > 0; ii--) - { - for (jj = 1000; jj > 0; jj--) - { - asm(" nop"); //The space is necessary or else the assembler thinks "nop" is a label! + for (ii = 4; ii > 0; ii--){ + for (jj = 1000; jj > 0; jj--){ + _NOP(); + } + } +} + +static inline void delayMultiplied(int multiplier){ + volatile int jj; + volatile int ii; + // Using count-down since it uses one less instruction to compare (not really necessary here, but CCS recommends it anyway): Ultra-Low Power Advisor > Rule 13.1 (https://software-dl.ti.com/ccs/esd/documents/dmed/HTML/MSP430/1544.html) + for (ii = 4 * multiplier; ii > 0; ii--){ + for (jj = 1000; jj > 0; jj--){ + _NOP(); } } }