Central Heating controller using the real time clock, PHY module for internet, 1-wire interface for temperature sensors, a system log and a configuration file
Dependencies: net 1-wire lpc1768 crypto clock web fram log
/media/uploads/andrewboyson/heating.sch
/media/uploads/andrewboyson/heating.brd
/media/uploads/andrewboyson/eagle.epf
main/main.c
- Committer:
- andrewboyson
- Date:
- 2019-05-09
- Revision:
- 59:593ed054a439
- Parent:
- 58:d968191f46f2
- Child:
- 74:8228f0297227
File content as of revision 59:593ed054a439:
#include "lpc1768.h" #include "periphs.h" #include "led.h" #include "clk.h" #include "log.h" #include "fram.h" #include "net.h" #include "1-wire.h" #include "1-wire-device.h" #include "heating.h" #include "settings.h" #include "web.h" #include "settings.h" #include "values.h" #include "restart.h" #include "restart-this.h" int main() { RestartZone = RESTART_ZONE_INIT; PeriphsInit(); Lpc1768Init(); LedInit(); ClkInit(); LogInit(ClkNowTmUtc, 115200); if ( FramInit()) goto end; //Reserves 1 FRAM byte to detect if empty FramAllocate(4); //Reserves 4 FRAM bytes where the watchdog used to hold the last program position NetInit("ch4", "ch6"); if (SettingsNtpInit()) goto end; //Loads of FRAM WebInit(); //No FRAM OneWireInit(); //No FRAM DeviceInit(); //No FRAM HeatingInit(); //Loads of FRAM if ( SettingsInit()) goto end; if ( ValuesInit()) goto end; while (1) { RestartZone = RESTART_ZONE_LOG; LogMain(); RestartZone = RESTART_ZONE_CLOCK; ClkMain(); RestartZone = RESTART_ZONE_NET; NetMain(); RestartZone = RESTART_ZONE_VALUES; ValuesMain(); RestartZone = RESTART_ZONE_ONE_WIRE; if (OneWireMain()) break; RestartZone = RESTART_ZONE_DEVICE; if ( DeviceMain()) break; RestartZone = RESTART_ZONE_HEATING; HeatingMain(); RestartZone = RESTART_ZONE_LPC1768; Lpc1768Main(); } end: Led1Set(1); Led2Set(1); Led3Set(1); Led4Set(1); return 0; }