Andrew Boyson / Mbed 2 deprecated heating

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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers hot-water.c Source File

hot-water.c

00001 #include <stdint.h>
00002 #include <string.h>
00003 #include <stdbool.h>
00004 #include <stdint.h>
00005 
00006 #include "ds18b20.h"
00007 #include "settings.h"
00008 
00009 static char* hotWaterRom;
00010 
00011 uint16_t HotWaterGetDS18B20Value(){ return DS18B20ValueFromRom(hotWaterRom); }
00012 
00013 static void setHotWaterRom(char* value) { memcpy(hotWaterRom,  value, 8); SetHotWaterRom(hotWaterRom); }
00014 
00015 int HotWaterInit()
00016 {
00017     hotWaterRom = DS18B20Roms + 8 * DS18B20RomCount;
00018     DS18B20RomSetters[DS18B20RomCount] = setHotWaterRom;
00019     DS18B20RomNames[DS18B20RomCount] = "HotWater";
00020     DS18B20RomCount++;
00021     
00022     GetHotWaterRom(hotWaterRom);
00023     
00024     return 0;
00025 }