mbed Weather Platform firmware http://mbed.org/users/okini3939/notebook/mbed-weather-platform-firmware/
Dependencies: EthernetNetIf SDHCFileSystem I2CLEDDisp Agentbed NTPClient_NetServices mbed BMP085 HTTPClient ConfigFile I2CLCD
Diff: conf.cpp
- Revision:
- 16:df39da7bef98
- Parent:
- 15:07bfa25ba6ae
- Child:
- 18:9286e5010c14
diff -r 07bfa25ba6ae -r df39da7bef98 conf.cpp --- a/conf.cpp Wed Mar 30 20:09:04 2011 +0000 +++ b/conf.cpp Fri Apr 01 23:37:04 2011 +0000 @@ -4,17 +4,10 @@ #include "mbed.h" #include "conf.h" #include "ConfigFile.h" -#include "I2CLEDDisp.h" -#include "I2CLCD.h" extern Serial xbee; extern Config conf; extern Sensor sensor, offset, sensor_old; -extern I2C i2c; -extern I2CLCD *lcd; -extern I2CLEDDisp *leddisp; -extern AnalogIn *aimoist; -extern InterruptIn *intcounter; void int_counter(); @@ -267,8 +260,6 @@ ConfigFile cfg; char buf[80], key[20]; int ip0, ip1, ip2, ip3; - enum I2CLCDType lcdtype = LCD16x2; - enum I2CLCDConfig lcdconf = LCDCFG_3V; conf.ipaddr = IpAddr(0, 0, 0, 0); conf.netmask = IpAddr(255, 255, 255, 0); @@ -290,6 +281,8 @@ conf.snmp_commname[0] = 0; conf.leddisp_mesg[0] = 0; conf.lcd_mesg[0] = 0; + conf.lcdtype = LCD16x2; + conf.lcdconf = LCDCFG_3V; memset(&offset, 0, sizeof(offset)); memset(&sensor_old, 0, sizeof(sensor_old)); @@ -358,18 +351,16 @@ chop(conf.snmp_commname); if (cfg.getValue("LCD_TYPE", buf, sizeof(buf))) { - lcdtype = (enum I2CLCDType)atoi(chop(buf)); + conf.lcdtype = (enum I2CLCDType)atoi(chop(buf)); } if (cfg.getValue("LCD_CONF", buf, sizeof(buf))) { - lcdconf = (enum I2CLCDConfig)atoi(chop(buf)); + conf.lcdconf = (enum I2CLCDConfig)atoi(chop(buf)); } if (cfg.getValue("LCD_MESG", conf.lcd_mesg, sizeof(conf.lcd_mesg))) { chop(conf.lcd_mesg); - lcd = new I2CLCD(i2c, I2CLCD_ADDR, lcdtype, lcdconf); } if (cfg.getValue("LEDDISP_MESG", conf.leddisp_mesg, sizeof(conf.leddisp_mesg))) { chop(conf.leddisp_mesg); - leddisp = new I2CLEDDisp(i2c); } if (cfg.getValue("XBEE", buf, sizeof(buf))) { @@ -379,19 +370,6 @@ if (cfg.getValue("INPUT", buf, sizeof(buf))) { conf.inputtype = (enum eINPUTTYPE)atoi(chop(buf)); } - if (cfg.getValue("INPUT", buf, sizeof(buf))) { - conf.inputtype = (enum eINPUTTYPE)atoi(chop(buf)); - } - if (conf.inputtype == INPUT_FALL) { - intcounter = new InterruptIn(p18); - intcounter->fall(&int_counter); - } else - if (conf.inputtype == INPUT_RISE) { - intcounter = new InterruptIn(p18); - intcounter->rise(&int_counter); - } else { - aimoist = new AnalogIn(p18); - } for (i = 0; i < CF_ACTION_NUM; i ++) { sprintf(key, "ACTION[%d]", i);