From cbc941282074856fc6179761b70a0c9879b0b64d Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Tue, 11 Oct 2011 21:56:36 +0200 Subject: update firmware to @319 --- firmware/common.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'firmware/common.h') diff --git a/firmware/common.h b/firmware/common.h index 3229718..11716fb 100644 --- a/firmware/common.h +++ b/firmware/common.h @@ -31,32 +31,46 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef COMMON_H +#define COMMON_H + +#include +#include enum signals {PIN_NONE,PIN_IN,PIN_OUT,PIN_TRI, PIN_AD,PIN_RX,PIN_TX, PIN_SS,PIN_SCK,PIN_MISO,PIN_MOSI, PIN_SCL,PIN_SDA,PIN_PWM, - PIN_UART}; + PIN_UART,PIN_CAN}; +#ifdef __AVR_AT90CAN128__ + #define OCTOPUS_CAN +#endif -#define OCTOPUS_CAN +//#define OCTOPUS_RELAIS -//#define DEBUG +#define DEBUG 1 #define F_CPU 16000000UL #define STATUS_LED_PIN PB7 #define STATUS_LED_PORT PORTB /* red status led */ +#ifndef OCTOPUS_RELAIS #define STATUS_LED_on (STATUS_LED_PORT |= (1 << STATUS_LED_PIN)) #define STATUS_LED_off (STATUS_LED_PORT &= ~(1 << STATUS_LED_PIN)) +#else +#define STATUS_LED_on (1); +#define STATUS_LED_off (1); +#endif volatile struct octopus_t { volatile unsigned char latency_timer; - int ports[45]; + volatile unsigned char status_led; + uint8_t ports[43]; volatile char * msg[20]; volatile int datatogl; volatile unsigned int long_rx_cmd; @@ -71,7 +85,7 @@ volatile struct octopus_t void CommandAnswer(unsigned int length); -void CommandAnswerRest(void); +void CommandAnswerRest (void); void USBCommandRX(char *buf); void USBMessageIn(char *buf); @@ -91,3 +105,4 @@ void common_init(void); void common_hwdesc(void); +#endif //COMMON_H -- cgit v1.2.1