Subversion Repositories svn.mios32

Rev

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

Rev 2531 Rev 2532
Line 1... Line 1...
1
// $Id: seq_file_hw.c 2531 2017-10-11 22:55:38Z tk $
1
// $Id: seq_file_hw.c 2532 2017-10-12 21:50:45Z tk $
2
/*
2
/*
3
 * Hardware Soft-Config File access functions
3
 * Hardware Soft-Config File access functions
4
 *
4
 *
5
 * NOTE: before accessing the SD Card, the upper level function should
5
 * NOTE: before accessing the SD Card, the upper level function should
6
 * synchronize with the SD Card semaphore!
6
 * synchronize with the SD Card semaphore!
Line 211... Line 211...
211
211
212
  if( word == next )
212
  if( word == next )
213
    return -1;
213
    return -1;
214
214
215
  if( blm8x8_selected ) {
215
  if( blm8x8_selected ) {
216
    l = 24 + l-1;
216
    l = 32 + l;
217
  }
217
  }
218
218
219
  return l; // value is valid
219
  return l; // value is valid
220
}
220
}
221
221
Line 360... Line 360...
360
        seq_hwcfg_button_beh.loop = flag;
360
        seq_hwcfg_button_beh.loop = flag;
361
      } else if( strcasecmp(parameter, "FOLLOW") == 0 ) {
361
      } else if( strcasecmp(parameter, "FOLLOW") == 0 ) {
362
        seq_hwcfg_button_beh.follow = flag;
362
        seq_hwcfg_button_beh.follow = flag;
363
      } else if( strcasecmp(parameter, "MENU") == 0 ) {
363
      } else if( strcasecmp(parameter, "MENU") == 0 ) {
364
        seq_hwcfg_button_beh.menu = flag;
364
        seq_hwcfg_button_beh.menu = flag;
-
 
365
      } else if( strcasecmp(parameter, "MUTE") == 0 ) {
-
 
366
        seq_hwcfg_button_beh.mute = flag;
365
      } else if( strcasecmp(parameter, "BOOKMARK") == 0 ) {
367
      } else if( strcasecmp(parameter, "BOOKMARK") == 0 ) {
366
        seq_hwcfg_button_beh.bookmark = flag;
368
        seq_hwcfg_button_beh.bookmark = flag;
367
      } else if( strcasecmp(parameter, "STEP_VIEW") == 0 ) {
369
      } else if( strcasecmp(parameter, "STEP_VIEW") == 0 ) {
368
        seq_hwcfg_button_beh.step_view = flag;
370
        seq_hwcfg_button_beh.step_view = flag;
369
      } else if( strcasecmp(parameter, "TRG_LAYER") == 0 ) {
371
      } else if( strcasecmp(parameter, "TRG_LAYER") == 0 ) {
370
        seq_hwcfg_button_beh.trg_layer = flag;
372
        seq_hwcfg_button_beh.trg_layer = flag;
371
      } else if( strcasecmp(parameter, "PAR_LAYER") == 0 ) {
373
      } else if( strcasecmp(parameter, "PAR_LAYER") == 0 ) {
372
        seq_hwcfg_button_beh.par_layer = flag;
374
        seq_hwcfg_button_beh.par_layer = flag;
-
 
375
      } else if( strcasecmp(parameter, "INS_SEL") == 0 ) {
-
 
376
        seq_hwcfg_button_beh.ins_sel = flag;
373
      } else if( strcasecmp(parameter, "TRACK_SEL") == 0 ) {
377
      } else if( strcasecmp(parameter, "TRACK_SEL") == 0 ) {
374
        seq_hwcfg_button_beh.track_sel = flag;
378
        seq_hwcfg_button_beh.track_sel = flag;
375
      } else if( strcasecmp(parameter, "TEMPO_PRESET") == 0 ) {
379
      } else if( strcasecmp(parameter, "TEMPO_PRESET") == 0 ) {
376
        seq_hwcfg_button_beh.tempo_preset = flag;
380
        seq_hwcfg_button_beh.tempo_preset = flag;
377
      } else if( strcasecmp(parameter, "ALL_WITH_TRIGGERS") == 0 ) {
381
      } else if( strcasecmp(parameter, "ALL_WITH_TRIGGERS") == 0 ) {
Line 389... Line 393...
389
    } else if( strncasecmp(parameter, "BUTTON_", 7) == 0 ) {
393
    } else if( strncasecmp(parameter, "BUTTON_", 7) == 0 ) {
390
      parameter += 7;
394
      parameter += 7;
391
395
392
      char *word = strtok_r(NULL, separators, &brkt);
396
      char *word = strtok_r(NULL, separators, &brkt);
393
397
-
 
398
      // M1..M8 or M1A..M8A -> SR 32..39
-
 
399
      // M1B..M8B -> SR40..47
394
      // M1..M8 -> SR 24..31
400
      // M1C..M8C -> SR48..55
395
      s32 sr = -1;
401
      s32 sr = -1;
396
      u8 blm8x8_selected = 0;
402
      u8 blm8x8_selected = 0;
397
      if( word[0] == 'M' ) {
403
      if( word[0] == 'M' ) {
398
        blm8x8_selected = 1;
404
        blm8x8_selected = 1;
399
        ++word;
405
        ++word;
400
        s32 m = get_dec(word);
406
        s32 m = word[0] - '0';
-
 
407
        s32 blm = word[1] ? (word[1]-'A') : 0;
401
408
402
        if( m < 1 || m > 8 ) {
409
        if( m < 1 || m > 8 || blm < 0 || blm >= SEQ_BLM8X8_NUM ) {
403
#if DEBUG_VERBOSE_LEVEL >= 1
410
#if DEBUG_VERBOSE_LEVEL >= 1
404
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in BUTTON_%s definition: invalid SR value 'M%s'!", parameter, word);
411
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in BUTTON_%s definition: invalid SR value 'M%s'!", parameter, word);
405
#endif
412
#endif
406
          continue;
413
          continue;
407
        }
414
        }
408
        sr = 24 + m-1;
415
        sr = 32 + blm*8 + m;
409
      } else {
416
      } else {
410
        sr = get_dec(word);
417
        sr = get_dec(word);
411
        if( sr < 0 || sr > 32 ) {
418
        if( sr < 0 || sr >= (32 + SEQ_BLM8X8_NUM*8) ) {
412
#if DEBUG_VERBOSE_LEVEL >= 1
419
#if DEBUG_VERBOSE_LEVEL >= 1
413
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in BUTTON_%s definition: invalid SR value '%s'!", parameter, word);
420
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in BUTTON_%s definition: invalid SR value '%s'!", parameter, word);
414
#endif
421
#endif
415
          continue;
422
          continue;
416
        }
423
        }
Line 423... Line 430...
423
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in BUTTON_%s definition: invalid pin value '%s'!", parameter, word);
430
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in BUTTON_%s definition: invalid pin value '%s'!", parameter, word);
424
#endif
431
#endif
425
        continue;
432
        continue;
426
      }
433
      }
427
434
428
      u8 din_value = ((sr-1)<<3) | pin;
435
      u16 din_value = ((sr-1)<<3) | pin;
429
436
430
      // compatibility with old configurations: if SRIO_NUM_SR hasn't been set to 23 (so that it's still 16)
437
      // compatibility with old configurations: if SRIO_NUM_SR hasn't been set to 23 (so that it's still 16)
431
      // then map DIN SR 17..24 to 24..31
438
      // then map DIN SR 17..24 to 32..39
432
      if( !blm8x8_selected && MIOS32_SRIO_ScanNumGet() <= 16 && din_value >= 128 && din_value < 192 ) {
439
      if( !blm8x8_selected && MIOS32_SRIO_ScanNumGet() <= 16 && din_value >= 128 && din_value < 192 ) {
433
        din_value += 56;
440
        din_value += 128;
434
      }
441
      }
435
442
436
#if DEBUG_VERBOSE_LEVEL >= 3
443
#if DEBUG_VERBOSE_LEVEL >= 3
437
      DEBUG_MSG("[SEQ_FILE_HW] Button %s: SR %d Pin %d (DIN: 0x%02x)", line_buffer, sr, pin, din_value);
444
      DEBUG_MSG("[SEQ_FILE_HW] Button %s: SR %d Pin %d (DIN: 0x%02x)", line_buffer, sr, pin, din_value);
438
#endif
445
#endif
Line 491... Line 498...
491
        seq_hwcfg_button.mute = din_value;
498
        seq_hwcfg_button.mute = din_value;
492
      } else if( strcasecmp(parameter, "PATTERN") == 0 ) {
499
      } else if( strcasecmp(parameter, "PATTERN") == 0 ) {
493
        seq_hwcfg_button.pattern = din_value;
500
        seq_hwcfg_button.pattern = din_value;
494
      } else if( strcasecmp(parameter, "SONG") == 0 ) {
501
      } else if( strcasecmp(parameter, "SONG") == 0 ) {
495
        seq_hwcfg_button.song = din_value;
502
        seq_hwcfg_button.song = din_value;
-
 
503
      } else if( strcasecmp(parameter, "PHRASE") == 0 ) {
-
 
504
        seq_hwcfg_button.phrase = din_value;
496
      } else if( strcasecmp(parameter, "SOLO") == 0 ) {
505
      } else if( strcasecmp(parameter, "SOLO") == 0 ) {
497
        seq_hwcfg_button.solo = din_value;
506
        seq_hwcfg_button.solo = din_value;
498
      } else if( strcasecmp(parameter, "FAST2") == 0 ) {
507
      } else if( strcasecmp(parameter, "FAST2") == 0 ) {
499
        seq_hwcfg_button.fast2 = din_value;
508
        seq_hwcfg_button.fast2 = din_value;
500
      } else if( strcasecmp(parameter, "FAST") == 0 ) {
509
      } else if( strcasecmp(parameter, "FAST") == 0 ) {
Line 514... Line 523...
514
        seq_hwcfg_button.step_view = din_value;
523
        seq_hwcfg_button.step_view = din_value;
515
      } else if( strcasecmp(parameter, "TRG_LAYER_SEL") == 0 ) {
524
      } else if( strcasecmp(parameter, "TRG_LAYER_SEL") == 0 ) {
516
        seq_hwcfg_button.trg_layer_sel = din_value;
525
        seq_hwcfg_button.trg_layer_sel = din_value;
517
      } else if( strcasecmp(parameter, "PAR_LAYER_SEL") == 0 ) {
526
      } else if( strcasecmp(parameter, "PAR_LAYER_SEL") == 0 ) {
518
        seq_hwcfg_button.par_layer_sel = din_value;
527
        seq_hwcfg_button.par_layer_sel = din_value;
-
 
528
      } else if( strcasecmp(parameter, "INS_SEL") == 0 ) {
-
 
529
        seq_hwcfg_button.ins_sel = din_value;
519
      } else if( strcasecmp(parameter, "TRACK_SEL") == 0 ) {
530
      } else if( strcasecmp(parameter, "TRACK_SEL") == 0 ) {
520
        seq_hwcfg_button.track_sel = din_value;
531
        seq_hwcfg_button.track_sel = din_value;
521
      } else if( strcasecmp(parameter, "TAP_TEMPO") == 0 ) {
532
      } else if( strcasecmp(parameter, "TAP_TEMPO") == 0 ) {
522
        seq_hwcfg_button.tap_tempo = din_value;
533
        seq_hwcfg_button.tap_tempo = din_value;
523
      } else if( strcasecmp(parameter, "TEMPO_PRESET") == 0 ) {
534
      } else if( strcasecmp(parameter, "TEMPO_PRESET") == 0 ) {
Line 610... Line 621...
610
    } else if( strncasecmp(parameter, "LED_", 4) == 0 ) {
621
    } else if( strncasecmp(parameter, "LED_", 4) == 0 ) {
611
      parameter += 4;
622
      parameter += 4;
612
623
613
      char *word = strtok_r(NULL, separators, &brkt);
624
      char *word = strtok_r(NULL, separators, &brkt);
614
625
-
 
626
      // M1..M8 or M1A..M8A -> SR 32..39
-
 
627
      // M1B..M8B -> SR40..47
615
      // M1..M8 -> SR 24..31
628
      // M1C..M8C -> SR48..55
616
      s32 sr = -1;
629
      s32 sr = -1;
617
      u8 blm8x8_selected = 0;
630
      u8 blm8x8_selected = 0;
618
      if( word[0] == 'M' ) {
631
      if( word[0] == 'M' ) {
619
        blm8x8_selected = 1;
632
        blm8x8_selected = 1;
620
        ++word;
633
        ++word;
621
        s32 m = get_dec(word);
634
        s32 m = word[0] - '0';
-
 
635
        s32 blm = word[1] ? (word[1]-'A') : 0;
622
636
623
        if( m < 1 || m > 8 ) {
637
        if( m < 1 || m > 8 || blm < 0 || blm >= SEQ_BLM8X8_NUM ) {
624
#if DEBUG_VERBOSE_LEVEL >= 1
638
#if DEBUG_VERBOSE_LEVEL >= 1
625
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in LED_%s definition: invalid SR value 'M%s'!", parameter, word);
639
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in LED_%s definition: invalid SR value 'M%s'!", parameter, word);
626
#endif
640
#endif
627
          continue;
641
          continue;
628
        }
642
        }
629
        sr = 24 + m-1;
643
        sr = 32 + blm*8 + m;
630
      } else {
644
      } else {
631
        sr = get_dec(word);
645
        sr = get_dec(word);
632
        if( sr < 0 || sr > 32 ) {
646
        if( sr < 0 || sr >= (32 + SEQ_BLM8X8_NUM*8) ) {
633
#if DEBUG_VERBOSE_LEVEL >= 1
647
#if DEBUG_VERBOSE_LEVEL >= 1
634
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in LED_%s definition: invalid SR value '%s'!", parameter, word);
648
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in LED_%s definition: invalid SR value '%s'!", parameter, word);
635
#endif
649
#endif
636
          continue;
650
          continue;
637
        }
651
        }
Line 644... Line 658...
644
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in LED_%s definition: invalid pin value '%s'!", parameter, word);
658
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in LED_%s definition: invalid pin value '%s'!", parameter, word);
645
#endif
659
#endif
646
        continue;
660
        continue;
647
      }
661
      }
648
662
649
      u8 dout_value = ((sr-1)<<3) | pin;
663
      u16 dout_value = ((sr-1)<<3) | pin;
650
664
651
      // compatibility with old configurations: if SRIO_NUM_SR hasn't been set to 23 (so that it's still 16)
665
      // compatibility with old configurations: if SRIO_NUM_SR hasn't been set to 23 (so that it's still 16)
652
      // then map DOUT SR 17..24 to 24..31
666
      // then map DOUT SR 17..24 to 32..39
653
      if( !blm8x8_selected && MIOS32_SRIO_ScanNumGet() <= 16 && dout_value >= 128 && dout_value < 192 ) {
667
      if( !blm8x8_selected && MIOS32_SRIO_ScanNumGet() <= 16 && dout_value >= 128 && dout_value < 192 ) {
654
        dout_value += 56;
668
        dout_value += 128;
655
      }
669
      }
656
670
657
#if DEBUG_VERBOSE_LEVEL >= 3
671
#if DEBUG_VERBOSE_LEVEL >= 3
658
      DEBUG_MSG("[SEQ_FILE_HW] LED %s: SR %d Pin %d (DOUT: 0x%02x)", parameter, sr, pin, dout_value);
672
      DEBUG_MSG("[SEQ_FILE_HW] LED %s: SR %d Pin %d (DOUT: 0x%02x)", parameter, sr, pin, dout_value);
659
#endif
673
#endif
Line 678... Line 692...
678
        seq_hwcfg_led.mute = dout_value;
692
        seq_hwcfg_led.mute = dout_value;
679
      } else if( strcasecmp(parameter, "PATTERN") == 0 ) {
693
      } else if( strcasecmp(parameter, "PATTERN") == 0 ) {
680
        seq_hwcfg_led.pattern = dout_value;
694
        seq_hwcfg_led.pattern = dout_value;
681
      } else if( strcasecmp(parameter, "SONG") == 0 ) {
695
      } else if( strcasecmp(parameter, "SONG") == 0 ) {
682
        seq_hwcfg_led.song = dout_value;
696
        seq_hwcfg_led.song = dout_value;
-
 
697
      } else if( strcasecmp(parameter, "PHRASE") == 0 ) {
-
 
698
        seq_hwcfg_led.phrase = dout_value;
683
      } else if( strcasecmp(parameter, "SOLO") == 0 ) {
699
      } else if( strcasecmp(parameter, "SOLO") == 0 ) {
684
        seq_hwcfg_led.solo = dout_value;
700
        seq_hwcfg_led.solo = dout_value;
685
      } else if( strcasecmp(parameter, "FAST2") == 0 ) {
701
      } else if( strcasecmp(parameter, "FAST2") == 0 ) {
686
        seq_hwcfg_led.fast2 = dout_value;
702
        seq_hwcfg_led.fast2 = dout_value;
687
      } else if( strcasecmp(parameter, "FAST") == 0 ) {
703
      } else if( strcasecmp(parameter, "FAST") == 0 ) {
Line 746... Line 762...
746
        seq_hwcfg_led.step_view = dout_value;
762
        seq_hwcfg_led.step_view = dout_value;
747
      } else if( strcasecmp(parameter, "TRG_LAYER_SEL") == 0 ) {
763
      } else if( strcasecmp(parameter, "TRG_LAYER_SEL") == 0 ) {
748
        seq_hwcfg_led.trg_layer_sel = dout_value;
764
        seq_hwcfg_led.trg_layer_sel = dout_value;
749
      } else if( strcasecmp(parameter, "PAR_LAYER_SEL") == 0 ) {
765
      } else if( strcasecmp(parameter, "PAR_LAYER_SEL") == 0 ) {
750
        seq_hwcfg_led.par_layer_sel = dout_value;
766
        seq_hwcfg_led.par_layer_sel = dout_value;
-
 
767
      } else if( strcasecmp(parameter, "INS_SEL") == 0 ) {
-
 
768
        seq_hwcfg_led.ins_sel = dout_value;
751
      } else if( strcasecmp(parameter, "TRACK_SEL") == 0 ) {
769
      } else if( strcasecmp(parameter, "TRACK_SEL") == 0 ) {
752
        seq_hwcfg_led.track_sel = dout_value;
770
        seq_hwcfg_led.track_sel = dout_value;
753
      } else if( strcasecmp(parameter, "TAP_TEMPO") == 0 ) {
771
      } else if( strcasecmp(parameter, "TAP_TEMPO") == 0 ) {
754
        seq_hwcfg_led.tap_tempo = dout_value;
772
        seq_hwcfg_led.tap_tempo = dout_value;
755
      } else if( strcasecmp(parameter, "TEMPO_PRESET") == 0 ) {
773
      } else if( strcasecmp(parameter, "TEMPO_PRESET") == 0 ) {
Line 895... Line 913...
895
    // TRACKS_DOUT_[LR]_SR
913
    // TRACKS_DOUT_[LR]_SR
896
    ////////////////////////////////////////////////////////////////////////////////////////////
914
    ////////////////////////////////////////////////////////////////////////////////////////////
897
    } else if( strcasecmp(parameter, "TRACKS_DOUT_L_SR") == 0 || strcasecmp(parameter, "TRACKS_DOUT_R_SR") == 0 ) {
915
    } else if( strcasecmp(parameter, "TRACKS_DOUT_L_SR") == 0 || strcasecmp(parameter, "TRACKS_DOUT_R_SR") == 0 ) {
898
      char *word = strtok_r(NULL, separators, &brkt);
916
      char *word = strtok_r(NULL, separators, &brkt);
899
      s32 sr = get_sr(word);
917
      s32 sr = get_sr(word);
900
      if( sr < 0 || sr > 32 ) {
918
      if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
901
#if DEBUG_VERBOSE_LEVEL >= 1
919
#if DEBUG_VERBOSE_LEVEL >= 1
902
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
920
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
903
#endif
921
#endif
904
        continue;
922
        continue;
905
      }
923
      }
Line 939... Line 957...
939
    } else if( strncasecmp(parameter, "GP_DOUT_", 8) == 0 ) {
957
    } else if( strncasecmp(parameter, "GP_DOUT_", 8) == 0 ) {
940
      parameter += 8;
958
      parameter += 8;
941
959
942
      char *word = strtok_r(NULL, separators, &brkt);
960
      char *word = strtok_r(NULL, separators, &brkt);
943
      s32 sr = get_sr(word);
961
      s32 sr = get_sr(word);
944
      if( sr < 0 || sr > 32 ) {
962
      if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
945
#if DEBUG_VERBOSE_LEVEL >= 1
963
#if DEBUG_VERBOSE_LEVEL >= 1
946
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in GP_DOUT_%s definition: invalid SR value '%s'!", parameter, word);
964
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in GP_DOUT_%s definition: invalid SR value '%s'!", parameter, word);
947
#endif
965
#endif
948
        continue;
966
        continue;
949
      }
967
      }
Line 1041... Line 1059...
1041
1059
1042
1060
1043
    ////////////////////////////////////////////////////////////////////////////////////////////
1061
    ////////////////////////////////////////////////////////////////////////////////////////////
1044
    // BLM8X8_
1062
    // BLM8X8_
1045
    ////////////////////////////////////////////////////////////////////////////////////////////
1063
    ////////////////////////////////////////////////////////////////////////////////////////////
1046
    } else if( strncasecmp(parameter, "BLM8X8_", 7) == 0 ) {
1064
    } else if( strncasecmp(parameter, "BLM8X8_", 7) == 0 ||
-
 
1065
           strncasecmp(parameter, "BLM8X8A_", 8) == 0 ||
-
 
1066
           strncasecmp(parameter, "BLM8X8B_", 8) == 0 ||
-
 
1067
           strncasecmp(parameter, "BLM8X8C_", 8) == 0 ) {
-
 
1068
      int blm = 0;
-
 
1069
      if( parameter[6] >= 'A' && parameter[6] <= 'C' ) {
-
 
1070
        blm = parameter[6] - 'A';
-
 
1071
        parameter += 8;
-
 
1072
      } else {
1047
      parameter += 7;
1073
        parameter += 7;
-
 
1074
      }
-
 
1075
1048
1076
1049
      char *word = strtok_r(NULL, separators, &brkt);
1077
      char *word = strtok_r(NULL, separators, &brkt);
1050
      s32 value = get_dec(word);
1078
      s32 value = get_dec(word);
1051
      if( value < 0 ) {
1079
      if( value < 0 ) {
1052
#if DEBUG_VERBOSE_LEVEL >= 1
1080
#if DEBUG_VERBOSE_LEVEL >= 1
Line 1057... Line 1085...
1057
1085
1058
#if DEBUG_VERBOSE_LEVEL >= 3
1086
#if DEBUG_VERBOSE_LEVEL >= 3
1059
      DEBUG_MSG("[SEQ_FILE_HW] BLM8X8_%s: %d", parameter, value);
1087
      DEBUG_MSG("[SEQ_FILE_HW] BLM8X8_%s: %d", parameter, value);
1060
#endif
1088
#endif
1061
1089
1062
      int blm = 0; // TODO: multiple BLMs
-
 
1063
-
 
1064
      if( strcasecmp(parameter, "ENABLED") == 0 ) {
1090
      if( blm == 0 && strcasecmp(parameter, "ENABLED") == 0 ) {
1065
        seq_hwcfg_blm8x8.enabled = value;
1091
        seq_hwcfg_blm8x8.enabled = value;
1066
      } else if( strcasecmp(parameter, "DOUT_CATHODES_SR") == 0 ) {
1092
      } else if( strcasecmp(parameter, "DOUT_CATHODES_SR") == 0 ) {
1067
        seq_blm8x8_config_t config = SEQ_BLM8X8_ConfigGet(blm);
1093
        seq_blm8x8_config_t config = SEQ_BLM8X8_ConfigGet(blm);
1068
        config.rowsel_dout_sr = value;
1094
        config.rowsel_dout_sr = value;
1069
        SEQ_BLM8X8_ConfigSet(blm, config);
1095
        SEQ_BLM8X8_ConfigSet(blm, config);
Line 1077... Line 1103...
1077
        SEQ_BLM8X8_ConfigSet(blm, config);
1103
        SEQ_BLM8X8_ConfigSet(blm, config);
1078
      } else if( strcasecmp(parameter, "DOUT_LED_SR") == 0 ) {
1104
      } else if( strcasecmp(parameter, "DOUT_LED_SR") == 0 ) {
1079
        seq_blm8x8_config_t config = SEQ_BLM8X8_ConfigGet(blm);
1105
        seq_blm8x8_config_t config = SEQ_BLM8X8_ConfigGet(blm);
1080
        config.led_dout_sr = value;
1106
        config.led_dout_sr = value;
1081
        SEQ_BLM8X8_ConfigSet(blm, config);
1107
        SEQ_BLM8X8_ConfigSet(blm, config);
1082
      } else if( strcasecmp(parameter, "DOUT_GP_MAPPING") == 0 ) {
1108
      } else if( blm == 0 && strcasecmp(parameter, "DOUT_GP_MAPPING") == 0 ) {
1083
        seq_hwcfg_blm8x8.dout_gp_mapping = value;
1109
        seq_hwcfg_blm8x8.dout_gp_mapping = value;
1084
      } else if( strcasecmp(parameter, "DIN_SR") == 0 ) {
1110
      } else if( strcasecmp(parameter, "DIN_SR") == 0 ) {
1085
        seq_blm8x8_config_t config = SEQ_BLM8X8_ConfigGet(blm);
1111
        seq_blm8x8_config_t config = SEQ_BLM8X8_ConfigGet(blm);
1086
        config.button_din_sr = value;
1112
        config.button_din_sr = value;
1087
        SEQ_BLM8X8_ConfigSet(blm, config);
1113
        SEQ_BLM8X8_ConfigSet(blm, config);
Line 1125... Line 1151...
1125
#if DEBUG_VERBOSE_LEVEL >= 1
1151
#if DEBUG_VERBOSE_LEVEL >= 1
1126
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in BPM_DIGITS_%s definition: invalid pin value '%s'!", parameter, word);
1152
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in BPM_DIGITS_%s definition: invalid pin value '%s'!", parameter, word);
1127
#endif
1153
#endif
1128
          continue;
1154
          continue;
1129
        }
1155
        }
1130
        u8 dout_value = ((value-1)<<3) | pin;
1156
        u16 dout_value = ((value-1)<<3) | pin;
1131
1157
1132
        if( strcasecmp(parameter, "COMMON1_PIN") == 0 ) {
1158
        if( strcasecmp(parameter, "COMMON1_PIN") == 0 ) {
1133
          seq_hwcfg_bpm_digits.common1_pin = dout_value;
1159
          seq_hwcfg_bpm_digits.common1_pin = dout_value;
1134
        } else if( strcasecmp(parameter, "COMMON2_PIN") == 0 ) {
1160
        } else if( strcasecmp(parameter, "COMMON2_PIN") == 0 ) {
1135
          seq_hwcfg_bpm_digits.common2_pin = dout_value;
1161
          seq_hwcfg_bpm_digits.common2_pin = dout_value;
Line 1177... Line 1203...
1177
#if DEBUG_VERBOSE_LEVEL >= 1
1203
#if DEBUG_VERBOSE_LEVEL >= 1
1178
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in STEP_DIGITS_%s definition: invalid pin value '%s'!", parameter, word);
1204
          DEBUG_MSG("[SEQ_FILE_HW] ERROR in STEP_DIGITS_%s definition: invalid pin value '%s'!", parameter, word);
1179
#endif
1205
#endif
1180
          continue;
1206
          continue;
1181
        }
1207
        }
1182
        u8 dout_value = ((value-1)<<3) | pin;
1208
        u16 dout_value = ((value-1)<<3) | pin;
1183
1209
1184
        if( strcasecmp(parameter, "COMMON1_PIN") == 0 ) {
1210
        if( strcasecmp(parameter, "COMMON1_PIN") == 0 ) {
1185
          seq_hwcfg_step_digits.common1_pin = dout_value;
1211
          seq_hwcfg_step_digits.common1_pin = dout_value;
1186
        } else if( strcasecmp(parameter, "COMMON2_PIN") == 0 ) {
1212
        } else if( strcasecmp(parameter, "COMMON2_PIN") == 0 ) {
1187
          seq_hwcfg_step_digits.common2_pin = dout_value;
1213
          seq_hwcfg_step_digits.common2_pin = dout_value;
Line 1385... Line 1411...
1385
    } else if( strncasecmp(parameter, "CV_GATE_SR", 10) == 0 && // CV_GATE_SR%d
1411
    } else if( strncasecmp(parameter, "CV_GATE_SR", 10) == 0 && // CV_GATE_SR%d
1386
             (hlp=atoi(parameter+10)) >= 1 && hlp <= SEQ_HWCFG_NUM_SR_CV_GATES ) {
1412
             (hlp=atoi(parameter+10)) >= 1 && hlp <= SEQ_HWCFG_NUM_SR_CV_GATES ) {
1387
1413
1388
      char *word = strtok_r(NULL, separators, &brkt);
1414
      char *word = strtok_r(NULL, separators, &brkt);
1389
      s32 sr = get_sr(word);
1415
      s32 sr = get_sr(word);
1390
      if( sr < 0 || sr > 32 ) {
1416
      if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
1391
#if DEBUG_VERBOSE_LEVEL >= 1
1417
#if DEBUG_VERBOSE_LEVEL >= 1
1392
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
1418
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
1393
#endif
1419
#endif
1394
        continue;
1420
        continue;
1395
      }
1421
      }
Line 1397... Line 1423...
1397
        seq_hwcfg_cv_gate_sr[hlp-1] = sr;
1423
        seq_hwcfg_cv_gate_sr[hlp-1] = sr;
1398
1424
1399
    } else if( strcasecmp(parameter, "CLK_SR") == 0 ) {
1425
    } else if( strcasecmp(parameter, "CLK_SR") == 0 ) {
1400
      char *word = strtok_r(NULL, separators, &brkt);
1426
      char *word = strtok_r(NULL, separators, &brkt);
1401
      s32 sr = get_sr(word);
1427
      s32 sr = get_sr(word);
1402
      if( sr < 0 || sr > 32 ) {
1428
      if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
1403
#if DEBUG_VERBOSE_LEVEL >= 1
1429
#if DEBUG_VERBOSE_LEVEL >= 1
1404
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
1430
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
1405
#endif
1431
#endif
1406
        continue;
1432
        continue;
1407
      }
1433
      }
Line 1411... Line 1437...
1411
    } else if( strncasecmp(parameter, "DOUT_GATE_SR", 12) == 0 && // DOUT_GATE_SR%d
1437
    } else if( strncasecmp(parameter, "DOUT_GATE_SR", 12) == 0 && // DOUT_GATE_SR%d
1412
             (hlp=atoi(parameter+12)) >= 1 && hlp <= SEQ_HWCFG_NUM_SR_DOUT_GATES ) {
1438
             (hlp=atoi(parameter+12)) >= 1 && hlp <= SEQ_HWCFG_NUM_SR_DOUT_GATES ) {
1413
1439
1414
      char *word = strtok_r(NULL, separators, &brkt);
1440
      char *word = strtok_r(NULL, separators, &brkt);
1415
      s32 sr = get_sr(word);
1441
      s32 sr = get_sr(word);
1416
      if( sr < 0 || sr > 32 ) {
1442
      if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
1417
#if DEBUG_VERBOSE_LEVEL >= 1
1443
#if DEBUG_VERBOSE_LEVEL >= 1
1418
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
1444
        DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
1419
#endif
1445
#endif
1420
        continue;
1446
        continue;
1421
      }
1447
      }