|
@@ -15,8 +15,6 @@
|
|
|
|
|
|
|
|
#define LOG_MODULE LOG_MAIN_MODULE
|
|
#define LOG_MODULE LOG_MAIN_MODULE
|
|
|
|
|
|
|
|
-#define _SUPPRESS_ALARMSYNC
|
|
|
|
|
-
|
|
|
|
|
/*--------------------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------------------*/
|
|
|
/* Include files */
|
|
/* Include files */
|
|
|
/*--------------------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------------------*/
|
|
@@ -34,17 +32,13 @@
|
|
|
#include "contentparser.h"
|
|
#include "contentparser.h"
|
|
|
#include "display.h"
|
|
#include "display.h"
|
|
|
#include "displayHandler.h"
|
|
#include "displayHandler.h"
|
|
|
-#include "flash.h"
|
|
|
|
|
-#include "httpstream.h"
|
|
|
|
|
#include "keyboard.h"
|
|
#include "keyboard.h"
|
|
|
#include "led.h"
|
|
#include "led.h"
|
|
|
#include "log.h"
|
|
#include "log.h"
|
|
|
#include "mp3stream.h"
|
|
#include "mp3stream.h"
|
|
|
-#include "mmc.h"
|
|
|
|
|
#include "network.h"
|
|
#include "network.h"
|
|
|
#include "ntp.h"
|
|
#include "ntp.h"
|
|
|
#include "portio.h"
|
|
#include "portio.h"
|
|
|
-#include "remcon.h"
|
|
|
|
|
#include "rtc.h"
|
|
#include "rtc.h"
|
|
|
#include "spidrv.h"
|
|
#include "spidrv.h"
|
|
|
#include "system.h"
|
|
#include "system.h"
|
|
@@ -90,10 +84,13 @@ static void SysMainBeatInterrupt(void *p)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
- * scan for valid keys AND check if a MMCard is inserted or removed
|
|
|
|
|
|
|
+ * scan for valid keys
|
|
|
*/
|
|
*/
|
|
|
KbScan();
|
|
KbScan();
|
|
|
- CardCheckCard();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(KbGetKey() != KEY_NO_KEY){
|
|
|
|
|
+ LcdBackLight(LCD_BACKLIGHT_ON);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
@@ -210,7 +207,7 @@ THREAD(StartupInit, arg)
|
|
|
|
|
|
|
|
THREAD(AlarmSync, arg)
|
|
THREAD(AlarmSync, arg)
|
|
|
{
|
|
{
|
|
|
- NutThreadSetPriority(200);
|
|
|
|
|
|
|
+ NutThreadSetPriority(50);
|
|
|
|
|
|
|
|
while(initialized == false){
|
|
while(initialized == false){
|
|
|
NutSleep(1000);
|
|
NutSleep(1000);
|
|
@@ -218,7 +215,6 @@ THREAD(AlarmSync, arg)
|
|
|
|
|
|
|
|
NtpSync();
|
|
NtpSync();
|
|
|
|
|
|
|
|
- #ifndef _SUPPRESS_ALARMSYNC
|
|
|
|
|
for(;;)
|
|
for(;;)
|
|
|
{
|
|
{
|
|
|
if((initialized == true) && (hasNetworkConnection() == true))
|
|
if((initialized == true) && (hasNetworkConnection() == true))
|
|
@@ -235,7 +231,6 @@ THREAD(AlarmSync, arg)
|
|
|
}
|
|
}
|
|
|
NutSleep(3000);
|
|
NutSleep(3000);
|
|
|
}
|
|
}
|
|
|
- #endif
|
|
|
|
|
NutThreadExit();
|
|
NutThreadExit();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -291,22 +286,17 @@ int main(void)
|
|
|
Uart0DriverStart();
|
|
Uart0DriverStart();
|
|
|
LogInit();
|
|
LogInit();
|
|
|
|
|
|
|
|
- CardInit();
|
|
|
|
|
-
|
|
|
|
|
X12Init();
|
|
X12Init();
|
|
|
|
|
|
|
|
VsPlayerInit();
|
|
VsPlayerInit();
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- NtpInit();
|
|
|
|
|
|
|
+ NtpInit();
|
|
|
|
|
|
|
|
NutThreadCreate("BackgroundThread", StartupInit, NULL, 1024);
|
|
NutThreadCreate("BackgroundThread", StartupInit, NULL, 1024);
|
|
|
NutThreadCreate("BackgroundThread", AlarmSync, NULL, 2500);
|
|
NutThreadCreate("BackgroundThread", AlarmSync, NULL, 2500);
|
|
|
//NutThreadCreate("BackgroundThread", NTPSync, NULL, 700);
|
|
//NutThreadCreate("BackgroundThread", NTPSync, NULL, 700);
|
|
|
/** Quick fix for turning off the display after 10 seconds boot */
|
|
/** Quick fix for turning off the display after 10 seconds boot */
|
|
|
|
|
|
|
|
- RcInit();
|
|
|
|
|
-
|
|
|
|
|
KbInit();
|
|
KbInit();
|
|
|
|
|
|
|
|
SysControlMainBeat(ON); // enable 4.4 msecs heartbeat interrupt
|
|
SysControlMainBeat(ON); // enable 4.4 msecs heartbeat interrupt
|
|
@@ -350,22 +340,6 @@ int main(void)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(KbGetKey() == KEY_01){
|
|
|
|
|
- //> "62.195.226.247";
|
|
|
|
|
- printf("KEY_01 DETECTED\n");
|
|
|
|
|
-
|
|
|
|
|
- bool success = connectToStream(inet_addr("62.195.226.247"), 80, "/test5.mp3");
|
|
|
|
|
- if (success == true){
|
|
|
|
|
- play();
|
|
|
|
|
- }else {
|
|
|
|
|
- printf("ConnectToStream failed. Aborting.\n\n");
|
|
|
|
|
- }
|
|
|
|
|
- //playStream("62.195.226.247", 80, "/test.mp3");
|
|
|
|
|
- }
|
|
|
|
|
- if(KbGetKey() == KEY_02){
|
|
|
|
|
- killPlayerThread();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
if(KbGetKey() == KEY_DOWN)
|
|
if(KbGetKey() == KEY_DOWN)
|
|
|
{
|
|
{
|
|
|
NutSleep(150);
|
|
NutSleep(150);
|
|
@@ -392,12 +366,11 @@ int main(void)
|
|
|
handleAlarm(idx);
|
|
handleAlarm(idx);
|
|
|
//NutDelay(50);
|
|
//NutDelay(50);
|
|
|
LcdBackLight(LCD_BACKLIGHT_OFF);
|
|
LcdBackLight(LCD_BACKLIGHT_OFF);
|
|
|
- stopStream();
|
|
|
|
|
- } else if (KbGetKey() == KEY_01 || KbGetKey() == KEY_02 || KbGetKey() == KEY_03 || KbGetKey() == KEY_04 || KbGetKey() == KEY_05 || KbGetKey() == KEY_ALT){
|
|
|
|
|
|
|
+ } else if (KbGetKey() == KEY_01 || KbGetKey() == KEY_02 || KbGetKey() == KEY_03 || KbGetKey() == KEY_04 || KbGetKey() == KEY_05 || KbGetKey() == KEY_ALT){
|
|
|
setSnooze(idx);
|
|
setSnooze(idx);
|
|
|
LcdBackLight(LCD_BACKLIGHT_OFF);
|
|
LcdBackLight(LCD_BACKLIGHT_OFF);
|
|
|
- stopStream();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ killPlayerThread();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|