캡처 중 전원 버튼 허용
This commit is contained in:
@@ -42,7 +42,6 @@ int cmd_mbb(const uint8_t *data, uint8_t data_len)
|
|||||||
int16_t gyro[3];
|
int16_t gyro[3];
|
||||||
|
|
||||||
processing = true;
|
processing = true;
|
||||||
power_button_suspend(true);
|
|
||||||
DBG_PRINTF("[MBB] cmd start\r\n");
|
DBG_PRINTF("[MBB] cmd start\r\n");
|
||||||
|
|
||||||
int batt_mv = -1;
|
int batt_mv = -1;
|
||||||
@@ -77,7 +76,6 @@ int cmd_mbb(const uint8_t *data, uint8_t data_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
piezo_power_off();
|
piezo_power_off();
|
||||||
power_button_suspend(false);
|
|
||||||
DBG_PRINTF("[MBB] done\r\n");
|
DBG_PRINTF("[MBB] done\r\n");
|
||||||
cmd_send_response_u16("raa:", (uint16_t)status); // 최종 상태 raa: 전송
|
cmd_send_response_u16("raa:", (uint16_t)status); // 최종 상태 raa: 전송
|
||||||
DBG_PRINTF("[CMD] mbb status=0x%04X\r\n", status);
|
DBG_PRINTF("[CMD] mbb status=0x%04X\r\n", status);
|
||||||
@@ -107,7 +105,6 @@ int cmd_mtb(const uint8_t *data, uint8_t data_len)
|
|||||||
bool fifo_started = false;
|
bool fifo_started = false;
|
||||||
|
|
||||||
processing = true;
|
processing = true;
|
||||||
power_button_suspend(true);
|
|
||||||
DBG_PRINTF("[MTB] cmd start\r\n");
|
DBG_PRINTF("[MTB] cmd start\r\n");
|
||||||
|
|
||||||
int imu_ret = imu_fifo_start();
|
int imu_ret = imu_fifo_start();
|
||||||
@@ -155,7 +152,6 @@ int cmd_mtb(const uint8_t *data, uint8_t data_len)
|
|||||||
DBG_PRINTF("[CMD] mtb status=0x%04X\r\n", status);
|
DBG_PRINTF("[CMD] mtb status=0x%04X\r\n", status);
|
||||||
|
|
||||||
piezo_power_off();
|
piezo_power_off();
|
||||||
power_button_suspend(false);
|
|
||||||
DBG_PRINTF("[CMD] mtb status=0x%04X rim=%u\r\n", status, rim_count);
|
DBG_PRINTF("[CMD] mtb status=0x%04X rim=%u\r\n", status, rim_count);
|
||||||
|
|
||||||
processing = false;
|
processing = false;
|
||||||
@@ -227,7 +223,6 @@ int cmd_mim(const uint8_t *data, uint8_t data_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
processing = true;
|
processing = true;
|
||||||
power_button_suspend(true);
|
|
||||||
|
|
||||||
uint16_t rim_count = 0U;
|
uint16_t rim_count = 0U;
|
||||||
int imu_ret = imu_fifo_start();
|
int imu_ret = imu_fifo_start();
|
||||||
@@ -235,7 +230,6 @@ int cmd_mim(const uint8_t *data, uint8_t data_len)
|
|||||||
{
|
{
|
||||||
DBG_PRINTF("[MTB] fifo start fail ret=%d\r\n", imu_ret);
|
DBG_PRINTF("[MTB] fifo start fail ret=%d\r\n", imu_ret);
|
||||||
cmd_send_response_rim(tx_rim_samples, 0U);
|
cmd_send_response_rim(tx_rim_samples, 0U);
|
||||||
power_button_suspend(false);
|
|
||||||
processing = false;
|
processing = false;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -251,7 +245,6 @@ int cmd_mim(const uint8_t *data, uint8_t data_len)
|
|||||||
|
|
||||||
cmd_send_response_rim(tx_rim_samples, rim_count); // IMU FIFO 15 samples rim: 전송
|
cmd_send_response_rim(tx_rim_samples, rim_count); // IMU FIFO 15 samples rim: 전송
|
||||||
imu_fifo_stop();
|
imu_fifo_stop();
|
||||||
power_button_suspend(false);
|
|
||||||
processing = false;
|
processing = false;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -273,7 +266,6 @@ int cmd_maa(const uint8_t *data, uint8_t data_len)
|
|||||||
uint8_t session = cmd_next_echo_session();
|
uint8_t session = cmd_next_echo_session();
|
||||||
|
|
||||||
processing = true;
|
processing = true;
|
||||||
power_button_suspend(true);
|
|
||||||
|
|
||||||
int status = piezo_measure_start_session();
|
int status = piezo_measure_start_session();
|
||||||
|
|
||||||
@@ -292,7 +284,6 @@ int cmd_maa(const uint8_t *data, uint8_t data_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
piezo_power_off();
|
piezo_power_off();
|
||||||
power_button_suspend(false);
|
|
||||||
cmd_send_response_u16("raa:", (uint16_t)status); // 최종 상태 raa: 전송
|
cmd_send_response_u16("raa:", (uint16_t)status); // 최종 상태 raa: 전송
|
||||||
DBG_PRINTF("[CMD] maa status=0x%04X\r\n", status);
|
DBG_PRINTF("[CMD] maa status=0x%04X\r\n", status);
|
||||||
|
|
||||||
@@ -371,11 +362,9 @@ int cmd_mpc(const uint8_t *data, uint8_t data_len)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
power_button_suspend(true);
|
|
||||||
|
|
||||||
if (piezo_init() != 0)
|
if (piezo_init() != 0)
|
||||||
{
|
{
|
||||||
power_button_suspend(false);
|
|
||||||
cmd_send_response_u16("rpc:", 0);
|
cmd_send_response_u16("rpc:", 0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -385,14 +374,12 @@ int cmd_mpc(const uint8_t *data, uint8_t data_len)
|
|||||||
if (piezo_select_channel((uint8_t)(piezo_ch % PIEZO_NUM_CHANNELS)) != 0)
|
if (piezo_select_channel((uint8_t)(piezo_ch % PIEZO_NUM_CHANNELS)) != 0)
|
||||||
{
|
{
|
||||||
piezo_power_off();
|
piezo_power_off();
|
||||||
power_button_suspend(false);
|
|
||||||
cmd_send_response_u16("rpc:", 0);
|
cmd_send_response_u16("rpc:", 0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
piezo_burst_sw_freq((uint8_t)freq_option, cycles);
|
piezo_burst_sw_freq((uint8_t)freq_option, cycles);
|
||||||
piezo_power_off();
|
piezo_power_off();
|
||||||
power_button_suspend(false);
|
|
||||||
|
|
||||||
cmd_send_response_u16("rpc:", cycles);
|
cmd_send_response_u16("rpc:", cycles);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -434,7 +421,6 @@ int cmd_mec(const uint8_t *data, uint8_t data_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
processing = true;
|
processing = true;
|
||||||
power_button_suspend(true);
|
|
||||||
|
|
||||||
int status = piezo_measure_start_session();
|
int status = piezo_measure_start_session();
|
||||||
if (status == ECHO_STATUS_OK)
|
if (status == ECHO_STATUS_OK)
|
||||||
@@ -448,7 +434,6 @@ int cmd_mec(const uint8_t *data, uint8_t data_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
piezo_power_off();
|
piezo_power_off();
|
||||||
power_button_suspend(false);
|
|
||||||
cmd_send_response_u16("raa:", (uint16_t)status);
|
cmd_send_response_u16("raa:", (uint16_t)status);
|
||||||
processing = false;
|
processing = false;
|
||||||
return 1;
|
return 1;
|
||||||
@@ -480,7 +465,6 @@ int cmd_mad(const uint8_t *data, uint8_t data_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
processing = true;
|
processing = true;
|
||||||
power_button_suspend(true);
|
|
||||||
|
|
||||||
int status = piezo_measure_start_session();
|
int status = piezo_measure_start_session();
|
||||||
if (status == ECHO_STATUS_OK)
|
if (status == ECHO_STATUS_OK)
|
||||||
@@ -494,7 +478,6 @@ int cmd_mad(const uint8_t *data, uint8_t data_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
piezo_power_off();
|
piezo_power_off();
|
||||||
power_button_suspend(false);
|
|
||||||
cmd_send_response_u16("raa:", (uint16_t)status);
|
cmd_send_response_u16("raa:", (uint16_t)status);
|
||||||
DBG_PRINTF("[CMD] mad status=0x%04X ch=%u samples=%u avg=%u\r\n",
|
DBG_PRINTF("[CMD] mad status=0x%04X ch=%u samples=%u avg=%u\r\n",
|
||||||
status,
|
status,
|
||||||
|
|||||||
Reference in New Issue
Block a user