온도 센서 콜백 완료 플래그 추가

- tmp235_q1.c: SAADC 완료 플래그(tmp235_saadc_done) 추가
- parser.c: all_sensors()에서 고정 1ms 대기 -> 콜백 완료 플래그 대기로 변경
This commit is contained in:
jhChun
2026-03-24 17:26:36 +09:00
parent be3ebc9a63
commit 35e09eee33
2 changed files with 8 additions and 1 deletions

View File

@@ -1019,8 +1019,10 @@ static void all_sensors(void)
dr_piezo_power_on();
}
extern volatile bool tmp235_saadc_done;
tmp235_saadc_done = false;
tmp235_voltage_level_meas();
dr_sd_delay_ms(1); /* SAADC 콜백 완료 대기 */
while (!tmp235_saadc_done) { dr_sd_delay_ms(1); } /* SAADC 콜백 완료 대기 */
info4 = false;

View File

@@ -74,6 +74,9 @@ extern bool go_temp; // main_timer.c
volatile uint16_t info_temp; //48_C
extern bool motion_raw_data_enabled;
/* SAADC 완료 플래그 — all_sensors()에서 콜백 완료 대기용 */
volatile bool tmp235_saadc_done = false;
/**@brief Function for handling the ADC interrupt.
*
* @details This function will fetch the conversion result from the ADC, convert the value into
@@ -158,6 +161,8 @@ void tmp235_voltage_handler(nrf_drv_saadc_evt_t const * p_event) /* TMP325 Vout
// sprintf(ble_tx_buffer, "To%.2f\r\n",led_temp);
// data_tx_handler(ble_tx_buffer);
}
tmp235_saadc_done = true;
}
}