Skip to content

Commit df83ba0

Browse files
author
Franck
committed
Correction of a bug in parameters control that was blocking the function 02 (double midi status filter) of the MSGFLTR pipe.
1 parent 6ff7d61 commit df83ba0

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

bin/umk4x4.stm32f103c8-64k-o2.bin

40 Bytes
Binary file not shown.

bin/umk4x4.stm32f103cb-128k-o3.bin

48 Bytes
Binary file not shown.
-32 Bytes
Binary file not shown.

mod_miditransfn_pipes.h

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,22 @@ const MidiTransFnVector_t MidiTransFnVector[FN_TRANSPIPE_VECTOR_SIZE] = {
181181
// --------------------------------
182182
boolean MidiTransFn_MessageFilter_CheckParms(transPipe_t *pipe)
183183
{
184-
if ( pipe->par1 > 1 ) return false;
184+
if ( pipe->par1 > 2 ) return false;
185185
if ( pipe->par1 < 2 && (pipe->par2 == 0 || pipe->par2 > 0B1111) ) return false;
186186
if ( pipe->par1 == 2 ) {
187-
if ( pipe->par2 > 1 ) return false;
188-
if ( pipe->par3 < 0x08 || pipe->par3 > 0x1F
189-
|| pipe->par3 == 0x10 || pipe->par3 == 0x14 || pipe->par3 == 0x15
190-
|| pipe->par3 == 0x17 || pipe->par3 == 0x19 || pipe->par3 == 0x1D ) return false;
191-
192-
if ( pipe->par4 != 0 && ( pipe->par4 < 0x08 || pipe->par4 > 0x1F
193-
|| pipe->par4 == 0x10 || pipe->par4 == 0x14 || pipe->par4 == 0x15
194-
|| pipe->par4 == 0x17 || pipe->par4 == 0x19 || pipe->par4 == 0x1D ) ) return false;
187+
if ( pipe->par2 > 1 ) return false;
188+
if ( pipe->par3 < 0x08 || pipe->par3 > 0x1F
189+
|| pipe->par3 == 0x10 || pipe->par3 == 0x14 || pipe->par3 == 0x15
190+
|| pipe->par3 == 0x17 || pipe->par3 == 0x19 || pipe->par3 == 0x1D ) {
191+
return false;
192+
}
193+
if ( pipe->par4 != 0 ) {
194+
if ( pipe->par4 < 0x08 || pipe->par4 > 0x1F
195+
|| pipe->par4 == 0x10 || pipe->par4 == 0x14 || pipe->par4 == 0x15
196+
|| pipe->par4 == 0x17 || pipe->par4 == 0x19 || pipe->par4 == 0x1D ) {
197+
return false;
198+
}
199+
}
195200
}
196201
return true;
197202
}
@@ -224,9 +229,11 @@ boolean MidiTransFn_MessageFilter(uint8_t portType, midiPacket_t *pk, transPipe_
224229
// Midi Status double filter
225230
else if ( pipe->par1 == 2 ) {
226231
uint8_t midiStatus = ( pk->packet[1] >= 0xF0 ? pk->packet[1] - 0xE0 : pk->packet[1]>>4 ) ;
227-
if ( midiStatus == pipe->par3 || midiStatus == pipe->par4 )
232+
if ( midiStatus == pipe->par3 || midiStatus == pipe->par4 ) {
228233
return (pipe->par2 == 0 ? true : false ); //Keep or drop...
229-
else return true;
234+
} else {
235+
return (pipe->par2 == 0 ? false : true); //Keep or drop...
236+
}
230237
}
231238
else
232239
return false; // Error

0 commit comments

Comments
 (0)