TMP235 온도 측정 경로 정리
- mst? 온도 응답을 IMU register direct read로 대체 - go_temp/TMP235 legacy 경로 및 빌드 대상 제거 - info_temp 전역 정의를 IMU 모듈로 이동 - TMP235 드라이버는 deprecated reference로 표시
This commit is contained in:
@@ -14,15 +14,10 @@
|
||||
* - motion_data_once == true: one-shot read (after HW I2C init)
|
||||
* - motion_data_once == false: continuous read (when not waiting for BLE TX)
|
||||
* go_batt -> Battery voltage measurement (battery_level_meas)
|
||||
* go_temp -> Temperature measurement (tmp235_voltage_level_meas)
|
||||
* go_device_power_off -> Device power OFF (device_power_off)
|
||||
* go_sleep_mode_enter -> Enter sleep mode (sleep_mode_enter)
|
||||
* go_NVIC_SystemReset -> NVIC system reset
|
||||
*
|
||||
* [info4 mode measurement order]
|
||||
* IMU continuous read -> go_batt (battery) -> go_temp (temp) -> motion_data_once (IMU one-shot)
|
||||
* After temperature measurement, motion_data_once=true to return to IMU.
|
||||
*
|
||||
* [Timer settings]
|
||||
* - Normal mode: 10ms interval (MAIN_LOOP_INTERVAL)
|
||||
* - FEATURE_DETAIL_VALUE_FULL mode: 80ms interval (for detail printout)
|
||||
@@ -53,7 +48,6 @@
|
||||
#include "main.h"
|
||||
#include "app_raw_main.h"
|
||||
#include "main_timer.h"
|
||||
#include "tmp235_q1.h"
|
||||
//#include "fstorage.h"
|
||||
#include "power_control.h"
|
||||
#include "main.h" /* 2026-03-17: cmd_parse.h removed, use main.h */
|
||||
@@ -83,7 +77,6 @@ extern which_cmd_t cmd_type_t;
|
||||
/* Event flags (set by external modules, processed in main_loop) */
|
||||
/* ========================================================================== */
|
||||
bool go_batt= false; /* Battery measurement request flag */
|
||||
bool go_temp= false; /* Temperature measurement request flag */
|
||||
bool go_device_power_off = false; /* Device power OFF request flag */
|
||||
bool go_sleep_mode_enter = false; /* Sleep mode entry request flag */
|
||||
bool go_NVIC_SystemReset = false; /* System reset request flag */
|
||||
@@ -101,10 +94,9 @@ bool motion_data_once = false; /* IMU one-shot read mode (true: read on
|
||||
* [Processing priority] (checked in code order)
|
||||
* 1. IMU motion data (motion_raw_data_enabled)
|
||||
* 2. Battery measurement (go_batt)
|
||||
* 3. Temperature measurement (go_temp)
|
||||
* 4. Power OFF (go_device_power_off)
|
||||
* 5. Sleep mode (go_sleep_mode_enter)
|
||||
* 6. System reset (go_NVIC_SystemReset)
|
||||
* 3. Power OFF (go_device_power_off)
|
||||
* 4. Sleep mode (go_sleep_mode_enter)
|
||||
* 5. System reset (go_NVIC_SystemReset)
|
||||
*/
|
||||
void main_loop(void * p_context) /* For x ms */
|
||||
{
|
||||
@@ -192,33 +184,11 @@ void main_loop(void * p_context) /* For x ms */
|
||||
DBG_PRINTF("IMU BATT\r\n");
|
||||
main_timer_stop(); /* Stop timer */
|
||||
go_batt = false; /* Consume flag (one-shot) */
|
||||
// go_temp = true;
|
||||
battery_level_meas(); /* Measure battery voltage via SAADC */
|
||||
// nrf_delay_ms(20);
|
||||
// m48_adc_start_init();
|
||||
// main_timer_start();
|
||||
}
|
||||
|
||||
|
||||
/* ---- Temperature measurement ---- */
|
||||
/*
|
||||
* If go_temp is true, measure temperature via TMP235-Q1 sensor.
|
||||
* Called after battery measurement in info4 mode.
|
||||
* After completion, sets motion_data_once=true so the next IMU read
|
||||
* uses one-shot mode (with HW I2C re-init).
|
||||
*/
|
||||
if (go_temp == true)
|
||||
{
|
||||
DBG_PRINTF("IMU Temp\r\n");
|
||||
main_timer_stop(); /* Stop timer */
|
||||
// go_batt = false;
|
||||
go_temp = false; /* Consume flag (one-shot) */
|
||||
motion_data_once = true; /* Switch next IMU read to one-shot mode */
|
||||
tmp235_voltage_level_meas(); /* Measure TMP235-Q1 temperature sensor voltage */
|
||||
// motion_raw_data_enabled = true;
|
||||
// main_timer_start();
|
||||
|
||||
}
|
||||
|
||||
/* ---- System control event handling ---- */
|
||||
|
||||
@@ -285,4 +255,3 @@ void main_timer_init(void)
|
||||
{
|
||||
APP_ERROR_CHECK(app_timer_create(&m_main_loop_timer_id, APP_TIMER_MODE_SINGLE_SHOT, main_loop));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user