|
|
@@ -353,6 +353,7 @@ int mc_conf_decode_controler(u8 *buff) {
|
|
|
conf.c.thro_max_vol = decode_float(buff);buff += 4;
|
|
|
conf.c.thro_min_vol = decode_float(buff);buff += 4;
|
|
|
conf.c.thro_dec_time = decode_u16(buff);buff += 2;
|
|
|
+ conf.c.max_torque = min(conf.c.max_torque, conf.m.max_torque);
|
|
|
buff += mc_conf_decode_pid(&conf.c.pid[PID_VelLim_ID], buff);
|
|
|
buff += mc_conf_decode_pid(&conf.c.pid[PID_Vel_ID], buff);
|
|
|
buff += mc_conf_decode_pid(&conf.c.pid[PID_AutoHold_ID], buff);
|
|
|
@@ -415,7 +416,12 @@ int mc_conf_decode_gear(gear_t *g , u8 *buff) {
|
|
|
g[i].accl_time = decode_u16(buff); buff += 2;
|
|
|
for (int j = 0; j < CONFIG_GEAR_SPEED_TRQ_NUM; j++) {
|
|
|
g[i].torque[j] = decode_u8(buff++);
|
|
|
+ if (g[i].torque[j] > 100) {
|
|
|
+ g[i].torque[j] = 100;
|
|
|
+ }
|
|
|
}
|
|
|
+ g[i].max_trq = min(g[i].max_trq, conf.c.max_torque);
|
|
|
+ g[i].max_idc = min(g[i].max_idc, conf.c.max_idc);
|
|
|
}
|
|
|
return buff - ori;
|
|
|
}
|
|
|
@@ -464,6 +470,7 @@ int mc_conf_decode_engreco(u8 *buff) {
|
|
|
for (int i = 0; i < CONFIG_EBRK_LVL_NUM; i++) {
|
|
|
conf.e_r[i].torque = decode_s16(buff); buff += 2;
|
|
|
conf.e_r[i].time = decode_s16(buff); buff += 2;
|
|
|
+ conf.e_r[i].torque = min(conf.e_r[i].torque, conf.c.max_ebrk_torque);
|
|
|
}
|
|
|
return buff - ori;
|
|
|
}
|