stage4/generate_cc/generate_cc_sfc.cc
changeset 41 8998c8b24b60
parent 22 08bcc40be1fa
child 45 3b6bf2b5f1df
equal deleted inserted replaced
40:873a5b60a7ea 41:8998c8b24b60
   781       print_variable_prefix();
   781       print_variable_prefix();
   782       s4o.print("step_list[i].state) {\n");
   782       s4o.print("step_list[i].state) {\n");
   783       s4o.indent_right();
   783       s4o.indent_right();
   784       s4o.print(s4o.indent_spaces);
   784       s4o.print(s4o.indent_spaces);
   785       print_variable_prefix();
   785       print_variable_prefix();
   786       s4o.print("step_list[i].elapsed_time = __add_timespec(");
   786       s4o.print("step_list[i].elapsed_time = __time_add(");
   787       print_variable_prefix();
   787       print_variable_prefix();
   788       s4o.print("step_list[i].elapsed_time, PERIOD);\n");
   788       s4o.print("step_list[i].elapsed_time, PERIOD);\n");
   789       s4o.indent_left();
   789       s4o.indent_left();
   790       s4o.print(s4o.indent_spaces + "}\n");
   790       s4o.print(s4o.indent_spaces + "}\n");
   791       s4o.indent_left();
   791       s4o.indent_left();
   806       s4o.print(s4o.indent_spaces);
   806       s4o.print(s4o.indent_spaces);
   807       print_variable_prefix();
   807       print_variable_prefix();
   808       s4o.print("action_list[i].reset = 0;\n");
   808       s4o.print("action_list[i].reset = 0;\n");
   809       s4o.print(s4o.indent_spaces + "if (");
   809       s4o.print(s4o.indent_spaces + "if (");
   810       print_variable_prefix();
   810       print_variable_prefix();
   811       s4o.print("__compare_timespec(>, action_list[i].set_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) {\n");
   811       s4o.print("__gt_TIME(action_list[i].set_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) {\n");
   812       s4o.indent_right();
   812       s4o.indent_right();
   813       s4o.print(s4o.indent_spaces);
   813       s4o.print(s4o.indent_spaces);
   814       print_variable_prefix();
   814       print_variable_prefix();
   815       s4o.print("action_list[i].set_remaining_time = __sub_timespec(");
   815       s4o.print("action_list[i].set_remaining_time = __time_sub(");
   816       print_variable_prefix();
   816       print_variable_prefix();
   817       s4o.print("action_list[i].set_remaining_time, PERIOD);\n");
   817       s4o.print("action_list[i].set_remaining_time, PERIOD);\n");
   818       s4o.print(s4o.indent_spaces + "if (");
   818       s4o.print(s4o.indent_spaces + "if (");
   819       print_variable_prefix();
   819       print_variable_prefix();
   820       s4o.print("__compare_timespec(<=, action_list[i].set_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) {\n");
   820       s4o.print("__le_TIME(action_list[i].set_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) {\n");
   821       s4o.indent_right();
   821       s4o.indent_right();
   822       s4o.print(s4o.indent_spaces);
   822       s4o.print(s4o.indent_spaces);
   823       print_variable_prefix();
   823       print_variable_prefix();
   824       s4o.print("action_list[i].set_remaining_time = __time_to_timespec(1, 0, 0, 0, 0, 0);\n");
   824       s4o.print("action_list[i].set_remaining_time = __time_to_timespec(1, 0, 0, 0, 0, 0);\n");
   825       s4o.print(s4o.indent_spaces);
   825       s4o.print(s4o.indent_spaces);
   829       s4o.print(s4o.indent_spaces + "}\n");
   829       s4o.print(s4o.indent_spaces + "}\n");
   830       s4o.indent_left();
   830       s4o.indent_left();
   831       s4o.print(s4o.indent_spaces + "}\n");
   831       s4o.print(s4o.indent_spaces + "}\n");
   832       s4o.print(s4o.indent_spaces + "if (");
   832       s4o.print(s4o.indent_spaces + "if (");
   833       print_variable_prefix();
   833       print_variable_prefix();
   834       s4o.print("__compare_timespec(>, action_list[i].reset_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) {\n");
   834       s4o.print("__gt_TIME(action_list[i].reset_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) {\n");
   835       s4o.indent_right();
   835       s4o.indent_right();
   836       s4o.print(s4o.indent_spaces);
   836       s4o.print(s4o.indent_spaces);
   837       print_variable_prefix();
   837       print_variable_prefix();
   838       s4o.print("action_list[i].reset_remaining_time = __sub_timespec(");
   838       s4o.print("action_list[i].reset_remaining_time = __time_sub(");
   839       print_variable_prefix();
   839       print_variable_prefix();
   840       s4o.print("action_list[i].reset_remaining_time, PERIOD);\n");
   840       s4o.print("action_list[i].reset_remaining_time, PERIOD);\n");
   841       s4o.print(s4o.indent_spaces + "if (");
   841       s4o.print(s4o.indent_spaces + "if (");
   842       print_variable_prefix();
   842       print_variable_prefix();
   843       s4o.print("__compare_timespec(<=, action_list[i].reset_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) {\n");
   843       s4o.print("__le_TIME(action_list[i].reset_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) {\n");
   844       s4o.indent_right();
   844       s4o.indent_right();
   845       s4o.print(s4o.indent_spaces);
   845       s4o.print(s4o.indent_spaces);
   846       print_variable_prefix();
   846       print_variable_prefix();
   847       s4o.print("action_list[i].reset_remaining_time = __time_to_timespec(1, 0, 0, 0, 0, 0);\n");
   847       s4o.print("action_list[i].reset_remaining_time = __time_to_timespec(1, 0, 0, 0, 0, 0);\n");
   848       s4o.print(s4o.indent_spaces);
   848       s4o.print(s4o.indent_spaces);