diff options
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/msp430fr5969lp/arch.cc | 7 | ||||
-rw-r--r-- | src/arch/msp430fr5969lp/driver/i2c.cc | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/arch/msp430fr5969lp/arch.cc b/src/arch/msp430fr5969lp/arch.cc index 9ea49b7..ddb84a4 100644 --- a/src/arch/msp430fr5969lp/arch.cc +++ b/src/arch/msp430fr5969lp/arch.cc @@ -72,6 +72,13 @@ extern void loop(); volatile char run_loop = 0; #endif +void Arch::delay_us(unsigned char const us) +{ + for (int i = 0; i < us/10; i++) { + __delay_cycles(160); + } +} + void Arch::idle_loop(void) { while (1) { diff --git a/src/arch/msp430fr5969lp/driver/i2c.cc b/src/arch/msp430fr5969lp/driver/i2c.cc index fffc28c..55f8591 100644 --- a/src/arch/msp430fr5969lp/driver/i2c.cc +++ b/src/arch/msp430fr5969lp/driver/i2c.cc @@ -16,7 +16,7 @@ signed char I2C::setup() UCB0CTL1 &= ~UCSWRST; UCB0I2CSA = 0; - __delay_cycles(1600); + arch.delay_us(100); if (UCB0STAT & UCBBUSY) return -1; |