Skip to content

Commit

Permalink
Merge pull request #18 from anarkiwi/ffio
Browse files Browse the repository at this point in the history
Split MIDI read work between poll and parse.
  • Loading branch information
anarkiwi committed May 14, 2021
2 parents 67740aa + 904218f commit 3b12579
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,20 @@ NOTE: you will need to add the following to to WInterrupts.c:

void PIOC_Handler (void) __attribute__ ((weak));

On Linux this can be located with the following command.
On Linux, WInterrupts.c can be located with:

josh@vek-x:~$ find .arduino15 -name WInterrupts.c
$ find .arduino15/ -name WInterrupts.c | grep sam
.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/WInterrupts.c

If you will upgrade the IDE you will have to change this file again. Be careful
to change the WInterrupts.c file in the "sam" directory, NOT the "avr" directory.
You will also need to change Arduino's default optimization settings. Change
all references to -Os, to -O2, in platforms.txt.

On Linux, platforms.txt can be located with:

$ find .arduino15/ -name platform.txt | grep sam
.arduino15/packages/arduino/hardware/sam/1.6.12/platform.txt

If you will upgrade the IDE you will have to make these changes again.


Vesselmon
Expand Down
10 changes: 6 additions & 4 deletions vessel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void inline blink() {

class FakeSerial {
public:
void begin(int BaudRate) {
void begin(int BaudRate __attribute__((unused))) {
_pending = false;
}
inline __attribute__((always_inline))
Expand Down Expand Up @@ -204,7 +204,7 @@ inline void handleNoteOff(byte channel, byte note, byte velocity) {
}

inline void handleAfterTouchPoly(byte channel, byte note, byte pressure) {
NMI_COMMAND_SEND(3, channel, sendPolyPressure(note, pressure, channel))
NMI_COMMAND_SEND(3, channel, sendAfterTouch(note, pressure, channel))
}

inline void handleControlChange(byte channel, byte number, byte value) {
Expand Down Expand Up @@ -342,10 +342,12 @@ inline void drainInBuf() {
}

inline bool drainOutBuf() {
if (uartRxready()) {
fs.set(uartRead());
if (fs.available()) {
MIDI.read();
flagPin.write(LOW);
return true;
} else if (uartRxready()) {
fs.set(uartRead());
blink();
return true;
}
Expand Down

0 comments on commit 3b12579

Please sign in to comment.