Skip to content

Commit

Permalink
Print out IMU events from app_task_ranging
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Jul 18, 2024
1 parent 322f1d9 commit 1f1d7b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion software/firmware/src/tasks/app_task_ranging.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,15 @@ static void handle_notification(app_notification_t notification)
if (motion_changed)
{
motion_changed = false;
storage_write_motion_status(imu_read_in_motion());
const bool in_motion = imu_read_in_motion();
storage_write_motion_status(in_motion);
print("INFO: Motion change detected: %s\n", in_motion ? "MOVING" : "STATIONARY");
}
if (imu_data_ready)
{
// Write IMU data over the BLE characteristic
imu_data_ready = false;
print("INFO: IMU data received\n");
#ifdef _TEST_IMU_DATA
bluetooth_write_imu_data(imu_raw_data, imu_raw_data_length);
#endif
Expand Down Expand Up @@ -408,6 +411,9 @@ void AppTaskRanging(void *uid)
#else
imu_set_fusion_mode(OPERATION_MODE_ACCONLY);
#endif
#ifndef _TEST_NO_STORAGE
storage_write_motion_status(imu_read_in_motion());
#endif

// Retrieve current experiment details from non-volatile storage
static experiment_details_t current_experiment;
Expand Down

0 comments on commit 1f1d7b7

Please sign in to comment.