주석 및 로그 정리
This commit is contained in:
+10
-15
@@ -396,13 +396,11 @@ int imu_init(void)
|
||||
}
|
||||
|
||||
if (who_am_i != ICM_WHOAMI) {
|
||||
DBG_PRINTF("[IMU] FAIL — WHOAMI mismatch (got=0x%02X, expected=0x%02X)\r\n",
|
||||
who_am_i, ICM_WHOAMI);
|
||||
DBG_PRINTF("[IMU] FAIL — WHOAMI mismatch (got=0x%02X, expected=0x%02X)\r\n", who_am_i, ICM_WHOAMI);
|
||||
return -3;
|
||||
}
|
||||
|
||||
DBG_PRINTF("[IMU] OK — ICM42670P detected (WHOAMI=0x%02X, addr=0x%02X)\r\n",
|
||||
who_am_i, IMU_I2C_ADDR);
|
||||
//DBG_PRINTF("[IMU] OK — ICM42670P detected (WHOAMI=0x%02X, addr=0x%02X)\r\n", who_am_i, IMU_I2C_ADDR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -443,9 +441,7 @@ int imu_read(int16_t accel[3], int16_t gyro[3])
|
||||
gyro[1] = (int16_t)((raw[8] << 8) | raw[9]);
|
||||
gyro[2] = (int16_t)((raw[10] << 8) | raw[11]);
|
||||
|
||||
DBG_PRINTF("[IMU] msp: A=(%6d,%6d,%6d) G=(%6d,%6d,%6d)\r\n",
|
||||
accel[0], accel[1], accel[2],
|
||||
gyro[0], gyro[1], gyro[2]);
|
||||
//DBG_PRINTF("[IMU] msp: A=(%6d,%6d,%6d) G=(%6d,%6d,%6d)\r\n", accel[0], accel[1], accel[2], gyro[0], gyro[1], gyro[2]);
|
||||
|
||||
/* 슬립 모드: 전력 절감 */
|
||||
imu_write_reg(REG_PWR_MGMT0, 0x00);
|
||||
@@ -509,6 +505,7 @@ int imu_read_with_temperature(int16_t accel[3], int16_t gyro[3], int16_t *temp_c
|
||||
gyro[1] = (int16_t)((raw[10] << 8) | raw[11]);
|
||||
gyro[2] = (int16_t)((raw[12] << 8) | raw[13]);
|
||||
|
||||
/*
|
||||
DBG_PRINTF("[IMU] mbb: A=(%6d,%6d,%6d) G=(%6d,%6d,%6d) T=%d.%02d C temp_raw=%d/%d/%d/%d avg=%d first=0x%02X%02X\r\n",
|
||||
accel[0], accel[1], accel[2],
|
||||
gyro[0], gyro[1], gyro[2],
|
||||
@@ -520,7 +517,7 @@ int imu_read_with_temperature(int16_t accel[3], int16_t gyro[3], int16_t *temp_c
|
||||
temp_samples[3],
|
||||
temp_raw,
|
||||
raw[0], raw[1]);
|
||||
|
||||
*/
|
||||
imu_write_reg(REG_PWR_MGMT0, 0x00);
|
||||
return 0;
|
||||
}
|
||||
@@ -574,11 +571,12 @@ int imu_read_temperature_cdeg(int16_t *temp_cdeg)
|
||||
temp_raw = (int16_t)(temp_sum / (int32_t)IMU_TEMP_AVG_SAMPLES);
|
||||
cdeg = imu_temp_raw_to_cdeg(temp_raw);
|
||||
*temp_cdeg = (int16_t)cdeg;
|
||||
/*
|
||||
DBG_PRINTF("[IMU] temp=%d.%02d C raw=%d\r\n",
|
||||
*temp_cdeg / 100,
|
||||
(*temp_cdeg < 0 ? -*temp_cdeg : *temp_cdeg) % 100,
|
||||
temp_raw);
|
||||
|
||||
*/
|
||||
if (!was_fifo_active)
|
||||
{
|
||||
(void)imu_write_reg(REG_PWR_MGMT0, 0x00);
|
||||
@@ -653,14 +651,11 @@ int imu_fifo_read_latest(uint8_t *sample_bytes,
|
||||
}
|
||||
|
||||
ret = imu_fifo_read_count(&record_count);
|
||||
DBG_PRINTF("[IMU FIFO] raw count=%u ret=%d target=%u\r\n",
|
||||
record_count,
|
||||
ret,
|
||||
max_samples);
|
||||
//DBG_PRINTF("[IMU FIFO] raw count=%u ret=%d target=%u\r\n", record_count, ret, max_samples);
|
||||
if ((ret == 0) && (record_count > 0U))
|
||||
{
|
||||
ret = imu_fifo_read_records(record_count);
|
||||
DBG_PRINTF("[IMU FIFO] read records ret=%d\r\n", ret);
|
||||
//DBG_PRINTF("[IMU FIFO] read records ret=%d\r\n", ret);
|
||||
}
|
||||
|
||||
if (ret)
|
||||
@@ -690,7 +685,7 @@ int imu_fifo_read_latest(uint8_t *sample_bytes,
|
||||
}
|
||||
|
||||
*out_count = record_count;
|
||||
DBG_PRINTF("[IMU FIFO] drained samples=%u\r\n", record_count);
|
||||
//DBG_PRINTF("[IMU FIFO] drained samples=%u\r\n", record_count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user