dead code removed
This commit is contained in:
parent
b785043967
commit
92448cf9a5
@ -41,35 +41,6 @@ static void collision_ctrl_loop(void *arg)
|
|||||||
while(1) {
|
while(1) {
|
||||||
int pulse_ns = drv_ioctl(&pwm2_c4, IOCTL_PWM_GET_PULSE_WIDTH_NS, NULL);
|
int pulse_ns = drv_ioctl(&pwm2_c4, IOCTL_PWM_GET_PULSE_WIDTH_NS, NULL);
|
||||||
collision_ctrl_object.distance_mm = 343 * pulse_ns / 1000 / 2;
|
collision_ctrl_object.distance_mm = 343 * pulse_ns / 1000 / 2;
|
||||||
#if 0
|
|
||||||
if(collision_ctrl_object.distance_mm < 300) {
|
|
||||||
char print_buffer[50];
|
|
||||||
if(engine_ctrl_get_current_speed_value() != 0) {
|
|
||||||
drive_ctrl_halt();
|
|
||||||
sprintf(print_buffer, "collision detected (%dmm)...\r\n", collision_ctrl_object.distance_mm);
|
|
||||||
shell_write(print_buffer, strlen(print_buffer));
|
|
||||||
sprintf(print_buffer, "going back...\r\n");
|
|
||||||
shell_write(print_buffer, strlen(print_buffer));
|
|
||||||
drive_ctrl_backward();
|
|
||||||
sleep_ms(500);
|
|
||||||
drive_ctrl_halt();
|
|
||||||
|
|
||||||
sprintf(print_buffer, "start turning...\r\n");
|
|
||||||
shell_write(print_buffer, strlen(print_buffer));
|
|
||||||
drive_ctrl_turn_left();
|
|
||||||
sleep_ms(drv_read(&rng, NULL, 0) % 3500 + 500); // rand between 500 and 4000
|
|
||||||
drive_ctrl_halt();
|
|
||||||
|
|
||||||
sprintf(print_buffer, "restart forward...\r\n");
|
|
||||||
shell_write(print_buffer, strlen(print_buffer));
|
|
||||||
drive_ctrl_forward();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
sprintf(print_buffer, "collision detected while not driving 8(\r\n");
|
|
||||||
shell_write(print_buffer, strlen(print_buffer));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
sleep_ms(1);
|
sleep_ms(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user