#ifndef _HARDWARE_H #define _HARDWARE_H #define F_CPU 8000000UL #define RELAYREG0 DDRC #define RELAYREG1 DDRA #define RELAYPORT0 PORTC #define RELAYPORT1 PORTA #define SW_REG DDRB #define SW_PIN PINB #define SW_PORT PORTB #define SWITCH PB3 #define LED_REG DDRB #define LED_PORT PORTB #define LED_RED PB7 #define LED_GRN PB5 #define LED_BLU PB6 #define USB_BAUD_RATE 125000UL //125kHz Non-standard baud rate, for a non-standard device ;) #define MIDI_BAUD_RATE 31250 //Standard midi-baud 0% error with 20Mhz crystal #define UART_BAUD_SELECT(baudRate,xtalCpu) ((xtalCpu)/((baudRate)*16l)-1) #define DEBOUNCE_COUNT 500 void hardwareInit() { //Set Registers A and C to output. RELAYREG0 |= 0xFF; RELAYREG1 |= 0xFF; //Set PB3 as input (unnecessary, just for peace of mind), enable pull-up (necessary) SW_REG &= ~(1<