Fixed pin mappings and task logic
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
#include <SPI.h>
|
||||
|
||||
// Definitions
|
||||
#include <isr.h>
|
||||
#include <pins.h>
|
||||
#include <channels.h>
|
||||
#include <tasks.h>
|
||||
@@ -31,7 +30,7 @@ void setup() {
|
||||
LOG_INFO("ESP32 Heap:", ESP.getHeapSize());
|
||||
LOG_INFO("ESP32 Sketch:", ESP.getFreeSketchSpace());
|
||||
|
||||
// Initialize Interrupt pins on peak detectors
|
||||
// Initialize Interrupt pins on coil detectors
|
||||
pinMode(TRIG_A12P, INPUT_PULLDOWN);
|
||||
pinMode(TRIG_A12N, INPUT_PULLDOWN);
|
||||
pinMode(TRIG_A34P, INPUT_PULLDOWN);
|
||||
@@ -40,17 +39,29 @@ void setup() {
|
||||
pinMode(TRIG_B12N, INPUT_PULLDOWN);
|
||||
pinMode(TRIG_B34P, INPUT_PULLDOWN);
|
||||
pinMode(TRIG_B34N, INPUT_PULLDOWN);
|
||||
initTriggerPinMapping();
|
||||
|
||||
// Initialize Interrupt pins on spark detectors
|
||||
pinMode(SPARK_A12, INPUT_PULLDOWN);
|
||||
pinMode(SPARK_A34, INPUT_PULLDOWN);
|
||||
pinMode(SPARK_B12, INPUT_PULLDOWN);
|
||||
pinMode(SPARK_B34, INPUT_PULLDOWN);
|
||||
initSparkPinMapping();
|
||||
|
||||
// Ignition A Interrupts
|
||||
attachInterrupt(TRIG_A12P, trig_isr_a, RISING);
|
||||
attachInterrupt(TRIG_A34P, trig_isr_a, RISING);
|
||||
attachInterrupt(TRIG_A12N, trig_isr_a, RISING);
|
||||
attachInterrupt(TRIG_A34N, trig_isr_a, RISING);
|
||||
attachInterrupt(SPARK_A12, spark_a, RISING);
|
||||
attachInterrupt(SPARK_A34, spark_a, RISING);
|
||||
// Ignition B Interrupts
|
||||
attachInterrupt(TRIG_B12P, trig_isr_b, RISING);
|
||||
attachInterrupt(TRIG_B34P, trig_isr_b, RISING);
|
||||
attachInterrupt(TRIG_B12N, trig_isr_b, RISING);
|
||||
attachInterrupt(TRIG_B34N, trig_isr_b, RISING);
|
||||
attachInterrupt(SPARK_B12, spark_b, RISING);
|
||||
attachInterrupt(SPARK_B34, spark_b, RISING);
|
||||
|
||||
// Init SPI interface
|
||||
SPI.begin();
|
||||
|
||||
Reference in New Issue
Block a user