Smart Clock
Dependencies: AlarmClock DigitalClock EthernetInterface FourDigitLED HTTPClient NTPClient SDFileSystem TrainStat WeatherInfo XML_aide mbed-rtos mbed picojson wolfSSL
Diff: main.cpp
- Revision:
- 3:2cb03c287c22
- Parent:
- 2:bcc1a40ffa04
- Child:
- 4:8a2d1544d6e0
--- a/main.cpp Fri Jun 26 09:35:53 2015 +0000 +++ b/main.cpp Sat Jun 27 06:20:59 2015 +0000 @@ -11,7 +11,7 @@ /* Alarm, Hour, Min, Tone */D13, D14, D15, PTC11 ) ; -TrainStat trainstat ; +TrainStat trainstat(YAHOO_TRAIN) ; static void ntp(char *site) { @@ -29,20 +29,19 @@ void clock_main(void const *av) { - ntp("ntp.jst.mfeed.ad.jp") ; + alarmclock.start() ; while(1){ alarmclock.poll() ; Thread::wait(100); } } - + void net_main(void const *av) { bool sw ; trainstat.setLine("千代田線") ; - wait(2.0) ; while(1) { sw = !sw ; if(!trainstat.getStat()) @@ -65,7 +64,8 @@ if(ret == 0)break ; Thread::wait(10); } - + ntp("ntp.jst.mfeed.ad.jp") ; + #define NET_STACK 16000 Thread t_clock(clock_main, NULL, osPriorityNormal); Thread t_net (net_main, NULL, osPriorityNormal, NET_STACK );