|
@@ -179,7 +179,6 @@ static void SysControlMainBeat(u_char OnOff)
|
|
|
/* global variable definitions */
|
|
/* global variable definitions */
|
|
|
/*-------------------------------------------------------------------------*/
|
|
/*-------------------------------------------------------------------------*/
|
|
|
int isAlarmSyncing;
|
|
int isAlarmSyncing;
|
|
|
-
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
/*-------------------------------------------------------------------------*/
|
|
|
/* local variable definitions */
|
|
/* local variable definitions */
|
|
|
/*-------------------------------------------------------------------------*/
|
|
/*-------------------------------------------------------------------------*/
|
|
@@ -270,34 +269,37 @@ int main(void)
|
|
|
|
|
|
|
|
for (;;)
|
|
for (;;)
|
|
|
{
|
|
{
|
|
|
- //Check if a button is pressed
|
|
|
|
|
- if (checkOffPressed() == 1){
|
|
|
|
|
- start = time(0);
|
|
|
|
|
- running = 1;
|
|
|
|
|
- LcdBacklightKnipperen(startLCD);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //Check if background LED is on, and compare to timer
|
|
|
|
|
- if (running == 1){
|
|
|
|
|
- if (timer(start) >= 10){
|
|
|
|
|
- running = 0;
|
|
|
|
|
- LcdBackLight(LCD_BACKLIGHT_OFF);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if(!isAlarmSyncing && X12RtcGetStatus(5) > 0)
|
|
|
|
|
- {
|
|
|
|
|
- displayAlarm(0,1);
|
|
|
|
|
- if (KbScan() < -1 || checkTime() == 1){
|
|
|
|
|
- handleAlarm();
|
|
|
|
|
- LcdBackLight(LCD_BACKLIGHT_OFF);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- displayTime(0);
|
|
|
|
|
- displayDate(1);
|
|
|
|
|
- }
|
|
|
|
|
- WatchDogRestart();
|
|
|
|
|
|
|
+ //Check if a button is pressed
|
|
|
|
|
+ if (checkOffPressed() == 1){
|
|
|
|
|
+ start = time(0);
|
|
|
|
|
+ running = 1;
|
|
|
|
|
+ LcdBacklightKnipperen(startLCD);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //Check if background LED is on, and compare to timer
|
|
|
|
|
+ if (running == 1){
|
|
|
|
|
+ if (timer(start) >= 10){
|
|
|
|
|
+ running = 0;
|
|
|
|
|
+ LcdBackLight(LCD_BACKLIGHT_OFF);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(!isAlarmSyncing)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(X12RtcGetStatus(5) > 0) {
|
|
|
|
|
+ displayAlarm(0, 1);
|
|
|
|
|
+ if (KbScan() < -1 || checkTime() == 1) {
|
|
|
|
|
+ handleAlarm();
|
|
|
|
|
+ LcdBackLight(LCD_BACKLIGHT_OFF);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ displayTime(0);
|
|
|
|
|
+ displayDate(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ WatchDogRestart();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return(0);
|
|
return(0);
|