Мелкие исправления

This commit is contained in:
2022-12-03 01:22:43 +03:00
parent 2e4a560f74
commit 7bd6275bac
3 changed files with 22 additions and 17 deletions

View File

@@ -159,10 +159,10 @@ short can_move(struct barrel* bar) {
case ZONE_UNLOAD:
// последняя промывка, нужно разрешение на выгрузку
if (schedulerOneRobotMode) {
if (schedulerOneRobotMode && schedulerUnloadButton) {
// нужно промывку загрузку 0
if (!zone_is_busy(17)) {
return 17;
if (!zone_is_busy(ZONE_LOAD_1)) {
return ZONE_LOAD_1;
}
}
break;
@@ -305,8 +305,7 @@ void debug_print_robot1_code() {
break;
case ROBOT_CMD_TMR_SET:
printf(" set barrel timer %d secs\n", cmd_arg);
i++;
printf(" set barrel timer %d secs\n", robot1_code.code[++i]);
break;
case ROBOT_CMD_SET_LOCK_ZONE:
@@ -350,6 +349,7 @@ void schedule_robot_1() {
tasks[i].dest_zone = can_move(barrels + i);
}
// TODO добавить вставку lock-point'ов на задачах на несколько роботов
// найти подходящую задачу
if (schedulerOneRobotMode) {
short target_task = scheduler_find_task(tasks, robot1.dx.current_zone);
@@ -367,8 +367,11 @@ void schedule_robot_1() {
if (tasks[target_task].start_zone == 22) {
robot1_code.code[cmd_index++] = ROBOT_CMD_MOVE_OFF;
robot1_code.code[cmd_index++] = ROBOT_CMD_UP;
robot1_code.code[cmd_index++] = ROBOT_CMD_MOVE_TO_ZONE | 21;
robot1_code.code[cmd_index++] = ROBOT_CMD_MOVE_OFF;
if (robot1.dx.current_zone != 21) {
robot1_code.code[cmd_index++] = ROBOT_CMD_MOVE_TO_ZONE | 21;
robot1_code.code[cmd_index++] = ROBOT_CMD_MOVE_OFF;
}
robot1_code.code[cmd_index++] = ROBOT_CMD_DOWN_2;
robot1_code.code[cmd_index++] = ROBOT_CMD_MOVE_TO_ZONE | 22;
} else {
robot1_code.code[cmd_index++] = ROBOT_CMD_MOVE_TO_ZONE | tasks[target_task].start_zone;