The following code works fine for MIDI but causes a problem when i want another program to be running and then listen when MIDI starts talking:
so with very little knowledge i have tried adjusting the code with the setintflags:
I was hoping that on every message sent the interrupt would get fired, however, those more knowledgeable than myself can probably already see the issues. Rather than receiving the whole MIDI message you receive parts of it and eventually it becomes completely corrupt. I am guessing this has something to do with the pointers changing between running the main program and running the interrupt. The Do...loop obviously keeps them synced on the first piece of code but the second fails as it is removed. An answer would be to leave the do..loop in but i need to find a way of knowing when to escape the loop otherwise the interrupt is pointless.
So the short question is, how can i get an interrupt that captures the full midi message?
Code:
#picaxe 40X1
HserSetup B31250_4, %001
Do
If ptr <> hSerPtr Then
b0 = @ptrInc
b1 = b0 / $10 + "0" : If b1 > "9" Then : b1 = b1 + 7 : End If
b2 = b0 & $0F + "0" : If b2 > "9" Then : b2 = b2 + 7 : End If
SerTxd( "Got $", b1, b2, " ", #b0, CR, LF )
End If
Loop
so with very little knowledge i have tried adjusting the code with the setintflags:
Code:
#picaxe 40X1
HserSetup B31250_4, %001
setintflags %00100000,%00100000
main:
high portc 5
pause 300
low portc 5
pause 300
goto main
interrupt:
'Do
If ptr <> hSerPtr Then
b0 = @ptrInc
b1 = b0 / $10 + "0" : If b1 > "9" Then : b1 = b1 + 7 : End If
b2 = b0 & $0F + "0" : If b2 > "9" Then : b2 = b2 + 7 : End If
SerTxd( "Got $", b1, b2, " ", #b0, CR, LF )
End If
'Loop
HserSetup B31250_4, %001
setintflags %00100000,%00100000
return
So the short question is, how can i get an interrupt that captures the full midi message?