Test working at 100Khz

This commit is contained in:
Emanuele Trabattoni
2026-04-01 11:43:44 +02:00
parent 21e50bdca8
commit d7e0990e36
3 changed files with 167 additions and 87 deletions

View File

@@ -6,4 +6,35 @@
#include "driver/gpio.h"
void IRAM_ATTR onTimer(void* arg);
enum State
{
S_12P,
S_12N_DELAY,
S_12N,
S_WAIT_10MS,
S_34P,
S_34N_DELAY,
S_34N,
S_WAIT_1MS,
S_WAIT_10MS_END
};
struct timerStatus
{
State state = State::S_12P;
uint32_t state_time = 0;
uint32_t clock_period_us;
uint32_t pause_long_us;
uint32_t pause_short_us;
uint32_t coil_pulse_us;
uint32_t spark_pulse_us;
uint32_t spark_delay_us;
bool soft_start = false;
bool coil12p_high = false;
bool coil34p_high = false;
bool coil12n_high = false;
bool coil34n_high = false;
TaskHandle_t main_task;
};
void IRAM_ATTR onTimer(void *arg);