Browse Source

00:00:00 fixed
Timecompare fixed

Issues:
-Only works if Alarm Sync Thread is commented

guusvdongen 9 năm trước cách đây
mục cha
commit
77358f89db
2 tập tin đã thay đổi với 8 bổ sung10 xóa
  1. 1 1
      displayHandler.c
  2. 7 9
      main.c

+ 1 - 1
displayHandler.c

@@ -72,7 +72,7 @@ void displayAlarm(int line_number, int line_numberTwo, int idx)
     if (line_number > -1 && line_number < 2){
         (*write_display_ptr[line_number])(str, 16);
     }
-    //playStream(am.ip, am.port, am.url);
+    playStream(am.ip, am.port, am.url);
 
 	j = 0;
     char str2[16];

+ 7 - 9
main.c

@@ -300,7 +300,7 @@ int main(void)
     NtpInit();
 
     NutThreadCreate("BackgroundThread", StartupInit, NULL, 1024);
-    NutThreadCreate("BackgroundThread", AlarmSync, NULL, 2500);
+    //NutThreadCreate("BackgroundThread", AlarmSync, NULL, 2500);
     NutThreadCreate("BackgroundThread", NTPSync, NULL, 700);
     /** Quick fix for turning off the display after 10 seconds boot */
 
@@ -322,8 +322,6 @@ int main(void)
 	tm = GetRTCTime();
 	tm.tm_sec += 10;
     setAlarm(tm,"test1234", "0.0.0.0","", 8001,1,0,0);
-	//tm.tm_sec +=20;
-	//setAlarm(tm,"    test5678      ", "0.0.0.0","", 8001,1,0,1);*/
 
 /*    if(hasNetworkConnection() == true){
         playStream("145.58.53.152", 80, "/3fm-bb-mp3");
@@ -336,7 +334,7 @@ int main(void)
 
     for (;;)
     {
-		printf("running = %d, time = %d\n", running, timerStruct(start));
+		//printf("running = %d, time = %d\n", running, timerStruct(start));
 		
 		if (timerStruct(start) < 0){
 			X12RtcGetClock(&start);
@@ -384,19 +382,19 @@ int main(void)
         }
         else if(timerStruct(timeCheck) >= 5 && checkAlarms() == 1)
         {
-			for (idx = 0; idx < 2; idx++){
+			for (idx = 0; idx < 5; idx++){
 				if (getState(idx) == 1){
 					displayAlarm(0,1,idx);
 					if (KbGetKey() == KEY_ESC){
-						NutDelay(50);
+						//NutDelay(50);
 						handleAlarm(idx);
-						NutDelay(50);
+						//NutDelay(50);
 						LcdBackLight(LCD_BACKLIGHT_OFF);
-                        //stopStream();
+                        stopStream();
 					} else if (KbGetKey() == KEY_01 || KbGetKey() == KEY_02 || KbGetKey() == KEY_03 || KbGetKey() == KEY_04 || KbGetKey() == KEY_05 || KbGetKey() == KEY_ALT){
 						setSnooze(idx);
 						LcdBackLight(LCD_BACKLIGHT_OFF);
-                        //stopStream();
+                        stopStream();
 					}
 				}
 			}