EZR
Dependencies: CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04
Fork of smartRamalKW by
alarm.h@13:eed9484a89bc, 2015-07-28 (annotated)
- Committer:
- tpadovani
- Date:
- Tue Jul 28 17:56:11 2015 +0000
- Revision:
- 13:eed9484a89bc
- Child:
- 19:1f623070b9dd
Implementa??o de alarmes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tpadovani | 13:eed9484a89bc | 1 | #ifndef ALARMS_H |
tpadovani | 13:eed9484a89bc | 2 | #define ALARMS_H |
tpadovani | 13:eed9484a89bc | 3 | |
tpadovani | 13:eed9484a89bc | 4 | #include "mbed.h" |
tpadovani | 13:eed9484a89bc | 5 | #include "queue.h" |
tpadovani | 13:eed9484a89bc | 6 | #include "appParameters.h" |
tpadovani | 13:eed9484a89bc | 7 | |
tpadovani | 13:eed9484a89bc | 8 | typedef struct{ |
tpadovani | 13:eed9484a89bc | 9 | unsigned int time; |
tpadovani | 13:eed9484a89bc | 10 | unsigned short int code; |
tpadovani | 13:eed9484a89bc | 11 | unsigned short int state; |
tpadovani | 13:eed9484a89bc | 12 | } AlarmEntry; |
tpadovani | 13:eed9484a89bc | 13 | |
tpadovani | 13:eed9484a89bc | 14 | class Alarm { |
tpadovani | 13:eed9484a89bc | 15 | |
tpadovani | 13:eed9484a89bc | 16 | PersistentCircularQueue alarmQueue; |
tpadovani | 13:eed9484a89bc | 17 | |
tpadovani | 13:eed9484a89bc | 18 | public: |
tpadovani | 13:eed9484a89bc | 19 | void loadQueue(int size, int sector); |
tpadovani | 13:eed9484a89bc | 20 | void writeAlarm(int code, bool state, bool previousState); |
tpadovani | 13:eed9484a89bc | 21 | char* getAllAlarms(); |
tpadovani | 13:eed9484a89bc | 22 | |
tpadovani | 13:eed9484a89bc | 23 | }; |
tpadovani | 13:eed9484a89bc | 24 | |
tpadovani | 13:eed9484a89bc | 25 | #endif |