Mod to ISR and Tasks ok working

This commit is contained in:
Emanuele Trabattoni
2026-03-31 09:19:11 +02:00
parent ec138553ad
commit 27ad612844
5 changed files with 46 additions and 30 deletions

View File

@@ -9,6 +9,7 @@ void rtIgnitionTask(void *pvParameters)
LOG_ERROR("Null rt_task_ptr parameters");
vTaskDelete(NULL);
}
LOG_INFO("rtTask Params OK");
// Task Parameters and Devices
rtTaskParams *params = (rtTaskParams *)pvParameters;
@@ -47,6 +48,8 @@ void rtIgnitionTask(void *pvParameters)
.ign_stat = &ign_box_sts,
.rt_handle_ptr = rt_handle_ptr};
LOG_INFO("rtTask ISR Params OK");
// Attach Pin Interrupts
attachInterruptArg(rt_int.trig_pin_12p, rt_int.isr_ptr, (void *)&isr_params_t12p, RISING);
attachInterruptArg(rt_int.trig_pin_12n, rt_int.isr_ptr, (void *)&isr_params_t12n, RISING);
@@ -55,12 +58,15 @@ void rtIgnitionTask(void *pvParameters)
attachInterruptArg(rt_int.spark_pin_12, rt_int.isr_ptr, (void *)&isr_params_sp12, RISING);
attachInterruptArg(rt_int.spark_pin_34, rt_int.isr_ptr, (void *)&isr_params_sp34, RISING);
LOG_INFO("rtTask ISR Attach OK");
// Compute Reset Pin Bitmask
const uint16_t rst_bitmask = (1 << rt_rst.rst_io_12p) |
(1 << rt_rst.rst_io_12n) |
(1 << rt_rst.rst_io_34p) |
(1 << rt_rst.rst_io_34n);
LOG_WARN("rt Task Init Correct");
uint32_t it = 0;
uint32_t q_fail_count = 0;
while (params->rt_running)
@@ -72,7 +78,7 @@ void rtIgnitionTask(void *pvParameters)
#ifdef DEBUG
Serial.print("\033[2J"); // clear screen
Serial.print("\033[H"); // cursor home
LOG_INFO("Iteration [", it, "]");
LOG_INFO("Iteration [", it++, "]");
#endif
// WAIT FOR PICKUP SIGNAL