contiki/cpu/msp430
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
..
dev 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
f1xxx Fix time accounting on msp430 Series 1 and Series 2 MCU based platforms. 2014-07-02 11:07:02 +02:00
f2xxx Fix CPU clock calibration in msp430f2xxx based platforms (e.g. Zolertia Z1). 2014-03-25 11:47:13 +01:00
f5xxx Add clock_delay_us and clock_set_seconds to clock.h. Modify clock_wait to use clock_time_t. 2012-04-09 15:49:53 -04:00
button.c Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
cc2420-arch-sfd.c Use platform configuration for CC2420/CC2520 SFD on MSP430 based platforms 2014-03-28 11:54:10 +01:00
cc2420-arch-sfd.h Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
cc2420-arch.c Moved the cc2420 driver into a separate dev/cc2420 module 2014-01-26 23:20:27 +01:00
cc2520-arch-sfd.c Use platform configuration for CC2420/CC2520 SFD on MSP430 based platforms 2014-03-28 11:54:10 +01:00
cc2520-arch-sfd.h Initial WiSMote port based on code from Arago Systems. 2012-01-09 12:25:06 +01:00
cc2520-arch.c Moved the cc2520 driver into its own dev/cc2520 module 2014-01-26 23:20:31 +01:00
flash.c Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
isr_compat.h 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
leds-arch.c Fixed compiler warning (with IAR compiler) 2012-01-09 14:56:00 +01:00
loader-arch.c Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
lpm.c Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
Makefile.msp430 Added flags to enable 20-bit support from msp430-gcc 4.7.x 2014-06-17 12:55:08 +02:00
minileds.c leds: Fix the API 2014-01-07 13:02:41 +01:00
msp430def.h Define the BV macro if not already defined 2012-01-11 08:46:16 +01:00
mtarch.c Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
mtarch.h 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
rom.c Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
rtimer-arch.h 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
slip_uart0.c Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
slip_uart1.c Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
uip-ipchksum.c Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
watchdog.c Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00