Changeset 51441425 in rtems


Ignore:
Timestamp:
Dec 5, 2011, 3:21:50 PM (7 years ago)
Author:
Gedare Bloom <gedare@…>
Branches:
4.11, master
Children:
96d29be
Parents:
df4669f
Message:

2011-12-05 Sebastien Bourdeauducq <seb@…>

  • milkymist_midi/midi.c: move MIDI message detection from higher layers to the MIDI interrupt handler
Location:
c/src/lib/libbsp/lm32/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/lm32/shared/ChangeLog

    rdf4669f r51441425  
     12011-12-05      Sebastien Bourdeauducq <seb@tmplab.org>
     2
     3        * milkymist_midi/midi.c: move MIDI message detection from higher layers
     4        to the MIDI interrupt handler
     5
    162011-11-27      Sebastien Bourdeauducq <seb@tmplab.org>
    27
  • c/src/lib/libbsp/lm32/shared/milkymist_midi/midi.c

    rdf4669f r51441425  
    2727
    2828static rtems_id midi_q;
     29static unsigned char *midi_p = NULL;
     30static unsigned char midi_msg[3];
    2931
    3032static rtems_isr interrupt_handler(rtems_vector_number n)
     
    3537    msg = MM_READ(MM_MIDI_RXTX);
    3638    MM_WRITE(MM_MIDI_STAT, MIDI_STAT_RX_EVT);
    37     rtems_message_queue_send(midi_q, &msg, 1);
     39
     40    if ((msg & 0xf8) == 0xf8)
     41      continue; /* ignore system real-time */
     42
     43    if (msg & 0x80)
     44      midi_p = midi_msg; /* status byte */
     45
     46    if (!midi_p)
     47      continue; /* ignore extra or unsynchronized data */
     48
     49    *midi_p++ = msg;
     50
     51    if (midi_p == midi_msg+3) {
     52      /* received a complete MIDI message */
     53      rtems_message_queue_send(midi_q, midi_msg, 3);
     54      midi_p = NULL;
     55    }
    3856  }
    3957  lm32_interrupt_ack(1 << MM_IRQ_MIDI);
     
    5472 sc = rtems_message_queue_create(
    5573    rtems_build_name('M', 'I', 'D', 'I'),
    56     64,
    57     1,
     74    32,
     75    3,
    5876    0,
    5977    &midi_q
Note: See TracChangeset for help on using the changeset viewer.