Hi Anakin,
the relevant section is in main.c
[tt]
/////////////////////////////////////////////////////////////////////////////
// This function is called by MIOS when a complete MIDI event has been received
/////////////////////////////////////////////////////////////////////////////
void MPROC_NotifyReceivedEvnt(unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam
{
// check if note on or off event at channel 1 has been received
if( evnt0 == 0x80 || evnt0 == 0x90 ) {
// if note off event: force evnt2 to 0 for easier handling of ‘LED off’
if( evnt0 == 0x80 )
evnt2 = 0;
// number of DOUT pin in evnt1, value in evnt2
MIOS_DOUT_PinSet(evnt1, evnt2 ? 0x01 : 0x00);
// notify display handler in DISPLAY_Tick() that DOUT value has changed
last_dout_pin = evnt1;
app_flags.DISPLAY_UPDATE_REQ = 1;
}
}
[/tt]
So, at the moment, the DOUTs are controlled by sending MIDI-Messages.
You have to move the [tt]MIOS_DOUT_PinSet()[/tt] to the DIN-Section and adapt the numbers, e.g. by using a switch case.
[tt]
/////////////////////////////////////////////////////////////////////////////
// This function is called by MIOS when an button has been toggled
// pin_value is 1 when button released, and 0 when button pressed
/////////////////////////////////////////////////////////////////////////////
void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) __wparam
{
// a button has been pressed, send Note at channel 1
MIOS_MIDI_BeginStream();
MIOS_MIDI_TxBufferPut(0x90); // Note at channel 1
MIOS_MIDI_TxBufferPut(pin); // pin number corresponds to note number
MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // buttons are high-active
MIOS_MIDI_EndStream();
// your switch case here
// notify display handler in DISPLAY_Tick() that DIN value has changed
last_din_pin = pin;
app_flags.DISPLAY_UPDATE_REQ = 1;
}
[/tt]
Regards,
Michael