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
- Committer:
- andrewboyson
- Date:
- 2018-12-02
- Revision:
- 11:fa01ea25b62d
- Parent:
- 8:8b5e0bb28da0
- Child:
- 15:f91462db6088
File content as of revision 11:fa01ea25b62d:
#include "system.h"
#include "watchdog.h"
#include "periphs.h"
#include "led.h"
#include "clock.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;
}