A GPS disciplined clock

Dependencies:   net lpc1768 crypto clock web log

Committer:
andrewboyson
Date:
Mon Mar 25 10:36:19 2019 +0000
Revision:
46:91237d7f225e
Parent:
40:5f5f18d1c9dc
Updated libraries

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 27:eb5728b9052b 1 #include <time.h>
andrewboyson 27:eb5728b9052b 2
andrewboyson 27:eb5728b9052b 3 #include "http.h"
andrewboyson 27:eb5728b9052b 4 #include "page.h"
andrewboyson 27:eb5728b9052b 5 #include "page-derived.h"
andrewboyson 27:eb5728b9052b 6 #include "http-server.h"
andrewboyson 27:eb5728b9052b 7 #include "clk.h"
andrewboyson 27:eb5728b9052b 8 #include "rtc.h"
andrewboyson 27:eb5728b9052b 9 #include "clkutc.h"
andrewboyson 27:eb5728b9052b 10 #include "clkgov.h"
andrewboyson 27:eb5728b9052b 11 #include "scan.h"
andrewboyson 27:eb5728b9052b 12
andrewboyson 27:eb5728b9052b 13 void HttpHomeHtml()
andrewboyson 27:eb5728b9052b 14 {
andrewboyson 27:eb5728b9052b 15 HttpOk("text/html; charset=UTF-8", "no-cache", NULL, NULL);
andrewboyson 27:eb5728b9052b 16 PageAddHeader(PageSite, "Home", "settings.css", "home.js");
andrewboyson 27:eb5728b9052b 17 PageAddNav(HOME_PAGE);
andrewboyson 27:eb5728b9052b 18 PageAddH1(PageSite, "Home");
andrewboyson 27:eb5728b9052b 19
andrewboyson 27:eb5728b9052b 20 PageAddH2("Status");
andrewboyson 46:91237d7f225e 21 PageAddAjaxLed("RTC is set" , "ajax-rtc-set" );
andrewboyson 46:91237d7f225e 22 PageAddAjaxLed("Clock is set" , "ajax-clock-set" );
andrewboyson 46:91237d7f225e 23 PageAddAjaxLed("PPS is stable" , "ajax-pps-stable" );
andrewboyson 46:91237d7f225e 24 PageAddAjaxLed("Rate synchronised" , "ajax-rate-locked");
andrewboyson 46:91237d7f225e 25 PageAddAjaxLed("Time synchronised" , "ajax-time-locked");
andrewboyson 46:91237d7f225e 26 PageAddAjaxLed("NMEA is stable" , "ajax-nmea-stable");
andrewboyson 27:eb5728b9052b 27
andrewboyson 27:eb5728b9052b 28 PageAddH2("Server UTC time");
andrewboyson 27:eb5728b9052b 29 HttpAddText("<div id='date-utc'></div>\r\n");
andrewboyson 27:eb5728b9052b 30
andrewboyson 27:eb5728b9052b 31 PageAddH2("Server local time");
andrewboyson 27:eb5728b9052b 32 HttpAddText("<div id='date-pc'></div>\r\n");
andrewboyson 27:eb5728b9052b 33
andrewboyson 27:eb5728b9052b 34 PageAddH2("Server - PC (ms)");
andrewboyson 27:eb5728b9052b 35 HttpAddText("<div id='date-diff'></div>\r\n");
andrewboyson 27:eb5728b9052b 36
andrewboyson 27:eb5728b9052b 37 PageAddH2("UTC");
andrewboyson 46:91237d7f225e 38 PageAddAjaxInputToggle("Enable epoch change" , "ajax-leap-enable" , "chg-clock-leap-enable" );
andrewboyson 46:91237d7f225e 39 PageAddAjaxInputToggle("Direction of next epoch" , "ajax-leap-forward" , "chg-clock-leap-forward");
andrewboyson 46:91237d7f225e 40 PageAddAjaxInput ("Year next epoch starts" , 5, "ajax-leap-year" , "set-clock-leap-year" );
andrewboyson 46:91237d7f225e 41 PageAddAjaxInput ("Month next epoch starts" , 5, "ajax-leap-month" , "set-clock-leap-month" );
andrewboyson 46:91237d7f225e 42 PageAddAjaxInput ("Current era offset" , 5, "ajax-leap-count" , "set-clock-leap-count" );
andrewboyson 27:eb5728b9052b 43
andrewboyson 27:eb5728b9052b 44 HttpAddText("<div><button type='button' onclick='DisplayLeap()'>Display Leap</button></div>\r\n");
andrewboyson 27:eb5728b9052b 45
andrewboyson 27:eb5728b9052b 46 HttpAddText("<div>The leap seconds list is available from <a href='https://www.ietf.org/timezones/data/leap-seconds.list' target='_blank'>ietf</a></div>\r\n");
andrewboyson 27:eb5728b9052b 47
andrewboyson 27:eb5728b9052b 48 PageAddEnd();
andrewboyson 27:eb5728b9052b 49 }