summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-10-25 14:23:44 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-10-25 14:23:44 +0200
commit3e884d678b5bd2871452bdfb81be3d9ea4fa4431 (patch)
treec9732796b35a88373edc44b397db8eecf28f9dbc
parent8692f49bfc10f3fbe257646dbb6b06677cc88007 (diff)
msp430: Fix delay_us/delay_ms for F_CPU≠16MHz
-rw-r--r--src/arch/msp430fr5969lp/arch.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arch/msp430fr5969lp/arch.cc b/src/arch/msp430fr5969lp/arch.cc
index b3cfbf6..cde0503 100644
--- a/src/arch/msp430fr5969lp/arch.cc
+++ b/src/arch/msp430fr5969lp/arch.cc
@@ -105,13 +105,13 @@ volatile char run_loop = 0;
void Arch::delay_us(unsigned int const us)
{
for (unsigned int i = 0; i < us/10; i++) {
- __delay_cycles(160);
+ __delay_cycles(F_CPU / 100000UL);
}
}
void Arch::delay_ms(unsigned int const ms)
{
for (unsigned int i = 0; i < ms; i++) {
- __delay_cycles(16000);
+ __delay_cycles(F_CPU / 1000UL);
}
}