From 346f6f7b48d1ebed9d5048f0e7b4d297a15aeb4d Mon Sep 17 00:00:00 2001 From: smckown Date: Tue, 9 Sep 2008 13:51:35 +0000 Subject: [PATCH] Propagate changes from msp430/clock/Msp430ClockP.nc to is sibling in msp430/clock2. --- tos/chips/msp430/clock2/Msp430ClockP.nc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tos/chips/msp430/clock2/Msp430ClockP.nc b/tos/chips/msp430/clock2/Msp430ClockP.nc index 6649b01d..c8681f34 100644 --- a/tos/chips/msp430/clock2/Msp430ClockP.nc +++ b/tos/chips/msp430/clock2/Msp430ClockP.nc @@ -56,6 +56,13 @@ implementation MSP430REG_NORACE(TBIV); #endif + #if defined(__MSP430_HAS_BC2__) /* basic clock module+ */ + #define FIRST_STEP 0x1000 + #else /* orig basic clock module */ + #define RSEL3 0 + #define FIRST_STEP 0x800 + #endif + enum { DCOX = DCO2 + DCO1 + DCO0, @@ -185,7 +192,7 @@ implementation uint16_t calib; uint16_t step; - for (calib = 0, step = 0x1000; step != 0; step >>= 1) { + for (calib = 0, step = FIRST_STEP; step != 0; step >>= 1) { // if the step is not past the target, commit it if (test_calib_busywait_delta(calib | step) <= TARGET_DCO_DELTA ) calib |= step; -- 2.39.2