Improved task code

This commit is contained in:
Emanuele Trabattoni
2026-04-07 10:51:53 +02:00
parent dc44decd64
commit f36cb96f21
4 changed files with 46 additions and 84 deletions

View File

@@ -26,10 +26,9 @@ static const uint32_t TRIG_FLAG_12N = (1 << 1);
static const uint32_t TRIG_FLAG_34P = (1 << 2);
static const uint32_t TRIG_FLAG_34N = (1 << 3);
static const uint32_t SPARK_FLAG_NIL = (1 << 8);
static const uint32_t SPARK_FLAG_TIMEOUT = (1 << 8);
static const uint32_t SPARK_FLAG_12 = (1 << 9);
static const uint32_t SPARK_FLAG_34 = (1 << 10);
static const uint32_t SPARK_FLAG_TIMEOUT = (1 << 11);
// Spark Status
enum sparkStatus
@@ -78,15 +77,15 @@ struct coilsStatus
{
int64_t trig_time = 0;
int64_t spark_time = 0;
int64_t spark_delay = 0; // in microseconds
uint32_t spark_delay = 0; // in microseconds
sparkStatus spark_status = sparkStatus::SPARK_POS_OK;
softStartStatus sstart_status = softStartStatus::NORMAL;
float peak_p_in = 0.0, peak_n_in = 0.0;
float peak_p_out = 0.0, peak_n_out = 0.0;
float trigger_spark = 0.0;
bool spark_ok = false;
float peak_p_in = 0.0;
float peak_n_in = 0.0;
float peak_p_out = 0.0;
float peak_n_out = 0.0;
float level_spark = 0.0;
uint32_t n_events = 0;
};
// Task internal Status
@@ -98,6 +97,9 @@ struct ignitionBoxStatus
coilsStatus coils34;
// voltage from generator
float volts_gen = 0.0;
// enine rpm
uint32_t eng_rpm = 0;
// debug values
uint32_t n_queue_errors = 0;
uint32_t adc_read_time = 0;
};