From 5f2bbc4d21f087b6083a203e4c6d06e00fe4cc4e Mon Sep 17 00:00:00 2001 From: VladislavOstapov Date: Mon, 5 Dec 2022 11:56:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BB=D0=B8=D1=8F=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=B4=D0=B0=20=D0=B8=D0=B7=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=9F=D0=9B?= =?UTF-8?q?=D0=9A=20=D1=81=20=D1=8D=D1=82=D0=B8=D0=BC=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scheduler.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scheduler.c b/scheduler.c index 32c672d..575e8ef 100644 --- a/scheduler.c +++ b/scheduler.c @@ -1,8 +1,10 @@ +#ifdef EMULATOR #include #include #include "emulator.h" - short etching_zone = 0, galvanizing_zone = 0; +#endif + char zone_is_busy(short zone) { for (short i = 0; i < 10; i++) { @@ -40,9 +42,11 @@ short can_move(struct barrel* bar) { return -2; } +#ifdef EMULATOR if (!schedulerOneRobotMode) { printf("WARMING: нет проверки того, что для перемещения барабана не мешает второй робот\n"); } +#endif // дальше нужно проверить, что можно передвигать бочку @@ -339,7 +343,7 @@ static short scheduler_find_task(struct scheduler_task* tasks, const short curr_ } } - +#ifdef EMULATOR void debug_print_robot1_code() { // printf("INFO: code length is %d\n", cmd_index); printf("Code for R0, B%d:\n", robot1_code.barrel_id); @@ -412,6 +416,7 @@ void debug_print_robot1_code() { } } } +#endif void create_operation(const short target_task, const struct scheduler_task* tasks, struct robot_code* code, const short current_zone) { @@ -574,7 +579,9 @@ void create_operation(const short target_task, const struct scheduler_task* task code->code[cmd_index++] = ROBOT_CMD_END(); code->PC = 0; +#ifdef EMULATOR printf("INFO: code length is %d\n", cmd_index); +#endif } @@ -599,7 +606,10 @@ void schedule_robot_1() { if (target_task >= 0) { create_operation(target_task, tasks, &robot1_code, robot1.dx.current_zone); + +#ifdef EMULATOR debug_print_robot1_code(); +#endif } } else { printf("WARMING: support only one robot mode\n");