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:
- 2018-11-18
- Revision:
- 8:8b5e0bb28da0
- Parent:
- 6:b325de442777
- Child:
- 11:fa01ea25b62d
File content as of revision 8:8b5e0bb28da0:
#include "system.h" #include "watchdog.h" #include "periphs.h" #include "led.h" #include "clock.h" #include "tick.h" #include "log.h" #include "fram.h" #include "net-server.h" #include "1-wire.h" #include "1-wire-device.h" #include "heating.h" #include "settings.h" #include "ntp-client.h" #include "server-http.h" #include "settings.h" #include "values.h" #include "debounce.h" int main() { PeriphsInit(); SystemInit(); LedInit(); ClockInit(); LogInit(ClockTmUtc, 115200); if ( FramInit()) goto end; //Reserves 1 FRAM byte to detect if empty if ( WatchdogInit()) goto end; //Reserves 1 FRAM byte for the program position NetServerInit(); if (NtpClientInit()) goto end; ServerHttpInit(); OneWireInit(); DeviceInit(); HeatingInit(); DebounceInit(); if ( SettingsInit()) goto end; if ( ValuesInit()) goto end; while (1) { WatchdogThisProgramPosition = 1; WatchdogMain(); WatchdogThisProgramPosition = 2; LogMain(); WatchdogThisProgramPosition = 3; ClockMain(); WatchdogThisProgramPosition = 4; NetServerMain(); WatchdogThisProgramPosition = 5; NtpClientMain(); WatchdogThisProgramPosition = 6; ValuesMain(); WatchdogThisProgramPosition = 7; if ( OneWireMain()) break; WatchdogThisProgramPosition = 8; if ( DeviceMain()) break; WatchdogThisProgramPosition = 9; HeatingMain(); } end: Led1Set(1); Led2Set(1); Led3Set(1); Led4Set(1); return 0; }