diff options
| author | Donald Delmar Davis <don@suspectdevices.com> | 2013-10-16 13:41:44 -0700 |
|---|---|---|
| committer | Donald Delmar Davis <don@suspectdevices.com> | 2013-10-16 13:41:44 -0700 |
| commit | 75b82aba6cc6cfd4603d3234f46f5e424f7b7b1b (patch) | |
| tree | 2cb4991a7572829715d4bdc63a3d600cca409473 | |
| parent | 774ce66acf8026e18cfc1c04c1239ee6864cb59f (diff) | |
Missed the main.c file
| -rw-r--r-- | README.md | 4 | ||||
| -rwxr-xr-x | main.c | 55 |
2 files changed, 57 insertions, 2 deletions
@@ -1,5 +1,5 @@ #Overview -The idea here is to create a lufa based midi framework for use on the stock usb capable arduino. The goal is twofold: +The idea here is to create a lufa based midi framework for use on the stock usb capable arduino and other atmega32u4 boards. The goal is twofold: 1. to isolate the lower level usb functions from the actual programs @@ -46,7 +46,7 @@ A minimal sysex handler, called by either the maintainence tasks or by MidiEvent This handler should also buffer sysex's that are not directed at the target. ###Hardware Abstractions. -Some of the work involved with the LUFA library is to provide feedback for the states of the the usb connection itself. This requires a hardware abstraction for each board supported by the library. In our use case this would better be served by providing weak functions to be overridden user functions. +Some of the work involved with the LUFA library is to provide feedback for the states of the the usb connection itself. This requires a hardware abstraction for each board supported by the library. In our use case this would better be served by providing weak functions to be overridden by user functions. @@ -0,0 +1,55 @@ +/* + + + */ + +#include "USBMidiTransport.h" +#include <util/delay.h> + +/** LUFA MIDI Class driver interface configuration and state information. This structure is + * passed to all MIDI Class driver functions, so that multiple instances of the same class + * within a device can be differentiated from one another. + */ + +volatile uint8_t myMidiChannel=DEFAULT_MIDI_CHANNEL; +volatile uint8_t myMidiDevice=DEFAULT_MIDI_DEVICE; +volatile uint8_t myMidiCable=DEFAULT_MIDI_CABLE; +volatile uint8_t myMidiID[]={ARDUINO_MMA_VENDOR_1 ,ARDUINO_MMA_VENDOR_2,ARDUINO_MMA_VENDOR_3}; +volatile uint8_t mySysexBuffer[MAX_SYSEX_SIZE]; +volatile uint8_t mySysexBufferIndex; + +/** Main program entry point. This routine contains the overall program flow, including initial + * setup of all components and the main program loop. + */ +void initBlinkingLights(void); +void initBlinkingLights(void){ +// DDRB=0xff; + PORTB=0x0f; + _delay_ms(1000) ; + PORTB=0xf0; + _delay_ms(1500) ; + PORTB=0x0f; + _delay_ms(1000) ; + PORTB=0xcc; + _delay_ms(1500) ; + PORTB=0xff; + _delay_ms(1000) ; + PORTB=0x00; + _delay_ms(1500) ; + + +} + +int main(void) +{ DDRB=0xff; +InitializeUSBMidi(); + + InitializeUSBMidi(); + + for (;;) + { initBlinkingLights(); + + USBMidiEventAvailable(); + } +} + |
