Backport: Integrate hitchhikr changes to usb midi support.

The driver together with the source code is here:
https://hitchhikr.net/usbmidi.lha
This commit is contained in:
deadwood 2024-02-21 09:39:20 +01:00
parent d2acaabc07
commit 699d9231d5
3 changed files with 11 additions and 4 deletions

View File

@ -559,7 +559,7 @@ void nParseMidiOut(struct NepClassHid *nch)
break;
}
len -= 3;
*out++ = cmd|chan;
*out++ = (cmd >> 4) | chan;
*out++ = cmd;
ca->ca_TXReadPos = (ca->ca_TXReadPos+1) & mask;
*out++ = buf[ca->ca_TXReadPos];
@ -577,7 +577,7 @@ void nParseMidiOut(struct NepClassHid *nch)
break;
}
len -= 2;
*out++ = cmd|chan;
*out++ = (cmd >> 4) | chan;
*out++ = cmd;
ca->ca_TXReadPos = (ca->ca_TXReadPos+1) & mask;
*out++ = buf[ca->ca_TXReadPos];
@ -707,7 +707,10 @@ void nParseMidiOut(struct NepClassHid *nch)
if(ca->ca_SysExNum == 3)
{
KPRINTF(1, ("Cont 3B SysEx %06lx\n", ca->ca_SysExData));
*((ULONG *) out) = ((0x4|chan)<<24)|ca->ca_SysExData;
*out++ = 0x4|chan;
*out++ = (ca->ca_SysExData >> 16) & 0xff;
*out++ = (ca->ca_SysExData >> 8) & 0xff;
*out++ = ca->ca_SysExData & 0xff;
goodpkt++;
ca->ca_SysExData = 0;
ca->ca_SysExNum = 0;

View File

@ -1,5 +1,5 @@
##begin config
version 4.4
version 4.5
libbase nh
libbasetype struct NepHidBase
libbasetypeextern struct Library

View File

@ -154,6 +154,9 @@ ULONG Transmit_Status(struct DriverData *driverdata){
}else{
#if 0
/* hitchhikr: this part should be removed (or reworked) as it forbids to send several notes
in the same transfer (like chords) */
if(driverdata->status==ret){
if(len>1){
driverdata->transmitfunc=Transmit_Datas;
@ -164,6 +167,7 @@ ULONG Transmit_Status(struct DriverData *driverdata){
}
return buf[BUF1];
}
#endif
driverdata->status=ret;
driverdata->transmitfunc=Transmit_Datas;