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

Revision:
1:ccc66fdf858d
Parent:
0:3c04f4b47041
Child:
11:fa01ea25b62d
diff -r 3c04f4b47041 -r ccc66fdf858d heating/values.c
--- a/heating/values.c	Thu Jan 11 17:40:08 2018 +0000
+++ b/heating/values.c	Sun Jan 28 14:41:12 2018 +0000
@@ -5,7 +5,7 @@
 #include "tftp.h"
 #include "dns.h"
 #include "fram.h"
-#include "clock.h"
+#include "tick.h"
 #include "ds18b20.h"
 #include "radiator.h"
 #include "boiler.h"
@@ -23,12 +23,12 @@
 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) { ClockNsToTmUtc(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) { TicksToTmUtc(startTime, ptm);  }
+int     ValuesGetCount        (              ) { return (int)        count;         }
 
 static void lblcpy(char* dst, char* src) { strncpy(dst, src, DNS_MAX_LABEL_LENGTH); dst[DNS_MAX_LABEL_LENGTH] = 0; }
 
@@ -104,7 +104,7 @@
     record |= BoilerCall            << 4;
     record |= BoilerPump            << 5;   //AAAB BBCC CDDD 003F
     
-    if (count == 0) setStartTime(ClockNowNs());
+    if (count == 0) setStartTime(Ticks());
     
     FramWrite(iData + 8 * count, 8, &record);
     setCount(count + 1);
@@ -121,7 +121,7 @@
 
     strcpy(TftpServerName, serverName);
     struct tm tm;
-    ClockNsToTmUtc(startTime, &tm);
+    TicksToTmUtc(startTime, &tm);
     strftime(TftpFileName, DNS_MAX_LABEL_LENGTH+1, fileName, &tm);
 
     if (ValuesTrace)
@@ -136,7 +136,7 @@
 
 void ValuesMain()
 {
-    if (ClockTicked)
+    if (Ticked())
     {
         if (readInterval)   readElapsed++;
         else                readElapsed = 0;