Added the setup of the DDR for the relay.

This commit is contained in:
jakeg00dwin 2024-09-03 16:45:45 -07:00
parent e3cd70448b
commit 9e41bdc578
1 changed files with 4 additions and 0 deletions

View File

@ -45,6 +45,10 @@ void setup_relays(Relay *arr) {
arr[0].input_port = &PORTA.IN;
arr[0].input_pin = RELAY0_INPIN;
// Set the directions for the input and output pins/ports
PORTA.DDR |= RELAY0_ENPIN;
PORTA.DDR &= ~RELAY1_ENPIN;
for (int i = 0; i < N_RELAYS; i++) {
Relay_MeasureMakeTime(&arr[0]);
Relay_MeasureBreakTime(&arr[0]);