Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: net 1-wire lpc1768 crypto clock web fram log
main/main.c@17:13a1068dda70, 2019-01-03 (annotated)
- Committer:
- andrewboyson
- Date:
- Thu Jan 03 17:30:07 2019 +0000
- Revision:
- 17:13a1068dda70
- Parent:
- 16:48ef9d43018b
- Child:
- 19:969f7be69225
Updated net library
Who changed what in which revision?
| User | Revision | Line number | New 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 | 17:13a1068dda70 | 8 | #include "net.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 | 15:f91462db6088 | 14 | #include "http-server.h" | 
| andrewboyson | 8:8b5e0bb28da0 | 15 | #include "settings.h" | 
| andrewboyson | 0:3c04f4b47041 | 16 | #include "values.h" | 
| andrewboyson | 6:b325de442777 | 17 | #include "debounce.h" | 
| andrewboyson | 16:48ef9d43018b | 18 | #include "fault.h" | 
| andrewboyson | 0:3c04f4b47041 | 19 | |
| andrewboyson | 0:3c04f4b47041 | 20 | int main() | 
| andrewboyson | 0:3c04f4b47041 | 21 | { | 
| andrewboyson | 16:48ef9d43018b | 22 | FaultZone = FAULT_ZONE_INIT; | 
| andrewboyson | 1:ccc66fdf858d | 23 | PeriphsInit(); | 
| andrewboyson | 4:9e1c6ac4ef06 | 24 | SystemInit(); | 
| andrewboyson | 4:9e1c6ac4ef06 | 25 | LedInit(); | 
| andrewboyson | 0:3c04f4b47041 | 26 | ClockInit(); | 
| andrewboyson | 4:9e1c6ac4ef06 | 27 | LogInit(ClockTmUtc, 115200); | 
| andrewboyson | 0:3c04f4b47041 | 28 | if ( FramInit()) goto end; //Reserves 1 FRAM byte to detect if empty | 
| andrewboyson | 16:48ef9d43018b | 29 | FramAllocate(4); //Reserves 4 FRAM bytes where the watchdog used to hold the last program position | 
| andrewboyson | 17:13a1068dda70 | 30 | NetInit("ch4", "ch6"); | 
| andrewboyson | 1:ccc66fdf858d | 31 | if (NtpClientInit()) goto end; | 
| andrewboyson | 15:f91462db6088 | 32 | HttpServerInit(); | 
| andrewboyson | 0:3c04f4b47041 | 33 | OneWireInit(); | 
| andrewboyson | 0:3c04f4b47041 | 34 | DeviceInit(); | 
| andrewboyson | 0:3c04f4b47041 | 35 | HeatingInit(); | 
| andrewboyson | 6:b325de442777 | 36 | DebounceInit(); | 
| andrewboyson | 0:3c04f4b47041 | 37 | if ( SettingsInit()) goto end; | 
| andrewboyson | 0:3c04f4b47041 | 38 | if ( ValuesInit()) goto end; | 
| andrewboyson | 16:48ef9d43018b | 39 | WatchdogInit(); | 
| andrewboyson | 0:3c04f4b47041 | 40 | |
| andrewboyson | 0:3c04f4b47041 | 41 | while (1) | 
| andrewboyson | 0:3c04f4b47041 | 42 | { | 
| andrewboyson | 16:48ef9d43018b | 43 | FaultZone = FAULT_ZONE_LOG; LogMain(); | 
| andrewboyson | 16:48ef9d43018b | 44 | FaultZone = FAULT_ZONE_CLOCK; ClockMain(); | 
| andrewboyson | 17:13a1068dda70 | 45 | FaultZone = FAULT_ZONE_NET; NetMain(); | 
| andrewboyson | 16:48ef9d43018b | 46 | FaultZone = FAULT_ZONE_NONE; NtpClientMain(); | 
| andrewboyson | 16:48ef9d43018b | 47 | FaultZone = FAULT_ZONE_NONE; ValuesMain(); | 
| andrewboyson | 16:48ef9d43018b | 48 | FaultZone = FAULT_ZONE_NONE; if ( OneWireMain()) break; | 
| andrewboyson | 16:48ef9d43018b | 49 | FaultZone = FAULT_ZONE_NONE; if ( DeviceMain()) break; | 
| andrewboyson | 16:48ef9d43018b | 50 | FaultZone = FAULT_ZONE_NONE; HeatingMain(); | 
| andrewboyson | 16:48ef9d43018b | 51 | FaultZone = FAULT_ZONE_NONE; WatchdogMain(); | 
| andrewboyson | 0:3c04f4b47041 | 52 | } | 
| andrewboyson | 0:3c04f4b47041 | 53 | |
| andrewboyson | 0:3c04f4b47041 | 54 | end: | 
| andrewboyson | 1:ccc66fdf858d | 55 | Led1Set(1); Led2Set(1); Led3Set(1); Led4Set(1); | 
| andrewboyson | 0:3c04f4b47041 | 56 | return 0; | 
| andrewboyson | 0:3c04f4b47041 | 57 | } |