Central Heating controller using the real time clock, PHY module for internet, 1-wire interface for temperature sensors, a system log and a configuration file

Dependencies:   net 1-wire lpc1768 crypto clock web fram log

/media/uploads/andrewboyson/heating.sch

/media/uploads/andrewboyson/heating.brd

/media/uploads/andrewboyson/eagle.epf

Committer:
andrewboyson
Date:
Tue Apr 23 18:47:47 2019 +0000
Revision:
47:229338b3adcb
Child:
48:6eac12df3ad5
Provided individual scripts per page and moved most inputs to ajax.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 47:229338b3adcb 1 #include <stdint.h>
andrewboyson 47:229338b3adcb 2 #include <stdio.h>
andrewboyson 47:229338b3adcb 3
andrewboyson 47:229338b3adcb 4 #include "http.h"
andrewboyson 47:229338b3adcb 5 #include "http-server.h"
andrewboyson 47:229338b3adcb 6 #include "boiler.h"
andrewboyson 47:229338b3adcb 7 #include "radiator.h"
andrewboyson 47:229338b3adcb 8 #include "ds18b20.h"
andrewboyson 47:229338b3adcb 9 #include "program.h"
andrewboyson 47:229338b3adcb 10 #include "1-wire.h"
andrewboyson 47:229338b3adcb 11 #include "1-wire-bus.h"
andrewboyson 47:229338b3adcb 12 #include "1-wire-device.h"
andrewboyson 47:229338b3adcb 13 static void addRomToHttp(char* pRom)
andrewboyson 47:229338b3adcb 14 {
andrewboyson 47:229338b3adcb 15 for (char* p = pRom; p < pRom + 8; p++) HttpAddByteAsHex(*p);
andrewboyson 47:229338b3adcb 16 }
andrewboyson 47:229338b3adcb 17
andrewboyson 47:229338b3adcb 18 void HttpSystemAjax()
andrewboyson 47:229338b3adcb 19 {
andrewboyson 47:229338b3adcb 20 HttpOk("text/plain; charset=UTF-8", "no-cache", NULL, NULL);
andrewboyson 47:229338b3adcb 21
andrewboyson 47:229338b3adcb 22 addRomToHttp(RadiatorGetHallRom()); HttpAddChar('\n');
andrewboyson 47:229338b3adcb 23 addRomToHttp(BoilerGetTankRom ()); HttpAddChar('\n');
andrewboyson 47:229338b3adcb 24 addRomToHttp(BoilerGetOutputRom()); HttpAddChar('\n');
andrewboyson 47:229338b3adcb 25 addRomToHttp(BoilerGetReturnRom()); HttpAddChar('\n');
andrewboyson 47:229338b3adcb 26 HttpAddChar('\f');
andrewboyson 47:229338b3adcb 27
andrewboyson 47:229338b3adcb 28 for (int device = 0; device < DeviceCount; device++)
andrewboyson 47:229338b3adcb 29 {
andrewboyson 47:229338b3adcb 30 addRomToHttp ( DeviceList + device * 8);
andrewboyson 47:229338b3adcb 31 HttpAddInt16AsHex(*(DS18B20Value + device) );
andrewboyson 47:229338b3adcb 32 HttpAddChar('\n');
andrewboyson 47:229338b3adcb 33 }
andrewboyson 47:229338b3adcb 34 HttpAddChar('\f');
andrewboyson 47:229338b3adcb 35
andrewboyson 47:229338b3adcb 36 HttpAddInt16AsHex (DeviceScanMs); HttpAddChar('\n');
andrewboyson 47:229338b3adcb 37 HttpAddInt16AsHex (OneWireBusLowTweak); HttpAddChar('\n');
andrewboyson 47:229338b3adcb 38 HttpAddInt16AsHex (OneWireBusFloatTweak); HttpAddChar('\n');
andrewboyson 47:229338b3adcb 39 HttpAddInt16AsHex (OneWireBusReadTweak); HttpAddChar('\n');
andrewboyson 47:229338b3adcb 40 HttpAddInt16AsHex (OneWireBusHighTweak); HttpAddChar('\n');
andrewboyson 47:229338b3adcb 41 HttpAddInt16AsHex (OneWireBusReleaseTweak); HttpAddChar('\n');
andrewboyson 47:229338b3adcb 42 HttpAddNibbleAsHex(OneWireTrace); HttpAddChar('\n');
andrewboyson 47:229338b3adcb 43 }
andrewboyson 47:229338b3adcb 44