Added oregon v2.1 support to ArduinoTellstick along with some code cleanup

Former-commit-id: d05ee71fa4f2f91afd6452e894385bbcd7020917
This commit is contained in:
Daniel Collin 2016-01-29 10:52:10 +01:00
parent c2d03347ca
commit 1c23a7c360
11 changed files with 391 additions and 116 deletions

View file

@ -1,7 +1,25 @@
#ifndef CONFIG_H
#define CONFIG_H
#define RX_PIN 7
#define TX_PIN 8
#include "Arduino.h"
/*
* RX PIN = 7
* TX PIN = 8
*/
inline void setupPins(){
pinMode(7, INPUT);
pinMode(8, OUTPUT);
};
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__)
//pin7 = PD7 = port D, bit 8
#define RX_PIN_READ() ( PIND & 0b00000001 ) // optimized "digitalRead(7)"
//pin8 = PB0 = port B, bit 1
#define TX_PIN_LOW() ( PORTB &= 0b01111111 ) // optimized "digitalWrite(8, LOW)"
#define TX_PIN_HIGH() ( PORTB |= 0b10000000 ) // optimized "digitalWrite(8, HIGH)"
#else
#unsupported architecture
#endif
#endif //CONFIG_H