generated from hulk/gd32e23x_template_cmake_vscode
fix function name
This commit is contained in:
@@ -75,7 +75,7 @@ bool get_sensor_report_enabled(void);
|
|||||||
* @note 推荐通过此函数修改状态,便于后续功能扩展。
|
* @note 推荐通过此函数修改状态,便于后续功能扩展。
|
||||||
* @ingroup Command
|
* @ingroup Command
|
||||||
*/
|
*/
|
||||||
void set_sensor_report_enabled(bool enabled);
|
void set_sensor_report_status(bool enabled);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 处理串口环形缓冲区中的命令数据。
|
* @brief 处理串口环形缓冲区中的命令数据。
|
||||||
|
@@ -103,12 +103,12 @@ bool get_sensor_report_enabled(void)
|
|||||||
* @brief 设置是否启用周期性传感器上报标志。
|
* @brief 设置是否启用周期性传感器上报标志。
|
||||||
* @details 本模块内部保存的布尔状态,供其他逻辑决定是否进行周期性数据上报;
|
* @details 本模块内部保存的布尔状态,供其他逻辑决定是否进行周期性数据上报;
|
||||||
* 推荐通过本函数修改而非直接访问全局/静态变量,以便后续扩展(如加锁/回调)。
|
* 推荐通过本函数修改而非直接访问全局/静态变量,以便后续扩展(如加锁/回调)。
|
||||||
* @param enabled true 启用周期上报;false 禁用。
|
* @param status true 启用周期上报;false 禁用。
|
||||||
* @ingroup Command
|
* @ingroup Command
|
||||||
*/
|
*/
|
||||||
void set_sensor_report_enabled(bool enabled)
|
void set_sensor_report_status(bool status)
|
||||||
{
|
{
|
||||||
s_sensor_report_enabled = enabled;
|
s_sensor_report_enabled = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -276,14 +276,14 @@ void handle_command(const uint8_t *frame, uint8_t len) {
|
|||||||
// 仅基础命令,如 M1, M2, M3
|
// 仅基础命令,如 M1, M2, M3
|
||||||
switch (base_cmd) {
|
switch (base_cmd) {
|
||||||
case 1u: // M1命令
|
case 1u: // M1命令
|
||||||
set_sensor_report_enabled(true);
|
set_sensor_report_status(true);
|
||||||
// led_on();
|
// led_on();
|
||||||
// send_response(RESP_TYPE_OK, s_report_status_ok, sizeof(s_report_status_ok));
|
// send_response(RESP_TYPE_OK, s_report_status_ok, sizeof(s_report_status_ok));
|
||||||
uint8_t test_response1[] = { 0xAA, 0xBB, 0xCC, 0xDD };
|
uint8_t test_response1[] = { 0xAA, 0xBB, 0xCC, 0xDD };
|
||||||
send_response(RESP_TYPE_OK, test_response1, sizeof(test_response1));
|
send_response(RESP_TYPE_OK, test_response1, sizeof(test_response1));
|
||||||
return;
|
return;
|
||||||
case 2u: // M2命令
|
case 2u: // M2命令
|
||||||
set_sensor_report_enabled(false);
|
set_sensor_report_status(false);
|
||||||
// led_off();
|
// led_off();
|
||||||
// send_response(RESP_TYPE_OK, s_report_status_ok, sizeof(s_report_status_ok));
|
// send_response(RESP_TYPE_OK, s_report_status_ok, sizeof(s_report_status_ok));
|
||||||
uint8_t test_response2[] = { 0xDD, 0xCC, 0xBB, 0xAA };
|
uint8_t test_response2[] = { 0xDD, 0xCC, 0xBB, 0xAA };
|
||||||
|
Reference in New Issue
Block a user