Skip to content

Commit

Permalink
Revert page index changes (wrong calculation)
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Dec 21, 2023
1 parent 650c4ed commit 0848242
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions software/firmware/src/peripherals/src/storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,15 +462,15 @@ void storage_init(void)
uint16_t len = *(uint16_t*)(transfer_buffer+2);
if (len < MEMORY_NUM_DATA_BYTES_PER_PAGE)
{
current_page += i;
current_page = (current_page - MEMORY_PAGES_PER_BLOCK) + i;
cache_index = len;
memcpy(cache, transfer_buffer + 4, len);
break;
}
}
else
{
current_page += i;
current_page = (current_page - MEMORY_PAGES_PER_BLOCK) + i;
break;
}
}
Expand Down
1 change: 1 addition & 0 deletions software/firmware/src/tasks/app_task_maintenance.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ static void handle_notification(app_notification_t notification)
static void battery_event_handler(battery_event_t battery_event)
{
// Notify the app of a change in the plugged-in status of the device
print("INFO: Battery event occurred: %d\n", (uint32_t)battery_event);
if ((battery_event == BATTERY_PLUGGED) || (battery_event == BATTERY_UNPLUGGED))
{
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
Expand Down
1 change: 1 addition & 0 deletions software/firmware/src/tasks/app_task_ranging.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ static void battery_event_handler(battery_event_t battery_event)
{
// Store the battery event to non-volatile memory and notify the app
storage_write_charging_event(battery_event);
print("INFO: Battery event occurred: %d\n", (uint32_t)battery_event);
if ((battery_event == BATTERY_PLUGGED) || (battery_event == BATTERY_UNPLUGGED))
app_notify(APP_NOTIFY_BATTERY_EVENT, true);
}
Expand Down

0 comments on commit 0848242

Please sign in to comment.