|
@ -309,8 +309,8 @@ static void others_func_impl(uint8_t from, uint8_t to, uint8_t* rawpacket, size_ |
|
|
} else { |
|
|
} else { |
|
|
zcanbus_send_errorack(packet, kerr_subdevice_offline); |
|
|
zcanbus_send_errorack(packet, kerr_subdevice_offline); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
#if 0
|
|
|
// 压力传感器数据上报
|
|
|
// 压力传感器数据上报
|
|
|
else if (packet->function_id == kcmd_pressure_sensor_bus_set_report_period_ms) { |
|
|
else if (packet->function_id == kcmd_pressure_sensor_bus_set_report_period_ms) { |
|
|
CHECK_PARAM_LEN(paramNum, 1); |
|
|
CHECK_PARAM_LEN(paramNum, 1); |
|
@ -329,6 +329,7 @@ static void others_func_impl(uint8_t from, uint8_t to, uint8_t* rawpacket, size_ |
|
|
|
|
|
|
|
|
zcanbus_send_ack(packet, NULL, 0); |
|
|
zcanbus_send_ack(packet, NULL, 0); |
|
|
} |
|
|
} |
|
|
|
|
|
#endif
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
/***********************************************************************************************************************
|
|
@ -358,7 +359,7 @@ static void zcanbus_on_connected(bool connected) { |
|
|
ZLOGI(TAG, "disconnected from host"); |
|
|
ZLOGI(TAG, "disconnected from host"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
static void onPressureSensorDataReportTimer(void const* argument) { |
|
|
static void onPressureSensorDataReportTimer(void const* argument) { |
|
|
// 压力传感器数据上报
|
|
|
// 压力传感器数据上报
|
|
|
static uint8_t reportcache[100]; |
|
|
static uint8_t reportcache[100]; |
|
@ -381,6 +382,7 @@ static void onPressureSensorDataReportTimer(void const* argument) { |
|
|
zcanbus_send_report(kreport_pressure_data, (uint8_t*)report, //
|
|
|
zcanbus_send_report(kreport_pressure_data, (uint8_t*)report, //
|
|
|
sizeof(report_pressure_data_t) + sensorNum * sizeof(report->data[0]), 10); |
|
|
sizeof(report_pressure_data_t) + sensorNum * sizeof(report->data[0]), 10); |
|
|
} |
|
|
} |
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
static void onMotorMonitorTimer(void const* argument) { |
|
|
static void onMotorMonitorTimer(void const* argument) { |
|
|
// 电机异常检查
|
|
|
// 电机异常检查
|
|
@ -437,9 +439,11 @@ void protocol_impl_service_init() { // |
|
|
zcanbus_reglistener(zcanbus_on_rx); |
|
|
zcanbus_reglistener(zcanbus_on_rx); |
|
|
zcanbus_reg_on_connected_listener(zcanbus_on_connected); |
|
|
zcanbus_reg_on_connected_listener(zcanbus_on_connected); |
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
osTimerDef(PressureSensorDataReportTimer, onPressureSensorDataReportTimer); |
|
|
osTimerDef(PressureSensorDataReportTimer, onPressureSensorDataReportTimer); |
|
|
PressureSensorDataReportTimerId = osTimerCreate(osTimer(PressureSensorDataReportTimer), osTimerPeriodic, NULL); |
|
|
PressureSensorDataReportTimerId = osTimerCreate(osTimer(PressureSensorDataReportTimer), osTimerPeriodic, NULL); |
|
|
osTimerStart(PressureSensorDataReportTimerId, m_pressureSensorDataReportPeriodMs); |
|
|
osTimerStart(PressureSensorDataReportTimerId, m_pressureSensorDataReportPeriodMs); |
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
osTimerDef(MotorMonitorTimer, onMotorMonitorTimer); |
|
|
osTimerDef(MotorMonitorTimer, onMotorMonitorTimer); |
|
|
MotorMonitorTimerId = osTimerCreate(osTimer(MotorMonitorTimer), osTimerPeriodic, NULL); |
|
|
MotorMonitorTimerId = osTimerCreate(osTimer(MotorMonitorTimer), osTimerPeriodic, NULL); |
|
|