From fe83bc479a198069d5e987422b4b709075504ee6 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Mon, 2 Sep 2024 11:34:13 -0700 Subject: [PATCH] Updated with defines of relay pins --- src/main.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 850d7ff..5816d94 100644 --- a/src/main.c +++ b/src/main.c @@ -16,6 +16,7 @@ #define __DELAY_BACKWARD_COMPATIBLE__ #include "RegEdit.h" +#include "Relays.h" #include "SuperLoop.h" #include "config.h" #include "timer.h" @@ -23,15 +24,26 @@ #include #include -#define RELAYPIN (1 << 7) -#define RELAYREADINGPIN \ - (1 << 6) // It would be better to use PA7 so USART worked +#define RELAY0_ENPIN (1 << 1) // PORTA +#define RELAY0_INPIN (1 << 3) // PORTA + +#define RELAY1_ENPIN (1 << 3) // PORTB +#define RELAY1_INPIN (1 << 2) // PORTA + +#define RELAY2_ENPIN (1 << 2) // PORTB +#define RELAY2_INPIN (1 << 0) // PORTB // Set the function pointer for the delay func void (*Delay_MicroSeconds)(double us) = _delay_us; - int main(int argc, char **argv) { + Relay relay_array[3]; + + // setup for the first relay + relay_array[0].output_port = PORTA.OUT; + relay_array[0].output_pin = RELAY0_ENPIN; + relay_array[0].input_port = PORTA.IN; + relay_array[0].input_pin = RELAY0_INPIN; // Setup for Infinite Loop SuperLoop_SetIterations(0);