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: 1-wire clock crypto fram log lpc1768 net web wiz mbed
main/main.c@3:f1464bf461c1, 2021-05-13 (annotated)
- Committer:
- andrewboyson
- Date:
- Thu May 13 16:49:56 2021 +0000
- Revision:
- 3:f1464bf461c1
- Parent:
- 0:22b158d3c76f
- Child:
- 4:d98e267bbd8d
Moved settings setup from being split up amongst all the modules which have settings to the settings init routine. This makes it much easier to add settings without displacing those which exist already.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 0:22b158d3c76f | 1 | #include "lpc1768.h" |
andrewboyson | 0:22b158d3c76f | 2 | #include "periphs.h" |
andrewboyson | 0:22b158d3c76f | 3 | #include "led.h" |
andrewboyson | 0:22b158d3c76f | 4 | #include "clk.h" |
andrewboyson | 0:22b158d3c76f | 5 | #include "log.h" |
andrewboyson | 0:22b158d3c76f | 6 | #include "fram.h" |
andrewboyson | 0:22b158d3c76f | 7 | #include "net.h" |
andrewboyson | 0:22b158d3c76f | 8 | #include "1-wire.h" |
andrewboyson | 0:22b158d3c76f | 9 | #include "1-wire-device.h" |
andrewboyson | 0:22b158d3c76f | 10 | #include "heating.h" |
andrewboyson | 0:22b158d3c76f | 11 | #include "settings.h" |
andrewboyson | 0:22b158d3c76f | 12 | #include "web.h" |
andrewboyson | 0:22b158d3c76f | 13 | #include "settings.h" |
andrewboyson | 0:22b158d3c76f | 14 | #include "values.h" |
andrewboyson | 0:22b158d3c76f | 15 | #include "restart.h" |
andrewboyson | 0:22b158d3c76f | 16 | #include "restart-this.h" |
andrewboyson | 0:22b158d3c76f | 17 | #include "crypto.h" |
andrewboyson | 0:22b158d3c76f | 18 | #include "wiz.h" |
andrewboyson | 0:22b158d3c76f | 19 | |
andrewboyson | 0:22b158d3c76f | 20 | int main() |
andrewboyson | 0:22b158d3c76f | 21 | { |
andrewboyson | 0:22b158d3c76f | 22 | RestartZone = RESTART_ZONE_INIT; |
andrewboyson | 0:22b158d3c76f | 23 | PeriphsInit(); |
andrewboyson | 0:22b158d3c76f | 24 | LedInit(); |
andrewboyson | 0:22b158d3c76f | 25 | Lpc1768Init(); |
andrewboyson | 0:22b158d3c76f | 26 | ClkInit(); |
andrewboyson | 0:22b158d3c76f | 27 | LogInit(ClkNowTmUtc, 115200); |
andrewboyson | 3:f1464bf461c1 | 28 | if ( SettingsInit()) goto end; //Fram is initialised here |
andrewboyson | 0:22b158d3c76f | 29 | CryptoInit(); //Uses log |
andrewboyson | 0:22b158d3c76f | 30 | NetInit(); |
andrewboyson | 3:f1464bf461c1 | 31 | WebInit(); |
andrewboyson | 3:f1464bf461c1 | 32 | OneWireInit(); |
andrewboyson | 3:f1464bf461c1 | 33 | DeviceInit(); |
andrewboyson | 3:f1464bf461c1 | 34 | HeatingInit(); |
andrewboyson | 0:22b158d3c76f | 35 | if ( ValuesInit()) goto end; |
andrewboyson | 0:22b158d3c76f | 36 | WizInit(); |
andrewboyson | 0:22b158d3c76f | 37 | while (1) |
andrewboyson | 0:22b158d3c76f | 38 | { |
andrewboyson | 0:22b158d3c76f | 39 | RestartZone = RESTART_ZONE_LOG; LogMain(); |
andrewboyson | 0:22b158d3c76f | 40 | RestartZone = RESTART_ZONE_CLOCK; ClkMain(); |
andrewboyson | 0:22b158d3c76f | 41 | RestartZone = RESTART_ZONE_NET; NetMain(); |
andrewboyson | 0:22b158d3c76f | 42 | RestartZone = RESTART_ZONE_VALUES; ValuesMain(); |
andrewboyson | 0:22b158d3c76f | 43 | RestartZone = RESTART_ZONE_ONE_WIRE; if (OneWireMain()) break; |
andrewboyson | 0:22b158d3c76f | 44 | RestartZone = RESTART_ZONE_DEVICE; if ( DeviceMain()) break; |
andrewboyson | 0:22b158d3c76f | 45 | RestartZone = RESTART_ZONE_HEATING; HeatingMain(); |
andrewboyson | 0:22b158d3c76f | 46 | RestartZone = RESTART_ZONE_LPC1768; Lpc1768Main(); |
andrewboyson | 0:22b158d3c76f | 47 | RestartZone = RESTART_ZONE_CRYPTO; CryptoMain(); |
andrewboyson | 0:22b158d3c76f | 48 | WizMain(); |
andrewboyson | 0:22b158d3c76f | 49 | } |
andrewboyson | 0:22b158d3c76f | 50 | |
andrewboyson | 0:22b158d3c76f | 51 | end: |
andrewboyson | 0:22b158d3c76f | 52 | Led1Set(1); Led2Set(1); Led3Set(1); Led4Set(1); |
andrewboyson | 0:22b158d3c76f | 53 | return 0; |
andrewboyson | 0:22b158d3c76f | 54 | } |