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

Committer:
andrewboyson
Date:
Sun Dec 02 19:17:40 2018 +0000
Revision:
11:fa01ea25b62d
Parent:
8:8b5e0bb28da0
Child:
15:f91462db6088
Updated clock library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 4:9e1c6ac4ef06 1 #include "system.h"
andrewboyson 0:3c04f4b47041 2 #include "watchdog.h"
andrewboyson 1:ccc66fdf858d 3 #include "periphs.h"
andrewboyson 0:3c04f4b47041 4 #include "led.h"
andrewboyson 0:3c04f4b47041 5 #include "clock.h"
andrewboyson 0:3c04f4b47041 6 #include "log.h"
andrewboyson 0:3c04f4b47041 7 #include "fram.h"
andrewboyson 1:ccc66fdf858d 8 #include "net-server.h"
andrewboyson 0:3c04f4b47041 9 #include "1-wire.h"
andrewboyson 0:3c04f4b47041 10 #include "1-wire-device.h"
andrewboyson 0:3c04f4b47041 11 #include "heating.h"
andrewboyson 0:3c04f4b47041 12 #include "settings.h"
andrewboyson 0:3c04f4b47041 13 #include "ntp-client.h"
andrewboyson 0:3c04f4b47041 14 #include "server-http.h"
andrewboyson 8:8b5e0bb28da0 15 #include "settings.h"
andrewboyson 0:3c04f4b47041 16 #include "values.h"
andrewboyson 6:b325de442777 17 #include "debounce.h"
andrewboyson 0:3c04f4b47041 18
andrewboyson 0:3c04f4b47041 19 int main()
andrewboyson 0:3c04f4b47041 20 {
andrewboyson 1:ccc66fdf858d 21 PeriphsInit();
andrewboyson 4:9e1c6ac4ef06 22 SystemInit();
andrewboyson 4:9e1c6ac4ef06 23 LedInit();
andrewboyson 0:3c04f4b47041 24 ClockInit();
andrewboyson 4:9e1c6ac4ef06 25 LogInit(ClockTmUtc, 115200);
andrewboyson 0:3c04f4b47041 26 if ( FramInit()) goto end; //Reserves 1 FRAM byte to detect if empty
andrewboyson 0:3c04f4b47041 27 if ( WatchdogInit()) goto end; //Reserves 1 FRAM byte for the program position
andrewboyson 1:ccc66fdf858d 28 NetServerInit();
andrewboyson 1:ccc66fdf858d 29 if (NtpClientInit()) goto end;
andrewboyson 0:3c04f4b47041 30 ServerHttpInit();
andrewboyson 0:3c04f4b47041 31 OneWireInit();
andrewboyson 0:3c04f4b47041 32 DeviceInit();
andrewboyson 0:3c04f4b47041 33 HeatingInit();
andrewboyson 6:b325de442777 34 DebounceInit();
andrewboyson 0:3c04f4b47041 35 if ( SettingsInit()) goto end;
andrewboyson 0:3c04f4b47041 36 if ( ValuesInit()) goto end;
andrewboyson 0:3c04f4b47041 37
andrewboyson 0:3c04f4b47041 38 while (1)
andrewboyson 0:3c04f4b47041 39 {
andrewboyson 0:3c04f4b47041 40 WatchdogThisProgramPosition = 1; WatchdogMain();
andrewboyson 0:3c04f4b47041 41 WatchdogThisProgramPosition = 2; LogMain();
andrewboyson 0:3c04f4b47041 42 WatchdogThisProgramPosition = 3; ClockMain();
andrewboyson 1:ccc66fdf858d 43 WatchdogThisProgramPosition = 4; NetServerMain();
andrewboyson 0:3c04f4b47041 44 WatchdogThisProgramPosition = 5; NtpClientMain();
andrewboyson 0:3c04f4b47041 45 WatchdogThisProgramPosition = 6; ValuesMain();
andrewboyson 0:3c04f4b47041 46 WatchdogThisProgramPosition = 7; if ( OneWireMain()) break;
andrewboyson 0:3c04f4b47041 47 WatchdogThisProgramPosition = 8; if ( DeviceMain()) break;
andrewboyson 0:3c04f4b47041 48 WatchdogThisProgramPosition = 9; HeatingMain();
andrewboyson 0:3c04f4b47041 49 }
andrewboyson 0:3c04f4b47041 50
andrewboyson 0:3c04f4b47041 51 end:
andrewboyson 1:ccc66fdf858d 52 Led1Set(1); Led2Set(1); Led3Set(1); Led4Set(1);
andrewboyson 0:3c04f4b47041 53 return 0;
andrewboyson 0:3c04f4b47041 54 }