A GPS disciplined clock

Dependencies:   net lpc1768 crypto clock web log

Committer:
andrewboyson
Date:
Sun Apr 28 08:31:50 2019 +0000
Revision:
55:a1bd0572c8b6
Parent:
http-derived/home/http-home-html.c@46:91237d7f225e
Child:
57:2d54e570de60
Update web-base library and renamed http-derived to web-derived

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 27:eb5728b9052b 1 #include <time.h>
andrewboyson 27:eb5728b9052b 2
andrewboyson 55:a1bd0572c8b6 3 #include "http.h"
andrewboyson 55:a1bd0572c8b6 4 #include "page.h"
andrewboyson 27:eb5728b9052b 5 #include "page-derived.h"
andrewboyson 55:a1bd0572c8b6 6 #include "web-base.h"
andrewboyson 55:a1bd0572c8b6 7 #include "clk.h"
andrewboyson 55:a1bd0572c8b6 8 #include "rtc.h"
andrewboyson 55:a1bd0572c8b6 9 #include "clkutc.h"
andrewboyson 55:a1bd0572c8b6 10 #include "clkgov.h"
andrewboyson 55:a1bd0572c8b6 11 #include "scan.h"
andrewboyson 27:eb5728b9052b 12
andrewboyson 55:a1bd0572c8b6 13 void WebHomeHtml()
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 }