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: CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04
Fork of smartRamalKW by
alarm.cpp
00001 #include "alarm.h" 00002 00003 void Alarm::loadQueue(int size, int sector){ 00004 alarmQueue.init(size, sector); 00005 alarmQueue.dropQueue(); 00006 DEBUG(printf("[Alarm] Alarm queue loaded (Max %d records)\r\n", size)); 00007 } 00008 00009 void Alarm::writeAlarm(int code, bool state, bool previousState){ 00010 if(state == previousState){ 00011 return; 00012 } 00013 AlarmEntry entry; 00014 entry.time = time(NULL); 00015 entry.code = code; 00016 entry.state = state ? 1 : 0; 00017 00018 alarmQueue.add((char*)&entry); 00019 DEBUG(printf("[Alarm] New record stored: Time=%d, Code=%d, State=%d\r\n", entry.time, entry.code, entry.state)); 00020 setAlarmState(code, state); 00021 } 00022 00023 char* Alarm::getAllAlarms(){ 00024 return alarmQueue.getAll(); 00025 }
Generated on Thu Jul 14 2022 00:24:57 by
1.7.2
