@@ -43,7 +43,7 @@ Thread::Thread() {
4343 { // Entry definition: (TargetState, GuardFunction, ActionFunction, Injection)
4444 { State::OFF, {}, actionRotationStop (), {} },
4545 { State::INIT, {}, actionRotationStart (), {} },
46- { State::CRC_CAL, {}, actionCRCStart (), {} },
46+ // { State::CRC_CAL, {}, actionCRCStart(), {} },
4747 },
4848 { // Transition definition: (CurrentState, Event, NextState, GuardFunction, ActionFunction, Injection)
4949 { State::OFF, Event::START, State::R0, {}, actionRotationStart (), {} },
@@ -54,7 +54,7 @@ Thread::Thread() {
5454 { State::R3, Event::TASK_DONE, State::R4, {}, actionRotate (), {3 } },
5555 { State::R4, Event::TASK_DONE, State::R1, {}, actionRotate (), {4 } },
5656 { State::R1, Event::STOP, State::OFF, {}, actionRotationStop (), {} },
57- { State::CRC_CAL, Event::TASK_DONE, State::OFF, {}, actionCRCStop (), {} },
57+ // { State::CRC_CAL, Event::TASK_DONE, State::OFF, {}, actionCRCStop(), {} },
5858 },
5959 { // Anonymous transition definition: (CurrentState, NextState, GuardFunction, ActionFunction, Injection)
6060 { State::R0, State::R1, {}, [](){serial.sendString (" auto\n " );}, {} },
@@ -78,16 +78,16 @@ void Thread::init() {
7878 }
7979}
8080Action Thread::actionSystemInit () {
81- return [this ]() { xTaskCreate (task<&Thread::init>, " system init" , 1100 , this , 6 , &init_handle); };
81+ return [this ]() { xTaskCreate (task<&Thread::init>, " system init" , 1000 , this , 6 , &init_handle); };
8282}
8383Action Thread::actionSystemRun () {
8484 return [this ]() {
85- xTaskCreate (task<&Thread::serialTX>, " serial send tx" , 100 , this , 1 , &serial_handle);
86- xTaskCreate (task<&Thread::parse>, " cli parsing" , 420 , this , 2 , &parse_handle);
87- xTaskCreate (task<&Thread::schedule_20Hz>, " schedule 20Hz" , 64 , this , 5 , &schedule_20Hz_handle);
88- xTaskCreate (task<&Thread::telemetry>, " telemetry" , 400 , this , 3 , &telemetry_handle);
85+ xTaskCreate (task<&Thread::serialTX>, " serial send tx" , 100 , this , 3 , &serial_handle);
86+ xTaskCreate (task<&Thread::parse>, " cli parsing" , 1100 , this , 6 , &parse_handle);
87+ xTaskCreate (task<&Thread::schedule_20Hz>, " schedule 20Hz" , 64 , this , 2 , &schedule_20Hz_handle);
88+ xTaskCreate (task<&Thread::telemetry>, " telemetry" , 400 , this , 2 , &telemetry_handle);
8989 vTaskSuspend (telemetry_handle);
90- xTaskCreate (task<&Thread::runner>, " task simulation" , 420 , this , 3 , &runner_handle);
90+ xTaskCreate (task<&Thread::runner>, " task simulation" , 200 , this , 3 , &runner_handle);
9191 vTaskSuspend (runner_handle);
9292 // xTaskCreate(task<&Thread::calculator>, "calculator", 200, this, 5, &calculator_handle);
9393 // vTaskSuspend(calculator_handle);
@@ -229,26 +229,26 @@ void Thread::flashLoad() {
229229 }
230230}
231231
232- void Thread::calculator () {
233- while (1 ) {
234- // get std::vector<uint8> input from injection
235- std::vector<uint8_t > input = std::any_cast<std::vector<uint8_t >>(runner_sm.injections [0 ]);
236- crc.setPolynomial (0x9B , 8 );
237- crc.setInitValue (0x00 );
238- auto result = crc.calculate (input.data (), 2 );
239- serial.sendString (" CRC Result: " );
240- serial.sendNumber (result);
241- serial.sendLn ();
242- SM<Thread>::triggerEvent (Event::TASK_DONE, runner_sm);
243- }
244- }
245- Action Thread::actionCRCStart () {
246- return [this ]() {
247- BaseType_t xYieldRequired = pdTRUE;
248- xTaskResumeFromISR (calculator_handle);
249- portYIELD_FROM_ISR (xYieldRequired);
250- };
251- }
252- Action Thread::actionCRCStop () {
253- return [this ]() { vTaskSuspend (calculator_handle); };
254- }
232+ // void Thread::calculator() {
233+ // while (1) {
234+ // // get std::vector<uint8> input from injection
235+ // std::vector<uint8_t> input = std::any_cast<std::vector<uint8_t>>(runner_sm.injections[0]);
236+ // crc.setPolynomial(0x9B, 8);
237+ // crc.setInitValue(0x00);
238+ // auto result = crc.calculate(input.data(), 2);
239+ // serial.sendString("CRC Result: ");
240+ // serial.sendNumber(result);
241+ // serial.sendLn();
242+ // SM<Thread>::triggerEvent(Event::TASK_DONE, runner_sm);
243+ // }
244+ // }
245+ // Action Thread::actionCRCStart() {
246+ // return [this]() {
247+ // BaseType_t xYieldRequired = pdTRUE;
248+ // xTaskResumeFromISR(calculator_handle);
249+ // portYIELD_FROM_ISR(xYieldRequired);
250+ // };
251+ // }
252+ // Action Thread::actionCRCStop() {
253+ // return [this]() { vTaskSuspend(calculator_handle); };
254+ // }
0 commit comments