|
|
@ -275,7 +275,7 @@ static void others_func_impl(uint8_t from, uint8_t to, uint8_t* rawpacket, size_ |
|
|
|
} |
|
|
|
|
|
|
|
// 压力传感器数据上报
|
|
|
|
else if (packet->function_id == kcmd_read_pressure_data) { |
|
|
|
else if (packet->function_id == kcmd_pressure_sensor_bus_read_data) { |
|
|
|
CHECK_PARAM_LEN(paramNum, 1); |
|
|
|
int32_t index = GET_PARAM(packet->params, 0); |
|
|
|
|
|
|
@ -293,7 +293,7 @@ static void others_func_impl(uint8_t from, uint8_t to, uint8_t* rawpacket, size_ |
|
|
|
|
|
|
|
} |
|
|
|
// 压力传感器数据上报
|
|
|
|
else if (packet->function_id == kcmd_set_pressure_data_report_period_ms) { |
|
|
|
else if (packet->function_id == kcmd_pressure_sensor_bus_set_report_period_ms) { |
|
|
|
CHECK_PARAM_LEN(paramNum, 1); |
|
|
|
int32_t period = GET_PARAM(packet->params, 0); |
|
|
|
|
|
|
@ -381,6 +381,7 @@ static void onMotorMonitorTimer(void const* argument) { |
|
|
|
} else { |
|
|
|
auto gstate = Hardware::ins().motor(i)->getGState(); |
|
|
|
bool flag = gstate.reset || gstate.drv_err || gstate.uv_cp; |
|
|
|
// flag = true;
|
|
|
|
if (!flag && motorErrorFlagCache[i]) { |
|
|
|
motorErrorFlagCache[i] = false; |
|
|
|
} else if (flag && !motorErrorFlagCache[i]) { |
|
|
@ -391,8 +392,11 @@ static void onMotorMonitorTimer(void const* argument) { |
|
|
|
data.ecode = kerr_motor_undervoltage_error; |
|
|
|
} else if (gstate.drv_err) { |
|
|
|
data.ecode = kerr_motor_driver_error; |
|
|
|
} else { |
|
|
|
data.ecode = kerr_motor_unkown_error; |
|
|
|
} |
|
|
|
data.subid = i; |
|
|
|
motorErrorFlagCache[i] = true; |
|
|
|
zcanbus_send_emergency_report(kreport_exception_error, (uint8_t*)&data, sizeof(data), 100); |
|
|
|
} |
|
|
|
} |
|
|
|