fix: BLE TX 먹통 해결 및 메모리 안전성 개선
- binary_tx_handler를 dr_binary_tx_safe로 전체 교체 (APP_ERROR_CHECK 제거) - data_tx_handler APP_ERROR_CHECK → DBG_PRINTF 교체 - memset/memcpy 하드코딩 크기를 define 상수로 교체 (버퍼 오버런 수정) - SERIAL_NO_LENGTH, HW_NO_LENGTH, PASSKEY_LENGTH를 main.h로 통합 - 미사용 HW 드라이버/EEPROM 코드 삭제, TWI를 i2c_manager.c로 통합 - EEPROM → FDS 전환, 코드 리뷰 현황 문서 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
//#include "fstorage.h"
|
||||
#include "battery_saadc.h"
|
||||
#include "main_timer.h"
|
||||
#include "meas_pd_48.h"
|
||||
#include <cmd_parse.h>
|
||||
#include "debug_print.h"
|
||||
#define BATTERY_REF_VOLTAGE_IN_MILLIVOLTS 600 /**< Reference voltage (in milli volts) used by ADC while doing conversion. */
|
||||
@@ -52,8 +51,8 @@ bool low_battery_check = false;
|
||||
extern bool info4; //cmd_parse
|
||||
|
||||
// cj add edit 25/11/24
|
||||
extern volatile uint16_t info_p1;
|
||||
extern volatile uint16_t info_p2;
|
||||
volatile uint16_t info_p1;
|
||||
volatile uint16_t info_p2;
|
||||
|
||||
|
||||
extern char ble_tx_buffer[BLE_NUS_MAX_DATA_LEN];
|
||||
@@ -63,7 +62,7 @@ extern volatile bool processing;
|
||||
extern which_cmd_t cmd_type_t;
|
||||
|
||||
extern uint8_t ble_bin_buffer[BLE_NUS_MAX_DATA_LEN] ;
|
||||
extern volatile uint16_t info_batt; //48_c
|
||||
volatile uint16_t info_batt; //48_c
|
||||
extern bool go_temp; //
|
||||
extern bool go_batt; //cmd_parse
|
||||
|
||||
@@ -133,7 +132,7 @@ void pressure_all_event_handler(nrf_drv_saadc_evt_t const * p_event)
|
||||
result_data[0] = p1_mV;
|
||||
result_data[1] = p2_mV;
|
||||
format_data(ble_bin_buffer, "rpn:", result_data,2);
|
||||
binary_tx_handler(ble_bin_buffer,4);
|
||||
dr_binary_tx_safe(ble_bin_buffer,4);
|
||||
|
||||
|
||||
}
|
||||
@@ -199,7 +198,7 @@ void battery_event_handler( nrf_drv_saadc_evt_t const * p_event )
|
||||
|
||||
single_format_data(ble_bin_buffer, "rsn:", batt_lvl_in_milli_volt_1);
|
||||
|
||||
binary_tx_handler(ble_bin_buffer,3);
|
||||
dr_binary_tx_safe(ble_bin_buffer,3);
|
||||
//data_tx_handler(ble_tx_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user