osd-contiki/cpu
Atis Elsts 705587cdb7 Fix time accounting on msp430 Series 1 and Series 2 MCU based platforms.
The problem with the current version of the code was that the condition at the end of the do...while loop at Timer A1 interrupt:
 while((TACCR1 - TAR) > INTERVAL);
evaluates to false whenever TACCR1 == TAR.
Not incrementing TACCR1 in this case leads to Timer A1 interrupt not being called for 2 seconds, until TAR counter reaches TACCR1 again after an overflow.

The patch avoids this problem by changing the condition of the loop, and using CLOCK_LT macro to compare between time values.

The patch also attempts to fix another problem: a read of TAR register while it is being updated may return a lower value than the actual contents. To avoid that, the "read twice and compare results" idiom should be used. As the TAR register is updated by the actual hardware, it is of no importance whether it is read with interrupts disabled or enabled; the problem can occur in both contexts.
2014-07-02 11:07:02 +02:00
..
6502 Enhanced Ethernet drivers. 2014-06-12 22:56:35 +02:00
arm Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
avr Merge pull request #511 from ADVANSEE/leds 2014-06-11 22:37:34 +02:00
cc253x Implement extended RF API for the CC2530 RF 2014-04-23 12:16:50 +01:00
cc2430 Added stub for extended radio API for cc2430 2014-04-03 13:38:21 +02:00
cc2538 Improve documentation for the CC2538 IEEE address re-ordering 2014-06-06 18:33:28 +01:00
mc1322x Added stub for extended radio API for mc1322x 2014-04-03 13:38:26 +02:00
msp430 Fix time accounting on msp430 Series 1 and Series 2 MCU based platforms. 2014-07-02 11:07:02 +02:00
native Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
pic32 A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00
rl78 Added stub for extended radio API for rl78 2014-04-03 13:38:28 +02:00
stm32w108 Merge pull request #617 from nfi/extended-radio-api 2014-06-03 21:32:53 +02:00
x86 A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00