Updated with defines of relay pins
This commit is contained in:
parent
d558b3552c
commit
fe83bc479a
20
src/main.c
20
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 <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
|
||||
#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);
|
||||
|
|
Loading…
Reference in New Issue