mbed Weather Platform firmware http://mbed.org/users/okini3939/notebook/mbed-weather-platform-firmware/
Dependencies: ChaNFSSD EthernetNetIf I2CLEDDisp Agentbed ChaNFSUSB ILinterpreter mbed BMP085 WeatherMeters ConfigFile ChaNFS I2CLCD
Diff: ilip.cpp
- Revision:
- 2:a3e5edf84f74
- Parent:
- 1:6c7141895545
--- a/ilip.cpp Sun Jul 10 15:36:46 2011 +0000 +++ b/ilip.cpp Wed Aug 24 13:22:32 2011 +0000 @@ -108,7 +108,7 @@ case 'P': // Pachube if (mne == MNE_OUT && reg) { - pachube(csv); + pachube(); } break; @@ -136,6 +136,13 @@ email(keynum); } break; + + case 'x': // NTP + if (mne == MNE_OUT && reg && conf.ntpserver[0]) { + ntp(conf.ntpserver); + } + break; + } pool_net(); @@ -180,8 +187,8 @@ #ifdef USE_EXINOUT // set output if (exinout_flg) { - *exout1 = sensor.output[0]; - *exout2 = sensor.output[1]; + led3 = *exout1 = sensor.output[0]; + led4 = *exout2 = sensor.output[1]; } #endif @@ -193,21 +200,19 @@ int r; char buf[40]; - if (cfg.getValue("XBEE", buf, sizeof(buf))) { - xbee.baud(atoi(chop(buf))); + if (conf.xbeebaud) { + xbee.baud(conf.xbeebaud); } #ifdef USE_EXINOUT - if (cfg.getValue("INPUT", buf, sizeof(buf))) { - if (atoi(buf) == INPUT_EXINOUT) { - exout1 = new DigitalOut(p30); - exout2 = new DigitalOut(p29); - exin1 = new DigitalIn(p18); - exin1->mode(PullUp); - exin2 = new DigitalIn(p19); - exin2->mode(PullUp); - exinout_flg = 1; - } + if (conf.inputtype == INPUT_EXINOUT) { + exout1 = new DigitalOut(p30); + exout2 = new DigitalOut(p29); + exin1 = new DigitalIn(p18); + exin1->mode(PullUp); + exin2 = new DigitalIn(p19); + exin2->mode(PullUp); + exinout_flg = 1; } #endif