Subversion Repositories svn.mios

Rev

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

Rev 973 Rev 1194
Line 1... Line 1...
1
// $Id: main.c 973 2011-02-26 14:13:32Z tk $
1
// $Id: main.c 1194 2015-06-08 21:05:14Z tk $
2
/*
2
/*
3
 * MBHP_SCALAR firmware
3
 * MBHP_SCALAR firmware
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 41... Line 41...
41
// send layout informations or ping each 5 seconds
41
// send layout informations or ping each 5 seconds
42
static unsigned int sysexRequestTimer;
42
static unsigned int sysexRequestTimer;
43
static unsigned char midiDataReceived;
43
static unsigned char midiDataReceived;
44
44
45
static unsigned char testmode;
45
static unsigned char testmode;
-
 
46
-
 
47
-
 
48
#if BLM_AIN_PIN_MAP
-
 
49
// optional AIN pin map
-
 
50
static const ain_pin_map[8] = {3, 2, 1, 0, 4, 5, 6, 7};
-
 
51
#endif
46
52
47
53
48
/////////////////////////////////////////////////////////////////////////////
54
/////////////////////////////////////////////////////////////////////////////
49
// This function is called by MIOS after startup to initialize the 
55
// This function is called by MIOS after startup to initialize the 
50
// application
56
// application
Line 405... Line 411...
405
// This function is called by MIOS when a pot has been moved
411
// This function is called by MIOS when a pot has been moved
406
/////////////////////////////////////////////////////////////////////////////
412
/////////////////////////////////////////////////////////////////////////////
407
void AIN_NotifyChange(unsigned char pin, unsigned int pin_value) __wparam
413
void AIN_NotifyChange(unsigned char pin, unsigned int pin_value) __wparam
408
{
414
{
409
  // a pot has been moved, send modulation CC#1
415
  // a pot has been moved, send modulation CC#1
-
 
416
#if BLM_AIN_PIN_MAP
-
 
417
#warning "AIN Pin Map has been activated"
-
 
418
  pin = ain_pin_map[pin & 7];
-
 
419
#endif
410
  MIOS_MIDI_TxBufferPut(0xb0 + (pin & 0x0f));
420
  MIOS_MIDI_TxBufferPut(0xb0 + (pin & 0x0f));
411
  MIOS_MIDI_TxBufferPut(0x01);
421
  MIOS_MIDI_TxBufferPut(0x01);
412
  MIOS_MIDI_TxBufferPut(MIOS_AIN_Pin7bitGet(pin));
422
  MIOS_MIDI_TxBufferPut(MIOS_AIN_Pin7bitGet(pin));
413
}
423
}
414
424
Line 425... Line 435...
425
  unsigned char mask;
435
  unsigned char mask;
426
436
427
  // send pin number and value as Note On Event
437
  // send pin number and value as Note On Event
428
  if( blm_scalar_button_row < 0x20 ) {
438
  if( blm_scalar_button_row < 0x20 ) {
429
    // BLM 16x16
439
    // BLM 16x16
-
 
440
#if BLM_MIRROR_MAIN_DIN
-
 
441
#warning "BLM Main DIN mirroring has been activated!"
-
 
442
    pin = (pin & 0x8) | (7 - pin);
-
 
443
#endif
430
    MIOS_MIDI_TxBufferPut(0x90 + (pin >> 4));
444
    MIOS_MIDI_TxBufferPut(0x90 + (pin >> 4));
431
    MIOS_MIDI_TxBufferPut(pin & 0x0f);
445
    MIOS_MIDI_TxBufferPut(pin & 0x0f);
432
    MIOS_MIDI_TxBufferPut(value ? 0x00 : 0x7f);
446
    MIOS_MIDI_TxBufferPut(value ? 0x00 : 0x7f);
433
  } else if( (blm_scalar_button_row & 0xf9) == 0x20 && blm_scalar_button_column < 4 ) {
447
  } else if( (blm_scalar_button_row & 0xf9) == 0x20 && blm_scalar_button_column < 4 ) {
434
    // Extra column
448
    // Extra column