Skip to content

Commit d30fb57

Browse files
committed
Fixed stat reset, removed stat terminal command
1 parent 6b076f0 commit d30fb57

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

commands.c

+2
Original file line numberDiff line numberDiff line change
@@ -1522,6 +1522,8 @@ void commands_process_packet(unsigned char *data, unsigned int len,
15221522
ack = data[0];
15231523
}
15241524

1525+
mc_interface_stat_reset();
1526+
15251527
if (ack) {
15261528
int32_t ind = 0;
15271529
uint8_t send_buffer[50];

terminal.c

+2-23
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ void terminal_process_string(char *str) {
721721
#endif
722722
commands_printf("Motor Current : %.1f A", (double)(mcconf->l_current_max));
723723
commands_printf("Motor R : %.2f mOhm", (double)(mcconf->foc_motor_r * 1e3));
724-
commands_printf("Motor L : %.2f microH", (double)(mcconf->foc_motor_l * 1e6));
724+
commands_printf("Motor L : %.2f uH", (double)(mcconf->foc_motor_l * 1e6));
725725
commands_printf("Motor Flux Linkage : %.3f mWb", (double)(mcconf->foc_motor_flux_linkage * 1e3));
726726
commands_printf("Temp Comp : %s", mcconf->foc_temp_comp ? "true" : "false");
727727
if (mcconf->foc_temp_comp) {
@@ -743,7 +743,7 @@ void terminal_process_string(char *str) {
743743
commands_printf("\nMOTOR 2\n");
744744
commands_printf("Motor Current : %.1f A", (double)(mcconf->l_current_max));
745745
commands_printf("Motor R : %.2f mOhm", (double)(mcconf->foc_motor_r * 1e3));
746-
commands_printf("Motor L : %.2f microH", (double)(mcconf->foc_motor_l * 1e6));
746+
commands_printf("Motor L : %.2f uH", (double)(mcconf->foc_motor_l * 1e6));
747747
commands_printf("Motor Flux Linkage : %.3f mWb", (double)(mcconf->foc_motor_flux_linkage * 1e3));
748748
commands_printf("Temp Comp : %s", mcconf->foc_temp_comp ? "true" : "false");
749749
if (mcconf->foc_sensor_mode == FOC_SENSOR_MODE_SENSORLESS) {
@@ -1122,21 +1122,6 @@ void terminal_process_string(char *str) {
11221122
commands_printf("Invalid arguments\n");
11231123
}
11241124
}
1125-
} else if (strcmp(argv[0], "stats") == 0) {
1126-
commands_printf("Speed Avg : %.1f km/h", (double)(mc_interface_stat_speed_avg() * 3.6));
1127-
commands_printf("Speed Max : %.1f km/h", (double)(mc_interface_stat_speed_max() * 3.6));
1128-
commands_printf("Power Avg : %.1f W", (double)mc_interface_stat_power_avg());
1129-
commands_printf("Power Max : %.1f W", (double)mc_interface_stat_power_max());
1130-
commands_printf("Current Avg: %.1f A", (double)mc_interface_stat_current_avg());
1131-
commands_printf("Current Max: %.1f A", (double)mc_interface_stat_current_max());
1132-
commands_printf("T FET Avg : %.1f degC", (double)mc_interface_stat_temp_mosfet_avg());
1133-
commands_printf("T FET Max : %.1f degC", (double)mc_interface_stat_temp_mosfet_max());
1134-
commands_printf("T MOTOR Avg: %.1f degC", (double)mc_interface_stat_temp_motor_avg());
1135-
commands_printf("T MOTOR Max: %.1f degC", (double)mc_interface_stat_temp_motor_max());
1136-
commands_printf("Count Time : %.1f s\n", (double)mc_interface_stat_count_time());
1137-
} else if (strcmp(argv[0], "stats_reset") == 0) {
1138-
mc_interface_stat_reset();
1139-
commands_printf("OK\n");
11401125
}
11411126

11421127
// The help command
@@ -1285,12 +1270,6 @@ void terminal_process_string(char *str) {
12851270
commands_printf("update_pid_pos_offset [angle_now] [store]");
12861271
commands_printf(" Update position PID offset.");
12871272

1288-
commands_printf("stats");
1289-
commands_printf(" Print setup statistics.");
1290-
1291-
commands_printf("stats_reset");
1292-
commands_printf(" Reset setup statistics.");
1293-
12941273
for (int i = 0;i < callback_write;i++) {
12951274
if (callbacks[i].cbf == 0) {
12961275
continue;

0 commit comments

Comments
 (0)