Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: net 1-wire lpc1768 crypto clock web fram log
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 "fram.h" 00008 00009 static char* hotWaterRom; static int iHotWaterRom; 00010 00011 uint16_t HotWaterGetDS18B20Value(){ return DS18B20ValueFromRom(hotWaterRom); } 00012 00013 static void setHotWaterRom (char* value) { memcpy(hotWaterRom, value, 8); FramWrite(iHotWaterRom, 8, hotWaterRom ); } 00014 00015 int HotWaterInit() 00016 { 00017 hotWaterRom = DS18B20Roms + 8 * DS18B20RomCount; 00018 DS18B20RomSetters[DS18B20RomCount] = setHotWaterRom; 00019 DS18B20RomNames[DS18B20RomCount] = "HotWater"; 00020 DS18B20RomCount++; 00021 00022 int address; 00023 char def1; 00024 int32_t def4; 00025 address = FramLoad( 8, hotWaterRom, 0); if (address < 0) return -1; iHotWaterRom = address; 00026 return 0; 00027 }
Generated on Tue Jul 12 2022 18:50:15 by
