Skip to content

Commit

Permalink
Merge pull request #3169 from vrahane/vipul/fix_log_idx_after_reboot
Browse files Browse the repository at this point in the history
sys/log: Fix log index after reboot
  • Loading branch information
vrahane authored Mar 21, 2024
2 parents c9b0ded + 9b43b9f commit efa22cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sys/log/full/src/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,12 @@ log_register(const char *name, struct log *log, const struct log_handler *lh,
if (rc == 0) {
OS_ENTER_CRITICAL(sr);
#if MYNEWT_VAL(LOG_GLOBAL_IDX)
if (hdr.ue_index >= g_log_info.li_next_index) {
g_log_info.li_next_index = hdr.ue_index + 1;
if (hdr.ue_index > g_log_info.li_next_index) {
g_log_info.li_next_index = hdr.ue_index;
}
#else
if (hdr.ue_index >= log->l_idx) {
log->l_idx = hdr.ue_index + 1;
if (hdr.ue_index > log->l_idx) {
log->l_idx = hdr.ue_index;
}
#endif
OS_EXIT_CRITICAL(sr);
Expand Down

0 comments on commit efa22cb

Please sign in to comment.