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: nRF51822
Source/log.h@58:9b94a7caadba, 2020-12-18 (annotated)
- Committer:
- sgetz7908
- Date:
- Fri Dec 18 19:17:26 2020 +0000
- Revision:
- 58:9b94a7caadba
- Parent:
- 23:7ca590427f0e
In SHIP_MODE_CHECK_CAP debounce ambient detector and delay before going back to sleep.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sgetz7908 | 23:7ca590427f0e | 1 | |
sgetz7908 | 23:7ca590427f0e | 2 | #ifndef LOG_H |
sgetz7908 | 23:7ca590427f0e | 3 | #define LOG_H |
sgetz7908 | 23:7ca590427f0e | 4 | |
sgetz7908 | 23:7ca590427f0e | 5 | #include <stdint.h> |
sgetz7908 | 23:7ca590427f0e | 6 | |
sgetz7908 | 23:7ca590427f0e | 7 | typedef enum { |
sgetz7908 | 23:7ca590427f0e | 8 | EVENT_POWER = 0, // RTC reset |
sgetz7908 | 23:7ca590427f0e | 9 | EVENT_CAP_ON = 1, |
sgetz7908 | 23:7ca590427f0e | 10 | EVENT_TEST_PASS = 2, |
sgetz7908 | 23:7ca590427f0e | 11 | EVENT_TEST_FAIL = 3, |
sgetz7908 | 23:7ca590427f0e | 12 | EVENT_EOL = 4, |
sgetz7908 | 58:9b94a7caadba | 13 | EVENT_WAKE_FROM_SHIP = 5, |
sgetz7908 | 58:9b94a7caadba | 14 | SMWD=6, |
sgetz7908 | 58:9b94a7caadba | 15 | SMWL=7, |
sgetz7908 | 58:9b94a7caadba | 16 | SMCC=8, |
sgetz7908 | 58:9b94a7caadba | 17 | SMWCO=9, |
sgetz7908 | 58:9b94a7caadba | 18 | |
sgetz7908 | 23:7ca590427f0e | 19 | } event_t; |
sgetz7908 | 23:7ca590427f0e | 20 | |
sgetz7908 | 23:7ca590427f0e | 21 | |
sgetz7908 | 23:7ca590427f0e | 22 | struct log_struct { |
sgetz7908 | 23:7ca590427f0e | 23 | uint32_t time; /* 32 bit seconds count */ |
sgetz7908 | 23:7ca590427f0e | 24 | char code; |
sgetz7908 | 23:7ca590427f0e | 25 | char d0; |
sgetz7908 | 23:7ca590427f0e | 26 | char d1; |
sgetz7908 | 23:7ca590427f0e | 27 | char d2; |
sgetz7908 | 23:7ca590427f0e | 28 | }; |
sgetz7908 | 23:7ca590427f0e | 29 | |
sgetz7908 | 23:7ca590427f0e | 30 | void log_show(void); |
sgetz7908 | 23:7ca590427f0e | 31 | void log_add(event_t code, char d0, char d1, char d2); |
sgetz7908 | 23:7ca590427f0e | 32 | void log_erase(void); |
sgetz7908 | 23:7ca590427f0e | 33 | uint32_t log_code_count(event_t code); |
sgetz7908 | 23:7ca590427f0e | 34 | uint32_t log_get_num_records(void); |
sgetz7908 | 23:7ca590427f0e | 35 | void nv_clear(uint32_t addr); |
sgetz7908 | 23:7ca590427f0e | 36 | |
sgetz7908 | 23:7ca590427f0e | 37 | #endif // LOG_H |