Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 comments
  • 1 contributor
Dec 01, 2011
Werner Almesberger softusb: don't forget notifying the host when there are news from MIDI
The host interrupt wasn't asserted when enqueuing MIDI messages.
No surprise some controls acted strangely ...
dbcce91
Werner Almesberger softusb: accept everything but non-MIDI and system messages
This patch removes the limitation to control change messages. We can
now also have "piano" notes and so on.
58daf4c

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. 9  softusb-input/main.c
9  softusb-input/main.c
@@ -485,6 +485,7 @@ static char process_midi(unsigned char *buf, unsigned char len)
485 485
 {
486 486
 	unsigned char end = len & ~3;
487 487
 	unsigned char i, m, j;
  488
+	char sent_something = 0;
488 489
 
489 490
 	/*
490 491
 	 * In theory, control changes should be heralded by a CIN of 0xB,
@@ -496,14 +497,18 @@ static char process_midi(unsigned char *buf, unsigned char len)
496 497
 	 */
497 498
 	
498 499
 	for(i = 0; i != end; i += 4) {
499  
-		if((buf[i+1] & 0xf0) != 0xb0) /* not a control change */
  500
+		unsigned char type = buf[i+1] & 0xf0;
  501
+
  502
+		/* ignore non-MIDI and all system messages */
  503
+		if(type < 0x80 || type == 0xf0)
500 504
 			continue;
501 505
 		m = COMLOC_MIDI_PRODUCE;
502 506
 		for(j = 0; j != 4; j++)
503 507
 			COMLOC_MIDI(4*m+j) = buf[i+j];
504 508
 		COMLOC_MIDI_PRODUCE = (m + 1) & 15;
  509
+		sent_something = 1;
505 510
 	}
506  
-	return 0;
  511
+	return sent_something;
507 512
 }
508 513
 
509 514
 static void poll(struct ep_status *ep,

No commit comments for this range

Something went wrong with that request. Please try again.