Skip to content

Commit

Permalink
add functions to parse IMU data
Browse files Browse the repository at this point in the history
  • Loading branch information
corruptbear committed Jul 15, 2024
1 parent a12d640 commit a1e4a7e
Show file tree
Hide file tree
Showing 6 changed files with 1,114 additions and 5 deletions.
2 changes: 1 addition & 1 deletion software/firmware/src/peripherals/include/imu.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// For burst data transfer
#define BURST_READ_BASE_ADDR BNO055_GYRO_DATA_X_LSB_ADDR
#define BURST_READ_LEN 38
#define BURST_READ_LEN 40

#define GYRO_DATA_LEN 6
#define ACC_DATA_LEN 6
Expand Down
3 changes: 3 additions & 0 deletions software/firmware/src/tasks/app_task_ranging.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ static void imu_burst_data_handler(uint8_t *burst_data_buffer)
const bno055_data_type_t data_types[] = {STAT_DATA,LACC_DATA,GYRO_DATA};
uint8_t index = 0;
uint8_t len = 0;
print("got imu data!\n");

#ifndef _TEST_NO_STORAGE
for (uint8_t i = 0; i < sizeof(data_types)/sizeof(data_types[0]); i+=1)
Expand Down Expand Up @@ -330,6 +331,7 @@ void app_allow_downloads(bool allow)
// Enable data downloading from ranging mode
if (allow)
{
print("allowing downloads...\n");
// Disable writing to storage
storage_disable(true);
storage_enter_maintenance_mode();
Expand Down Expand Up @@ -385,6 +387,7 @@ void AppTaskRanging(void *uid)
//imu_register_motion_change_callback(motion_change_handler);
imu_register_data_ready_callback(imu_burst_data_handler);
imu_set_power_mode(POWER_MODE_NORMAL);
//imu_set_power_mode(POWER_MODE_LOWPOWER);
imu_set_fusion_mode(OPERATION_MODE_NDOF);
#endif

Expand Down
2 changes: 1 addition & 1 deletion software/firmware/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ full_segger: $(CONFIG) $(CONFIG)/main.o $(CONFIG)/SEGGER_RTT.o $(CONFIG)/$$(TARG

full_exp: TARGET = TestFullExp
full_exp: SRC += main.c SEGGER_RTT.c
full_exp: CFLAGS += -D__USE_FREERTOS__ -D__USE_SEGGER__ -DNONBLOCKING=1 -D_TEST_IMU_DATA -D_REMOTE_MODE_SWITCH_ENABLED -D_TEST_NO_EXP_DETAILS -D_USE_DEFAULT_EXP_DETAILS
full_exp: CFLAGS += -D__USE_FREERTOS__ -D__USE_SEGGER__ -DNONBLOCKING=1 -D_TEST_IMU_DATA -D_REMOTE_MODE_SWITCH_ENABLED -D_TEST_NO_EXP_DETAILS -D_USE_DEFAULT_EXP_DETAILS -D_LIVE_IMU_DATA
full_exp: $(CONFIG) $(CONFIG)/main.o $(CONFIG)/SEGGER_RTT.o $(CONFIG)/$$(TARGET).bin program

imu: TARGET = TestIMU
Expand Down
Loading

0 comments on commit a1e4a7e

Please sign in to comment.