diff --git a/project/ble_peripheral/ble_app_bladder_patch/command/cmd_common.h b/project/ble_peripheral/ble_app_bladder_patch/command/cmd_common.h
index 912bab7..85cc211 100644
--- a/project/ble_peripheral/ble_app_bladder_patch/command/cmd_common.h
+++ b/project/ble_peripheral/ble_app_bladder_patch/command/cmd_common.h
@@ -46,7 +46,6 @@ extern uint8_t resetCount;
*----------------------------------------------------------------------------*/
extern void battery_level_meas(void);
extern void pressure_all_level_meas(void);
-extern void tmp235_voltage_level_meas(void);
extern int imu_read_direct(void);
extern int imu_read_temperature_x100(uint16_t *temp_x100, float *temp_c);
extern int imu_fifo_capture_start(void);
@@ -66,7 +65,6 @@ extern bool motion_raw_data_enabled;
extern volatile uint16_t info_batt;
extern volatile uint16_t info_temp;
extern volatile uint16_t info_imu[6];
-extern volatile bool tmp235_saadc_done;
extern volatile bool battery_saadc_done;
/*------------------------------------------------------------------------------
diff --git a/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_sensor.h b/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_sensor.h
index dc5be89..0118eee 100644
--- a/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_sensor.h
+++ b/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_sensor.h
@@ -7,7 +7,7 @@
#include "parser.h"
int Cmd_msn(const ParsedCmd *cmd); /* msn? -> rsn: battery ADC measurement */
-int Cmd_mst(const ParsedCmd *cmd); /* mst? -> rso: TMP235 with piezo power cycle */
+int Cmd_mst(const ParsedCmd *cmd); /* mst? -> rso: IMU die temperature */
int Cmd_msp(const ParsedCmd *cmd); /* msp? -> rsp: IMU 6-axis single read */
/* Helper for the mbb? handler: sequentially measures battery / IMU / temperature, then emits a single rbb: response.
* Called from Cmd_mbb() in cmd_piezo.c. */
diff --git a/project/ble_peripheral/ble_app_bladder_patch/main.c b/project/ble_peripheral/ble_app_bladder_patch/main.c
index c372a53..eedac3d 100644
--- a/project/ble_peripheral/ble_app_bladder_patch/main.c
+++ b/project/ble_peripheral/ble_app_bladder_patch/main.c
@@ -12,7 +12,7 @@
* [Hardware Configuration]
* - MCU: nRF52840 (SoftDevice S140 v7.x)
* - IMU: ICM42670P 6-axis accel/gyro (I2C, 0x68)
- * - Temperature: TMP235-Q1 analog sensor (SAADC AIN3)
+ * - Temperature: IMU register direct read
* - Battery: voltage divider (SAADC AIN2, 1/3 prescale)
* - Power: POWER_HOLD(P0.8) self-latch circuit, POWER_BUTTON(P1.8) input
*
@@ -94,7 +94,6 @@
#include "app_raw_main.h" /* Sensor raw data processing module */
#include "main_timer.h" /* Main event loop timer (10ms period) */
#include "power_control.h" /* Power sequence control (ON/OFF/sleep) */
-#include "tmp235_q1.h" /* TMP235-Q1 temperature sensor driver */
#include "fds.h" /* Flash Data Storage (non-volatile config) */
#include "battery_saadc.h" /* Battery voltage measurement (SAADC) */
diff --git a/project/ble_peripheral/ble_app_bladder_patch/measurement/battery/battery_saadc.c b/project/ble_peripheral/ble_app_bladder_patch/measurement/battery/battery_saadc.c
index 0672efb..3ee2e73 100644
--- a/project/ble_peripheral/ble_app_bladder_patch/measurement/battery/battery_saadc.c
+++ b/project/ble_peripheral/ble_app_bladder_patch/measurement/battery/battery_saadc.c
@@ -27,7 +27,6 @@
#include "app_timer.h"
#include "battery_saadc.h"
#include "main_timer.h"
-#include "tmp235_q1.h"
#include "app_raw.h"
#include "dr_piezo.h"
#include "debug_print.h"
@@ -60,9 +59,6 @@ APP_TIMER_DEF(m_battery_loop_timer_id);
/* Low-battery check flag — set by battery_loop, consumed by handler */
bool low_battery_check = false;
-/* Safety check mode flag — legacy TMP235 path */
-bool safety_check_mode = false;
-
/* SAADC callback completion flag — used by all_sensors() to wait */
volatile bool battery_saadc_done = false;
@@ -85,7 +81,6 @@ extern uint8_t ble_bin_buffer[BLE_NUS_MAX_DATA_LEN];
volatile uint16_t info_batt;
/* info4 sequential measurement control flags */
-extern bool go_temp;
extern bool go_batt;
extern bool motion_raw_data_enabled;
@@ -94,7 +89,7 @@ extern bool motion_data_once;
extern bool maa_async_is_busy(void);
/*==============================================================================
- * safety_check_complete - Called by tmp235 handler after temperature measurement
+ * safety_check_complete - Called after IMU die temperature measurement
*
* Checks both battery voltage and temperature against thresholds.
* 5 consecutive readings exceeding either threshold triggers power OFF.
@@ -168,7 +163,7 @@ void battery_event_handler(nrf_drv_saadc_evt_t const * p_event)
register_val = p_event->data.done.p_buffer[0];
- /* Release SAADC — shared with temperature / pressure ADC */
+ /* Release SAADC — shared with pressure ADC */
nrf_drv_saadc_channel_uninit(0);
nrf_drv_saadc_uninit();
diff --git a/project/ble_peripheral/ble_app_bladder_patch/measurement/battery/battery_saadc.h b/project/ble_peripheral/ble_app_bladder_patch/measurement/battery/battery_saadc.h
index c8357cb..97d468e 100644
--- a/project/ble_peripheral/ble_app_bladder_patch/measurement/battery/battery_saadc.h
+++ b/project/ble_peripheral/ble_app_bladder_patch/measurement/battery/battery_saadc.h
@@ -25,9 +25,6 @@
/* SAADC callback completion flag (used by all_sensors() to wait) */
extern volatile bool battery_saadc_done;
-/* Safety check mode flag — legacy TMP235 path */
-extern bool safety_check_mode;
-
/* Called when safety check temperature measurement completes */
void safety_check_complete(float temp_c);
diff --git a/project/ble_peripheral/ble_app_bladder_patch/measurement/imu/app_raw/app_raw.c b/project/ble_peripheral/ble_app_bladder_patch/measurement/imu/app_raw/app_raw.c
index 359ae5d..c159036 100644
--- a/project/ble_peripheral/ble_app_bladder_patch/measurement/imu/app_raw/app_raw.c
+++ b/project/ble_peripheral/ble_app_bladder_patch/measurement/imu/app_raw/app_raw.c
@@ -93,7 +93,7 @@ extern which_cmd_t cmd_type_t; /* Current command source (
uint16_t ssp_data[6]={0,}; /* 6-axis data array for BLE (accel XYZ + gyro XYZ) */
extern bool info4; /* info4 mode flag (set by cmd_parse) */
volatile uint16_t info_imu[6]; /* Global array storing IMU data in info4 mode */
-extern volatile uint16_t info_temp; /* Global temperature cache (deg C x 100) */
+volatile uint16_t info_temp; /* Global temperature cache (deg C x 100) */
/* --------------------------------------------------------------------------------------
* static function declaration
diff --git a/project/ble_peripheral/ble_app_bladder_patch/measurement/temperature/tmp235_q1.c b/project/ble_peripheral/ble_app_bladder_patch/measurement/temperature/tmp235_q1.c
index 6dd5002..f85beb8 100644
--- a/project/ble_peripheral/ble_app_bladder_patch/measurement/temperature/tmp235_q1.c
+++ b/project/ble_peripheral/ble_app_bladder_patch/measurement/temperature/tmp235_q1.c
@@ -1,6 +1,9 @@
/*==============================================================================
* tmp235_q1.c - TMP235-Q1 analogue temperature sensor driver
*
+ * Deprecated: temperature measurement has been replaced by IMU register direct read paths.
+ * This file is kept only as a legacy reference and is not built.
+ *
* Reads the TMP235-Q1 analogue output via SAADC AIN3 and converts to deg C.
*
* Temperature conversion (piecewise linear, per datasheet):
diff --git a/project/ble_peripheral/ble_app_bladder_patch/pca10056/s140/arm5_no_packs/ble_app_bladder_patch_s140.uvoptx b/project/ble_peripheral/ble_app_bladder_patch/pca10056/s140/arm5_no_packs/ble_app_bladder_patch_s140.uvoptx
index 749690e..039cbd9 100644
--- a/project/ble_peripheral/ble_app_bladder_patch/pca10056/s140/arm5_no_packs/ble_app_bladder_patch_s140.uvoptx
+++ b/project/ble_peripheral/ble_app_bladder_patch/pca10056/s140/arm5_no_packs/ble_app_bladder_patch_s140.uvoptx
@@ -1219,18 +1219,6 @@
0
0
0
- ..\..\..\measurement\temperature\tmp235_q1.c
- tmp235_q1.c
- 0
- 0
-
-
- 1
- 7
- 1
- 0
- 0
- 0
..\..\..\hal\fds\fstorage.c
fstorage.c
0
@@ -1238,7 +1226,7 @@
1
- 8
+ 7
5
0
0
@@ -1250,7 +1238,7 @@
1
- 9
+ 8
1
0
0
@@ -1262,7 +1250,7 @@
1
- 10
+ 9
5
0
0
@@ -1274,7 +1262,7 @@
1
- 11
+ 10
1
0
0
@@ -1286,7 +1274,7 @@
1
- 12
+ 11
1
0
0
@@ -1298,7 +1286,7 @@
1
- 13
+ 12
5
0
0
@@ -1310,7 +1298,7 @@
1
- 14
+ 13
1
0
0
@@ -1322,7 +1310,7 @@
1
- 15
+ 14
5
0
0
@@ -1334,7 +1322,7 @@
1
- 16
+ 15
1
0
0
@@ -1346,7 +1334,7 @@
1
- 17
+ 16
1
0
0
@@ -1358,7 +1346,7 @@
1
- 18
+ 17
1
0
0
@@ -1370,7 +1358,7 @@
1
- 19
+ 18
1
0
0
@@ -1382,7 +1370,7 @@
1
- 20
+ 19
1
0
0
@@ -1394,7 +1382,7 @@
1
- 21
+ 20
1
0
0
@@ -1406,7 +1394,7 @@
1
- 22
+ 21
1
0
0
@@ -1418,7 +1406,7 @@
1
- 23
+ 22
1
0
0
@@ -1438,7 +1426,7 @@
0
2
- 24
+ 23
1
0
0
@@ -1458,7 +1446,7 @@
0
3
- 25
+ 24
1
0
0
@@ -1470,7 +1458,7 @@
3
- 26
+ 25
1
0
0
@@ -1490,7 +1478,7 @@
0
4
- 27
+ 26
1
0
0
@@ -1510,7 +1498,7 @@
0
5
- 28
+ 27
1
0
0
@@ -1522,7 +1510,7 @@
5
- 29
+ 28
1
0
0
@@ -1534,7 +1522,7 @@
5
- 30
+ 29
1
0
0
@@ -1546,7 +1534,7 @@
5
- 31
+ 30
1
0
0
@@ -1558,7 +1546,7 @@
5
- 32
+ 31
1
0
0
@@ -1570,7 +1558,7 @@
5
- 33
+ 32
1
0
0
@@ -1582,7 +1570,7 @@
5
- 34
+ 33
1
0
0
@@ -1594,7 +1582,7 @@
5
- 35
+ 34
1
0
0
@@ -1606,7 +1594,7 @@
5
- 36
+ 35
1
0
0
@@ -1618,7 +1606,7 @@
5
- 37
+ 36
1
0
0
@@ -1630,7 +1618,7 @@
5
- 38
+ 37
1
0
0
@@ -1642,7 +1630,7 @@
5
- 39
+ 38
1
0
0
@@ -1654,7 +1642,7 @@
5
- 40
+ 39
1
0
0
@@ -1666,7 +1654,7 @@
5
- 41
+ 40
1
0
0
@@ -1678,7 +1666,7 @@
5
- 42
+ 41
1
0
0
@@ -1690,7 +1678,7 @@
5
- 43
+ 42
1
0
0
@@ -1702,7 +1690,7 @@
5
- 44
+ 43
1
0
0
@@ -1714,7 +1702,7 @@
5
- 45
+ 44
1
0
0
@@ -1726,7 +1714,7 @@
5
- 46
+ 45
1
0
0
@@ -1738,7 +1726,7 @@
5
- 47
+ 46
1
0
0
@@ -1758,7 +1746,7 @@
0
6
- 48
+ 47
1
0
0
@@ -1778,7 +1766,7 @@
0
7
- 49
+ 48
1
0
0
@@ -1790,7 +1778,7 @@
7
- 50
+ 49
1
0
0
@@ -1802,7 +1790,7 @@
7
- 51
+ 50
1
0
0
@@ -1814,7 +1802,7 @@
7
- 52
+ 51
1
0
0
@@ -1826,7 +1814,7 @@
7
- 53
+ 52
1
0
0
@@ -1838,7 +1826,7 @@
7
- 54
+ 53
1
0
0
@@ -1850,7 +1838,7 @@
7
- 55
+ 54
1
0
0
@@ -1862,7 +1850,7 @@
7
- 56
+ 55
1
0
0
@@ -1874,7 +1862,7 @@
7
- 57
+ 56
1
0
0
@@ -1886,7 +1874,7 @@
7
- 58
+ 57
1
0
0
@@ -1898,7 +1886,7 @@
7
- 59
+ 58
1
0
0
@@ -1910,7 +1898,7 @@
7
- 60
+ 59
1
0
0
@@ -1922,7 +1910,7 @@
7
- 61
+ 60
1
0
0
@@ -1934,7 +1922,7 @@
7
- 62
+ 61
1
0
0
@@ -1946,7 +1934,7 @@
7
- 63
+ 62
1
0
0
@@ -1958,7 +1946,7 @@
7
- 64
+ 63
1
0
0
@@ -1970,7 +1958,7 @@
7
- 65
+ 64
1
0
0
@@ -1982,7 +1970,7 @@
7
- 66
+ 65
1
0
0
@@ -1994,7 +1982,7 @@
7
- 67
+ 66
1
0
0
@@ -2006,7 +1994,7 @@
7
- 68
+ 67
5
0
0
@@ -2026,7 +2014,7 @@
0
8
- 69
+ 68
1
0
0
@@ -2038,7 +2026,7 @@
8
- 70
+ 69
1
0
0
@@ -2050,7 +2038,7 @@
8
- 71
+ 70
1
0
0
@@ -2062,7 +2050,7 @@
8
- 72
+ 71
1
0
0
@@ -2074,7 +2062,7 @@
8
- 73
+ 72
1
0
0
@@ -2086,7 +2074,7 @@
8
- 74
+ 73
1
0
0
@@ -2098,7 +2086,7 @@
8
- 75
+ 74
1
0
0
@@ -2110,7 +2098,7 @@
8
- 76
+ 75
1
0
0
@@ -2122,7 +2110,7 @@
8
- 77
+ 76
1
0
0
@@ -2134,7 +2122,7 @@
8
- 78
+ 77
1
0
0
@@ -2146,7 +2134,7 @@
8
- 79
+ 78
1
0
0
@@ -2158,7 +2146,7 @@
8
- 80
+ 79
1
0
0
@@ -2170,7 +2158,7 @@
8
- 81
+ 80
1
0
0
@@ -2182,7 +2170,7 @@
8
- 82
+ 81
1
0
0
@@ -2194,7 +2182,7 @@
8
- 83
+ 82
1
0
0
@@ -2206,7 +2194,7 @@
8
- 84
+ 83
1
0
0
@@ -2218,7 +2206,7 @@
8
- 85
+ 84
1
0
0
@@ -2230,7 +2218,7 @@
8
- 86
+ 85
1
0
0
@@ -2242,7 +2230,7 @@
8
- 87
+ 86
1
0
0
@@ -2254,7 +2242,7 @@
8
- 88
+ 87
1
0
0
@@ -2266,7 +2254,7 @@
8
- 89
+ 88
1
0
0
@@ -2278,7 +2266,7 @@
8
- 90
+ 89
1
0
0
@@ -2290,7 +2278,7 @@
8
- 91
+ 90
1
0
0
@@ -2302,7 +2290,7 @@
8
- 92
+ 91
1
0
0
@@ -2314,7 +2302,7 @@
8
- 93
+ 92
1
0
0
@@ -2326,7 +2314,7 @@
8
- 94
+ 93
1
0
0
@@ -2338,7 +2326,7 @@
8
- 95
+ 94
1
0
0
@@ -2350,7 +2338,7 @@
8
- 96
+ 95
1
0
0
@@ -2362,7 +2350,7 @@
8
- 97
+ 96
1
0
0
@@ -2382,7 +2370,7 @@
0
9
- 98
+ 97
1
0
0
@@ -2394,7 +2382,7 @@
9
- 99
+ 98
1
0
0
@@ -2406,7 +2394,7 @@
9
- 100
+ 99
1
0
0
@@ -2418,7 +2406,7 @@
9
- 101
+ 100
1
0
0
@@ -2430,7 +2418,7 @@
9
- 102
+ 101
1
0
0
@@ -2450,7 +2438,7 @@
0
10
- 103
+ 102
1
0
0
@@ -2462,7 +2450,7 @@
10
- 104
+ 103
1
0
0
@@ -2474,7 +2462,7 @@
10
- 105
+ 104
1
0
0
@@ -2494,7 +2482,7 @@
0
11
- 106
+ 105
1
0
0
@@ -2506,7 +2494,7 @@
11
- 107
+ 106
1
0
0
@@ -2518,7 +2506,7 @@
11
- 108
+ 107
1
0
0
@@ -2538,7 +2526,7 @@
0
12
- 109
+ 108
1
0
0
@@ -2550,7 +2538,7 @@
12
- 110
+ 109
1
0
0
@@ -2562,7 +2550,7 @@
12
- 111
+ 110
1
0
0
@@ -2574,7 +2562,7 @@
12
- 112
+ 111
1
0
0
@@ -2594,7 +2582,7 @@
0
13
- 113
+ 112
1
0
0
@@ -2606,7 +2594,7 @@
13
- 114
+ 113
1
0
0
@@ -2618,7 +2606,7 @@
13
- 115
+ 114
1
0
0
@@ -2630,7 +2618,7 @@
13
- 116
+ 115
1
0
0
@@ -2642,7 +2630,7 @@
13
- 117
+ 116
1
0
0
@@ -2654,7 +2642,7 @@
13
- 118
+ 117
1
0
0
@@ -2666,7 +2654,7 @@
13
- 119
+ 118
1
0
0
@@ -2678,7 +2666,7 @@
13
- 120
+ 119
1
0
0
@@ -2690,7 +2678,7 @@
13
- 121
+ 120
1
0
0
@@ -2702,7 +2690,7 @@
13
- 122
+ 121
1
0
0
@@ -2714,7 +2702,7 @@
13
- 123
+ 122
1
0
0
@@ -2726,7 +2714,7 @@
13
- 124
+ 123
1
0
0
@@ -2738,7 +2726,7 @@
13
- 125
+ 124
1
0
0
@@ -2750,7 +2738,7 @@
13
- 126
+ 125
1
0
0
@@ -2770,7 +2758,7 @@
0
14
- 127
+ 126
1
0
0
@@ -2782,7 +2770,7 @@
14
- 128
+ 127
1
0
0
@@ -2794,7 +2782,7 @@
14
- 129
+ 128
1
0
0
@@ -2806,7 +2794,7 @@
14
- 130
+ 129
1
0
0
@@ -2818,7 +2806,7 @@
14
- 131
+ 130
1
0
0
@@ -2830,7 +2818,7 @@
14
- 132
+ 131
1
0
0
@@ -2842,7 +2830,7 @@
14
- 133
+ 132
1
0
0
@@ -2854,7 +2842,7 @@
14
- 134
+ 133
1
0
0
@@ -2866,7 +2854,7 @@
14
- 135
+ 134
1
0
0
@@ -2878,7 +2866,7 @@
14
- 136
+ 135
1
0
0
@@ -2890,7 +2878,7 @@
14
- 137
+ 136
1
0
0
@@ -2902,7 +2890,7 @@
14
- 138
+ 137
1
0
0
@@ -2914,7 +2902,7 @@
14
- 139
+ 138
1
0
0
@@ -2934,7 +2922,7 @@
0
15
- 140
+ 139
1
0
0
@@ -2946,7 +2934,7 @@
15
- 141
+ 140
1
0
0
@@ -2958,7 +2946,7 @@
15
- 142
+ 141
1
0
0
@@ -2970,7 +2958,7 @@
15
- 143
+ 142
1
0
0
@@ -2982,7 +2970,7 @@
15
- 144
+ 143
1
0
0
@@ -2994,7 +2982,7 @@
15
- 145
+ 144
1
0
0
@@ -3006,7 +2994,7 @@
15
- 146
+ 145
1
0
0
@@ -3026,7 +3014,7 @@
0
16
- 147
+ 146
1
0
0
@@ -3038,7 +3026,7 @@
16
- 148
+ 147
1
0
0
@@ -3050,7 +3038,7 @@
16
- 149
+ 148
1
0
0
@@ -3070,7 +3058,7 @@
0
17
- 150
+ 149
4
0
0
@@ -3090,7 +3078,7 @@
0
18
- 151
+ 150
1
0
0
@@ -3102,7 +3090,7 @@
18
- 152
+ 151
1
0
0
@@ -3114,7 +3102,7 @@
18
- 153
+ 152
1
0
0
@@ -3134,7 +3122,7 @@
0
19
- 154
+ 153
4
0
0
@@ -3154,7 +3142,7 @@
0
20
- 155
+ 154
1
0
0
@@ -3166,7 +3154,7 @@
20
- 156
+ 155
1
0
0
@@ -3178,7 +3166,7 @@
20
- 157
+ 156
1
0
0
@@ -3190,7 +3178,7 @@
20
- 158
+ 157
1
0
0
@@ -3202,7 +3190,7 @@
20
- 159
+ 158
1
0
0
@@ -3214,7 +3202,7 @@
20
- 160
+ 159
1
0
0
@@ -3226,7 +3214,7 @@
20
- 161
+ 160
1
0
0
@@ -3238,7 +3226,7 @@
20
- 162
+ 161
1
0
0
@@ -3250,7 +3238,7 @@
20
- 163
+ 162
1
0
0
@@ -3262,7 +3250,7 @@
20
- 164
+ 163
1
0
0
diff --git a/project/ble_peripheral/ble_app_bladder_patch/pca10056/s140/arm5_no_packs/ble_app_bladder_patch_s140.uvprojx b/project/ble_peripheral/ble_app_bladder_patch/pca10056/s140/arm5_no_packs/ble_app_bladder_patch_s140.uvprojx
index 2135989..0513ccd 100644
--- a/project/ble_peripheral/ble_app_bladder_patch/pca10056/s140/arm5_no_packs/ble_app_bladder_patch_s140.uvprojx
+++ b/project/ble_peripheral/ble_app_bladder_patch/pca10056/s140/arm5_no_packs/ble_app_bladder_patch_s140.uvprojx
@@ -408,11 +408,6 @@
1
..\..\..\system\power\power_control.c
-
- tmp235_q1.c
- 1
- ..\..\..\measurement\temperature\tmp235_q1.c
-
fstorage.c
1
@@ -4616,11 +4611,6 @@
1
..\..\..\system\power\power_control.c
-
- tmp235_q1.c
- 1
- ..\..\..\measurement\temperature\tmp235_q1.c
-
fstorage.c
1
diff --git a/project/ble_peripheral/ble_app_bladder_patch/system/main_timer.c b/project/ble_peripheral/ble_app_bladder_patch/system/main_timer.c
index 920e676..a50fe6a 100644
--- a/project/ble_peripheral/ble_app_bladder_patch/system/main_timer.c
+++ b/project/ble_peripheral/ble_app_bladder_patch/system/main_timer.c
@@ -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));
}
-