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
Diff: heating/values.c
- Revision:
- 48:6eac12df3ad5
- Parent:
- 41:6413522ed343
- Child:
- 57:72c1c1357861
diff -r 229338b3adcb -r 6eac12df3ad5 heating/values.c --- a/heating/values.c Tue Apr 23 18:47:47 2019 +0000 +++ b/heating/values.c Fri Apr 26 16:40:19 2019 +0000 @@ -6,6 +6,7 @@ #include "dnslabel.h" #include "fram.h" #include "clk.h" +#include "clktime.h" #include "mstimer.h" #include "clktm.h" #include "ds18b20.h" @@ -25,12 +26,13 @@ static int32_t count; static int iCount; static int iData; -char* ValuesGetServerName ( ) { return serverName; } -char* ValuesGetFileName ( ) { return fileName; } -int ValuesGetWriteSize ( ) { return (int) writeSize; } -int ValuesGetReadInterval ( ) { return (int) readInterval; } -void ValuesGetStartTm (struct tm* ptm) { ClkTimeToTmUtc(startTime, ptm);} -int ValuesGetCount ( ) { return (int) count; } +char* ValuesGetServerName ( ) { return serverName; } +char* ValuesGetFileName ( ) { return fileName; } +int ValuesGetWriteSize ( ) { return (int) writeSize; } +int ValuesGetReadInterval ( ) { return (int) readInterval; } +void ValuesGetStartTm (struct tm* ptm) { ClkTimeToTmUtc(startTime, ptm); } +int64_t ValuesGetStartTime ( ) { return startTime >> CLK_TIME_ONE_SECOND_SHIFT;} +int ValuesGetCount ( ) { return (int) count; } void ValuesSetServerName (char* value) { DnsLabelCopy(serverName, value); FramWrite(iServerName , DNS_MAX_LABEL_LENGTH, serverName ); } void ValuesSetFileName (char* value) { DnsLabelCopy( fileName, value); FramWrite(iFileName , DNS_MAX_LABEL_LENGTH, fileName ); } @@ -77,19 +79,19 @@ { uint64_t record = 0; uint16_t value; - value = DS18B20ValueFromRom(RadiatorGetHallRom()); + value = RadiatorGetHallDS18B20Value(); value &= 0x0FFF; record |= value; //0000 0000 0000 0AAA record <<= 12; //0000 0000 00AA A000 - value = DS18B20ValueFromRom(BoilerGetTankRom ()); + value = BoilerGetTankDS18B20Value(); value &= 0x0FFF; record |= value; //0000 0000 00AA ABBB record <<= 12; //0000 000A AABB B000 - value = DS18B20ValueFromRom(BoilerGetOutputRom()); + value = BoilerGetOutputDS18B20Value(); value &= 0x0FFF; record |= value; //0000 000A AABB BCCC record <<= 12; //0000 AAAB BBCC C000 - value = DS18B20ValueFromRom(BoilerGetReturnRom()); + value = BoilerGetReturnDS18B20Value(); value &= 0x0FFF; record |= value; //0000 AAAB BBCC CDDD record <<= 16; //AAAB BBCC CDDD 0000