Subversion Repositories svn.mios32

Rev

Rev 1391 | Rev 1675 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1391 Rev 1421
Line 1... Line 1...
1
// $Id: seq_blm.c 1391 2011-12-31 18:55:49Z tk $
1
// $Id: seq_blm.c 1421 2012-02-11 23:44:23Z tk $
2
/*
2
/*
3
 * Routines for MBHP_BLM_SCALAR access
3
 * Routines for MBHP_BLM_SCALAR access
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 1458... Line 1458...
1458
      u16 prev_pattern_red = blm_leds_red_sent[led_row];
1458
      u16 prev_pattern_red = blm_leds_red_sent[led_row];
1459
1459
1460
      if( force_update || pattern_green != prev_pattern_green || pattern_red != prev_pattern_red ) {
1460
      if( force_update || pattern_green != prev_pattern_green || pattern_red != prev_pattern_red ) {
1461
1461
1462
    // Note: the MIOS32 MIDI driver will take care about running status to optimize the stream
1462
    // Note: the MIOS32 MIDI driver will take care about running status to optimize the stream
1463
    if( force_update || (pattern_green ^ prev_pattern_green) & 0x00ff ) {
1463
    if( force_update || ((pattern_green ^ prev_pattern_green) & 0x00ff) ) {
1464
      u8 pattern8 = pattern_green;
1464
      u8 pattern8 = pattern_green;
1465
      p.chn = led_row;
1465
      p.chn = led_row;
1466
      p.cc_number = 8*blm_leds_rotate_view + ((pattern8 & 0x80) ? 17 : 16); // CC number + MSB LED
1466
      p.cc_number = 8*blm_leds_rotate_view + ((pattern8 & 0x80) ? 17 : 16); // CC number + MSB LED
1467
      p.value = pattern8 & 0x7f; // remaining 7 LEDs
1467
      p.value = pattern8 & 0x7f; // remaining 7 LEDs
1468
1468
1469
      SEND_PACKET(p);
1469
      SEND_PACKET(p);
1470
    }
1470
    }
1471
1471
1472
    if( force_update || (pattern_green ^ prev_pattern_green) & 0xff00 ) {
1472
    if( force_update || ((pattern_green ^ prev_pattern_green) & 0xff00) ) {
1473
      u8 pattern8 = pattern_green >> 8;
1473
      u8 pattern8 = pattern_green >> 8;
1474
      p.chn = led_row;
1474
      p.chn = led_row;
1475
      p.cc_number = 8*blm_leds_rotate_view + ((pattern8 & 0x80) ? 19 : 18); // CC number + MSB LED
1475
      p.cc_number = 8*blm_leds_rotate_view + ((pattern8 & 0x80) ? 19 : 18); // CC number + MSB LED
1476
      p.value = pattern8 & 0x7f; // remaining 7 LEDs
1476
      p.value = pattern8 & 0x7f; // remaining 7 LEDs
1477
1477
1478
      SEND_PACKET(p);
1478
      SEND_PACKET(p);
1479
    }  
1479
    }  
1480
1480
1481
    if( force_update || (pattern_red ^ prev_pattern_red) & 0x00ff ) {
1481
    if( force_update || ((pattern_red ^ prev_pattern_red) & 0x00ff) ) {
1482
      u8 pattern8 = pattern_red;
1482
      u8 pattern8 = pattern_red;
1483
      p.chn = led_row;
1483
      p.chn = led_row;
1484
      p.cc_number = 8*blm_leds_rotate_view + ((pattern8 & 0x80) ? 33 : 32); // CC number + MSB LED
1484
      p.cc_number = 8*blm_leds_rotate_view + ((pattern8 & 0x80) ? 33 : 32); // CC number + MSB LED
1485
      p.value = pattern8 & 0x7f; // remaining 7 LEDs
1485
      p.value = pattern8 & 0x7f; // remaining 7 LEDs
1486
1486
1487
      SEND_PACKET(p);
1487
      SEND_PACKET(p);
1488
    }
1488
    }
1489
1489
1490
    if( force_update || (pattern_red ^ prev_pattern_red) & 0xff00 ) {
1490
    if( force_update || ((pattern_red ^ prev_pattern_red) & 0xff00) ) {
1491
      u8 pattern8 = pattern_red >> 8;
1491
      u8 pattern8 = pattern_red >> 8;
1492
      p.chn = led_row;
1492
      p.chn = led_row;
1493
      p.cc_number = 8*blm_leds_rotate_view + ((pattern8 & 0x80) ? 35 : 34); // CC number + MSB LED
1493
      p.cc_number = 8*blm_leds_rotate_view + ((pattern8 & 0x80) ? 35 : 34); // CC number + MSB LED
1494
      p.value = pattern8 & 0x7f; // remaining 7 LEDs
1494
      p.value = pattern8 & 0x7f; // remaining 7 LEDs
1495
1495