2017-09-23 15:20:55 +00:00
|
|
|
/* Main module. This version just initializes the LCD and then drops
|
|
|
|
to a low power mode, letting the WDT do the work on a slow
|
|
|
|
interval.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <msp430.h>
|
|
|
|
|
|
|
|
#include "lcd.h"
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
|
|
|
|
|
|
|
|
lcd_init();
|
2017-09-24 22:00:54 +00:00
|
|
|
rtc_init();
|
2017-09-23 15:20:55 +00:00
|
|
|
|
2017-09-24 20:06:59 +00:00
|
|
|
// Setup and enable WDT 1000ms, ACLK, interval timer
|
2017-09-24 22:00:54 +00:00
|
|
|
WDTCTL = WDT_ADLY_250;
|
2017-09-23 15:20:55 +00:00
|
|
|
SFRIE1 |= WDTIE;
|
|
|
|
|
|
|
|
__bis_SR_register(LPM0_bits + GIE); // Enter LPM3 w/interrupt
|
2017-09-24 20:38:14 +00:00
|
|
|
while(1);
|
2017-09-23 15:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Watchdog Timer interrupt service routine, calls back to handler functions.
|
|
|
|
void __attribute__ ((interrupt(WDT_VECTOR))) watchdog_timer (void) {
|
2017-09-24 22:00:54 +00:00
|
|
|
//lcd_wdt();
|
|
|
|
//draw_time();
|
|
|
|
|
|
|
|
//Blink the colon faster than the RTC.
|
|
|
|
setcolon(3);
|
2017-09-23 15:20:55 +00:00
|
|
|
}
|