Merge pull request #111 from BitBangingBytes/master

Fixed Alarm Inconsistencies
This commit is contained in:
Travis Goodspeed 2018-11-05 17:24:27 -05:00 committed by GitHub
commit 652108d3f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -162,14 +162,12 @@ int alarm_keypress(char ch){
break;
case 4:
RTCAMIN = RTCAMIN-RTCAMIN%10+inputdigit;
settingalarm = 0;
break;
default:
/* Once we've exceeded the count, it's time to return to the
normal mode and enable the alarm.
*/
settingalarm=0;
toggle_alarm(1);
break;
default:
// Return to normal mode if we end up here accidentally
settingalarm=0;
}
} else {
switch(ch){

View File

@ -65,7 +65,8 @@ void rtc_init(){
RTCCTL01 = RTCTEVIE + RTCSSEL_2 + RTCTEV_0 + RTCMODE + RTCAIE;
RTCPS0CTL = RT0PSDIV_2; // ACLK, /8, start timer
RTCPS1CTL = RT1SSEL_2 + RT1PSDIV_3; // out from RT0PS, /16, start timer
RTCADAY = 0; // Initialize to 0 to clear alarm flags
RTCADOW = 0; // on Day and Day of Week registers.
#ifdef CALIBRATE_APP
//Load the calibration routines.
calibrate_enforce();