diff options
author | Vipul Rahane <vipul@runtime.io> | 2016-05-13 16:06:19 -0700 |
---|---|---|
committer | Vipul Rahane <vipul@runtime.io> | 2016-06-09 12:31:59 -0700 |
commit | 75147b73cbd61654c8ed11844f24d5cdc7b936d6 (patch) | |
tree | fadde3825449a9d71acd9c41d3bb9f05e24cf8dd /sys/config | |
parent | 4300d57c8897a95fd9063fe878b0920d2193593d (diff) |
Initial changes for reboot log
- Adding reboot log using the existing mechanism
- Adding reboot_cnt as a config variable (Currently writable for
debugging purposes - would make it read only later)
Stored using fcb - future work would be to make this optional to be
stored using fcb or NFFS
- Adding reasons for reboot - HARD reboot and SOFT reboot. There is an
unknown reason as well if the chip decides to give us reasons for a
reboot
- Since a hard reboot is detected before the OS starts the timestamp for
it is going to be 0
- I can clean it up as required
Example of reboot log entries:
0 usecs, 2 > REBOOT: CRITICAL: rsn:HARD, cnt:13, img:255.255.65535.4294967295
12441000 usecs, 2 > REBOOT: CRITICAL: rsn:SOFT, cnt:14, img:255.255.65535.4294967295
Diffstat (limited to 'sys/config')
-rw-r--r-- | sys/config/src/config.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/config/src/config.c b/sys/config/src/config.c index bc6bf77a..c21cec74 100644 --- a/sys/config/src/config.c +++ b/sys/config/src/config.c @@ -28,17 +28,28 @@ struct conf_handler_head conf_handlers = SLIST_HEAD_INITIALIZER(&conf_handlers); +static uint8_t conf_cmd_inited; + int conf_init(void) { - int rc = 0; + int rc; + rc = 0; + if (conf_cmd_inited) { + goto done; + } #ifdef SHELL_PRESENT rc = conf_cli_register(); #endif #ifdef NEWTMGR_PRESENT rc = conf_nmgr_register(); #endif + if (!rc) { + conf_cmd_inited = 1; + } + +done: return rc; } |