주기적 배터리 저전압 및 고온 체크

- 온도 측정 추가
This commit is contained in:
2026-04-16 19:01:12 +09:00
parent 143e22c2d8
commit 24e5b2e205
3 changed files with 122 additions and 44 deletions

View File

@@ -24,6 +24,7 @@
#include "tmp235_q1.h"
#include "main.h"
#include "main_timer.h"
#include "battery_saadc.h"
#include "debug_print.h"
/* SAADC internal reference (mV) */
@@ -101,20 +102,27 @@ void tmp235_voltage_handler(nrf_drv_saadc_evt_t const * p_event)
DBG_PRINTF("ERR!!! Temperature is over 150c\r\n");
}
if (info4 == true)
/* --- Safety check mode: pass temperature to battery module for judgment --- */
if (safety_check_mode == true)
{
safety_check_mode = false;
safety_check_complete(led_temp);
}
/* --- info4 mode: store value for mbb? bulk response --- */
else if (info4 == true)
{
/* Store as integer (e.g. 36.50 C -> 3650) */
info_temp = (uint16_t)(led_temp * 100);
}
else if(cmd_type_t == CMD_UART)
else if (cmd_type_t == CMD_UART)
{
DBG_PRINTF("To%.2f\r\n\r\n",led_temp);
DBG_PRINTF("To%.2f\r\n\r\n", led_temp);
}
else if(cmd_type_t == CMD_BLE)
{
else if (cmd_type_t == CMD_BLE)
{
led_temp_16 = led_temp * 100;
single_format_data(ble_bin_buffer, "rso:", (uint16_t)led_temp_16);
dr_binary_tx_safe(ble_bin_buffer,3);
dr_binary_tx_safe(ble_bin_buffer, 3);
}
tmp235_saadc_done = true;