protegemed, aquisição via A/D simples utilizando interrupção do timer
Dependencies: EthernetInterface NTPClient mbed-rtos mbed
Fork of ptgm_semDMA by
Headers/PmedLog.h@0:fac116e94d44, 2016-01-05 (annotated)
- Committer:
- rebonatto
- Date:
- Tue Jan 05 11:47:35 2016 +0000
- Revision:
- 0:fac116e94d44
Vers?o est?vel sem DMA e FFT. 128 amostras.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rebonatto | 0:fac116e94d44 | 1 | /* |
rebonatto | 0:fac116e94d44 | 2 | * Settings.h |
rebonatto | 0:fac116e94d44 | 3 | * |
rebonatto | 0:fac116e94d44 | 4 | * Created on: 19/jan/2015 |
rebonatto | 0:fac116e94d44 | 5 | * Author: Marcos A. Lucas |
rebonatto | 0:fac116e94d44 | 6 | */ |
rebonatto | 0:fac116e94d44 | 7 | |
rebonatto | 0:fac116e94d44 | 8 | #ifndef PMEDLOG_H |
rebonatto | 0:fac116e94d44 | 9 | #define PMEDLOG_H |
rebonatto | 0:fac116e94d44 | 10 | |
rebonatto | 0:fac116e94d44 | 11 | #include "mbed.h" |
rebonatto | 0:fac116e94d44 | 12 | #include "Settings.h" |
rebonatto | 0:fac116e94d44 | 13 | |
rebonatto | 0:fac116e94d44 | 14 | #define LOGFILE "/local/pmedlog.txt" |
rebonatto | 0:fac116e94d44 | 15 | |
rebonatto | 0:fac116e94d44 | 16 | |
rebonatto | 0:fac116e94d44 | 17 | //define as constant some log entries |
rebonatto | 0:fac116e94d44 | 18 | static const char *PMEDLOG_INITIALIZING = " Initializing Protegemed ... "; |
rebonatto | 0:fac116e94d44 | 19 | static const char *PMEDLOG_INITIALIZINGWDT = " Initializing Protegemed by WhatchDog Timer... "; |
rebonatto | 0:fac116e94d44 | 20 | static const char *PMEDLOG_STARTED = " Started Protegemed ! "; |
rebonatto | 0:fac116e94d44 | 21 | static const char *PMEDLOG_WRONGCODE = " Oops... wrong code, a reset may be expected "; |
rebonatto | 0:fac116e94d44 | 22 | static const char *PMEDLOG_RESET = " No reason given "; |
rebonatto | 0:fac116e94d44 | 23 | static const char *PMEDLOG_DEFAULTS = " Loaded defaults in Settings ! "; |
rebonatto | 0:fac116e94d44 | 24 | |
rebonatto | 0:fac116e94d44 | 25 | static const char *PMEDLOG_RESETTELNET = " by telnet reset "; |
rebonatto | 0:fac116e94d44 | 26 | static const char *PMEDLOG_UPDATETELNET = " by telnet update "; |
rebonatto | 0:fac116e94d44 | 27 | |
rebonatto | 0:fac116e94d44 | 28 | static const char *PMEDLOG_HTTP_CONNECT = "On HTTP_POST - Connect"; |
rebonatto | 0:fac116e94d44 | 29 | static const char *PMEDLOG_HTTP_SEND = "On HTTP_POST - Send"; |
rebonatto | 0:fac116e94d44 | 30 | |
rebonatto | 0:fac116e94d44 | 31 | class PmedLog |
rebonatto | 0:fac116e94d44 | 32 | { |
rebonatto | 0:fac116e94d44 | 33 | |
rebonatto | 0:fac116e94d44 | 34 | protected: |
rebonatto | 0:fac116e94d44 | 35 | |
rebonatto | 0:fac116e94d44 | 36 | static int m_entry; |
rebonatto | 0:fac116e94d44 | 37 | static time_t m_lastMark; |
rebonatto | 0:fac116e94d44 | 38 | |
rebonatto | 0:fac116e94d44 | 39 | public: |
rebonatto | 0:fac116e94d44 | 40 | |
rebonatto | 0:fac116e94d44 | 41 | PmedLog(); |
rebonatto | 0:fac116e94d44 | 42 | |
rebonatto | 0:fac116e94d44 | 43 | // Control the marks behavior in log file |
rebonatto | 0:fac116e94d44 | 44 | static bool get_LogMarks() { return Settings::get_LogMarks(); } |
rebonatto | 0:fac116e94d44 | 45 | static void set_LogMarks(bool value) { Settings::set_LogMarks(value); } |
rebonatto | 0:fac116e94d44 | 46 | static int get_LogMarksInterval() { return Settings::get_LogMarksInterval(); } |
rebonatto | 0:fac116e94d44 | 47 | static void set_LogMarksInterval(int value) { Settings::set_LogMarksInterval(value); } |
rebonatto | 0:fac116e94d44 | 48 | |
rebonatto | 0:fac116e94d44 | 49 | static void WriteEntry(const char *value); |
rebonatto | 0:fac116e94d44 | 50 | static void Mark(); |
rebonatto | 0:fac116e94d44 | 51 | |
rebonatto | 0:fac116e94d44 | 52 | }; |
rebonatto | 0:fac116e94d44 | 53 | |
rebonatto | 0:fac116e94d44 | 54 | #endif //#ifndef PMEDLOGS_H |
rebonatto | 0:fac116e94d44 | 55 |