msi 커맨드 삭제 및 rbb 버퍼 분리

This commit is contained in:
2026-04-16 19:03:27 +09:00
parent 24e5b2e205
commit 32b6fb800d
4 changed files with 9 additions and 35 deletions

View File

@@ -41,7 +41,6 @@ static const CmdEntry m_cmd_table[] = {
{ "msn?", true, Cmd_msn },
{ "mst?", true, Cmd_mst },
{ "msp?", true, Cmd_msp },
{ "msi?", true, Cmd_msi },
/* D. Piezo ultrasound */
{ "mpa?", true, Cmd_mpa },

View File

@@ -4,7 +4,6 @@
* msn? -> rsn: battery ADC measurement
* mso? -> rso: TMP235 temperature reading
* msp? -> rsp: IMU 6-axis single read
* msi? -> rsi: IMU motion streaming start
* all_sensors() bulk-measurement helper used by the mbb? handler
*============================================================================*/
@@ -74,34 +73,6 @@ int Cmd_msp(const ParsedCmd *cmd)
return 1;
}
/*==============================================================================
* msi? -> rsi: IMU motion sensor streaming start
*
* Request: [TAG 4B "msi?"] [mode 1B] [CRC 2B]
* mode = 'c': continuous (repeats on timer)
* else : single shot (one read then auto stop)
* Response: rsi: + IMU data (sent from main timer callback)
*============================================================================*/
int Cmd_msi(const ParsedCmd *cmd)
{
hw_i2c_init_once();
motion_raw_data_enabled = true;
ble_got_new_data = false;
if (cmd->data_len > 0 && (char)cmd->data[0] == 'c')
{
motion_data_once = false;
}
else
{
motion_data_once = true;
}
main_timer_start();
return 1;
}
/*==============================================================================
* all_sensors() - Bulk-measurement helper for the mbb? handler
*
@@ -146,8 +117,10 @@ void all_sensors(void)
info4 = false;
/* Assemble and transmit the rbb: packet */
buf = ble_bin_buffer;
/* Assemble and transmit the rbb: packet (dedicated buffer to avoid
collision with ble_bin_buffer used by the async ADC state machine) */
static uint8_t rbb_buf[20];
buf = rbb_buf;
buf[0] = 'r'; buf[1] = 'b'; buf[2] = 'b'; buf[3] = ':';
buf[4] = (uint8_t)(info_batt >> 8);
buf[5] = (uint8_t)(info_batt & 0xFF);

View File

@@ -9,8 +9,6 @@
int Cmd_msn(const ParsedCmd *cmd); /* msn? -> rsn: battery ADC measurement */
int Cmd_mst(const ParsedCmd *cmd); /* mst? -> rso: TMP235 with piezo power cycle */
int Cmd_msp(const ParsedCmd *cmd); /* msp? -> rsp: IMU 6-axis single read */
int Cmd_msi(const ParsedCmd *cmd); /* msi? -> rsi: IMU streaming start */
/* Helper for the mbb? handler: sequentially measures battery / IMU / temperature, then emits a single rbb: response.
* Called from Cmd_mbb() in cmd_piezo.c. */
void all_sensors(void);

View File

@@ -1377,7 +1377,11 @@ dr_adc_err_t maa_async_start(uint8_t freq_option, uint16_t delay_us, uint16_t nu
{
g_plat.log("[maa] maa_async_start: CH%u capture failed (%d)", ch, err);
}
maa_async_send_completion(0xFFF0 | ch);
/* Clean up state only — do NOT send raa: here.
The caller (Cmd_maa / Cmd_mbb) sends the raa: error packet
to avoid duplicate raa: on the BLE link. */
dr_piezo_power_off();
g_maa_ctx.state = MAA_ASYNC_IDLE;
return err;
}
}