piezo power on/off 시점 조정(전력 절감)

- on 구간 최소화
This commit is contained in:
2026-08-25 18:17:56 +09:00
parent effdda9e91
commit 4282b9967c
2 changed files with 11 additions and 5 deletions
+8 -2
View File
@@ -64,7 +64,11 @@ int cmd_mbb(const uint8_t *data, uint8_t data_len)
cmd_send_response_bundle((uint16_t)batt_mv, accel, gyro, temp_cdeg);
DBG_PRINTF("[MBB] piezo sweep start\r\n");
status = piezo_measure_sweep();
piezo_power_off();
if (status == ECHO_STATUS_OK)
{
for (uint8_t ch = 0; ch < PIEZO_NUM_CHANNELS; ch++)
@@ -75,7 +79,7 @@ int cmd_mbb(const uint8_t *data, uint8_t data_len)
}
}
piezo_power_off();
DBG_PRINTF("[MBB] done\r\n");
cmd_send_response_u16("raa:", (uint16_t)status); // 최종 상태 raa: 전송
DBG_PRINTF("[CMD] mbb status=0x%04X\r\n", status);
@@ -123,6 +127,9 @@ int cmd_mtb(const uint8_t *data, uint8_t data_len)
{
DBG_PRINTF("[MTB] piezo sweep start\r\n");
status = piezo_measure_sweep();
piezo_power_off();
if (status == ECHO_STATUS_OK)
{
for (uint8_t ch = 0; ch < PIEZO_NUM_CHANNELS; ch++)
@@ -157,7 +164,6 @@ int cmd_mtb(const uint8_t *data, uint8_t data_len)
}
DBG_PRINTF("[CMD] mtb status=0x%04X\r\n", status);
piezo_power_off();
DBG_PRINTF("[CMD] mtb status=0x%04X rim=%u\r\n", status, rim_count);
processing = false;
+3 -3
View File
@@ -167,9 +167,6 @@ int piezo_measure_start_session(void)
return ECHO_STATUS_PIEZO;
}
piezo_power_on();
k_msleep(PIEZO_POWER_STABILIZE_MS);
err = echo_adc_init();
if (err)
{
@@ -233,6 +230,9 @@ int piezo_measure_sweep(void)
if (ch == 0U) // 채널 0 시작 전에만 dummy burst + ADC capture 수행
{
piezo_power_on();
k_msleep(PIEZO_POWER_STABILIZE_MS);
// Dummy burst + ADC caputre
/*
for (uint8_t dummy = 0; dummy < PIEZO_DUMMY_CAPTURE_COUNT; dummy++)