From c4133319bdea3aeec494b90edf7e9f26b875e0b5 Mon Sep 17 00:00:00 2001 From: Mike Beattie Date: Thu, 22 Mar 2012 18:27:26 +1300 Subject: move config init to variable declaration (cleaner) Signed-off-by: Mike Beattie --- HouseControl.ino | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/HouseControl.ino b/HouseControl.ino index a8f7650..bd15c57 100644 --- a/HouseControl.ino +++ b/HouseControl.ino @@ -72,7 +72,29 @@ struct st_door { time_t time; time_t blinkTime = 0; -struct st_config config; +struct st_config config = { + // Config version. Set to 0 to debug (doesn't read from eeprom) + //5, + 0, + + // Ethernet MAC address + 0x00, 0xA5, 0xCB, 0x28, 0xF4, 0xCC, // "Production" + //0x00, 0xA5, 0xCB, 0x28, 0xF4, 0xCD, // "Testing" + + 10, 113, 1, 160, // Default IP if no DHCP + 255, 255, 255, 0, // Default Netmask if no DHCP + 10, 113, 1, 254, // Default GW if no DHCP + + 10, 113, 1, 1, // NTP Server + 1300, // UTC offset + + 10, 113, 1, 255, // Host to send UDP status packets to + 8888, // Port to send UDP status packets to + + 7, // "Dawn" + 21 // "Dusk" - used to shut garage doors at night. + +}; struct st_door frontDoor; struct st_door garageDoor1; @@ -405,6 +427,7 @@ void toggleDoorControl(struct st_door *door) { void setup() { byte eepromVersion; +/* config.configVersion = 3; config.mac[0] = 0x00; @@ -437,6 +460,7 @@ void setup() { config.dawn = 7; config.dusk = 21; +*/ eepromRead(0, eepromVersion); -- cgit v1.2.3