Subversion Repositories svn.mios32

Rev

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

Rev 2530 Rev 2531
Line 1... Line 1...
1
// $Id: seq_ui.c 2530 2017-10-11 20:40:37Z tk $
1
// $Id: seq_ui.c 2531 2017-10-11 22:55:38Z tk $
2
/*
2
/*
3
 * User Interface Routines
3
 * User Interface Routines
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 16... Line 16...
16
/////////////////////////////////////////////////////////////////////////////
16
/////////////////////////////////////////////////////////////////////////////
17
17
18
#include <mios32.h>
18
#include <mios32.h>
19
#include <string.h>
19
#include <string.h>
20
#include <blm.h>
20
#include <blm.h>
21
#include <blm_x.h>
-
 
22
#include <seq_midi_out.h>
21
#include <seq_midi_out.h>
23
#include <seq_bpm.h>
22
#include <seq_bpm.h>
24
#include <blm_scalar_master.h>
23
#include <blm_scalar_master.h>
25
#include <ws2812.h>
24
#include <ws2812.h>
26
25
Line 29... Line 28...
29
#include "seq_lcd.h"
28
#include "seq_lcd.h"
30
#include "seq_lcd_logo.h"
29
#include "seq_lcd_logo.h"
31
#include "seq_hwcfg.h"
30
#include "seq_hwcfg.h"
32
#include "seq_lcd.h"
31
#include "seq_lcd.h"
33
#include "seq_led.h"
32
#include "seq_led.h"
-
 
33
#include "seq_blm8x8.h"
34
#include "seq_midply.h"
34
#include "seq_midply.h"
35
#include "seq_mixer.h"
35
#include "seq_mixer.h"
36
#include "seq_live.h"
36
#include "seq_live.h"
37
#include "seq_core.h"
37
#include "seq_core.h"
38
#include "seq_song.h"
38
#include "seq_song.h"
Line 3195... Line 3195...
3195
    if( pos_marker_mask & gp_mask )
3195
    if( pos_marker_mask & gp_mask )
3196
      pattern |= 0x10;
3196
      pattern |= 0x10;
3197
    gp_mask <<= 1;
3197
    gp_mask <<= 1;
3198
3198
3199
    u8 mapped_sr = blm_x_sr_map[sr];
3199
    u8 mapped_sr = blm_x_sr_map[sr];
3200
    BLM_X_LED_rows[mapped_sr][0] = (BLM_X_LED_rows[mapped_sr][0] & 0x0f) | pattern;
3200
    seq_blm8x8_led_row[0][mapped_sr] = (seq_blm8x8_led_row[0][mapped_sr] & 0x0f) | pattern;
3201
      }
3201
      }
3202
    } else if( seq_hwcfg_blm8x8.dout_gp_mapping == 2 ) {
3202
    } else if( seq_hwcfg_blm8x8.dout_gp_mapping == 3 ) {
3203
      // for Antilog frontpanel
3203
      // for Antilog frontpanel
3204
3204
3205
      // BLM_X DOUT -> GP LED mapping
3205
      // BLM_X DOUT -> GP LED mapping
3206
      // left/right half offsets; green,red
3206
      // left/right half offsets; green,red
3207
      // 0 = 8,9        1 = 11,10       2 = 13,12       3 = 15,14
3207
      // 0 = 8,9        1 = 11,10       2 = 13,12       3 = 15,14
Line 3227... Line 3227...
3227
    if( pos_marker_mask  & (1 << 2) ) value |= (1 << 4);
3227
    if( pos_marker_mask  & (1 << 2) ) value |= (1 << 4);
3228
3228
3229
    if( modified_gp_leds & (1 << 3) ) value |= (1 << 7);
3229
    if( modified_gp_leds & (1 << 3) ) value |= (1 << 7);
3230
    if( pos_marker_mask  & (1 << 3) ) value |= (1 << 6);
3230
    if( pos_marker_mask  & (1 << 3) ) value |= (1 << 6);
3231
3231
3232
    BLM_X_LED_rows[1][0] = value;
3232
    seq_blm8x8_led_row[0][1] = value;
3233
      }
3233
      }
3234
3234
3235
      // GP row, second quarter
3235
      // GP row, second quarter
3236
      {
3236
      {
3237
    u8 value = 0;
3237
    u8 value = 0;
Line 3246... Line 3246...
3246
    if( pos_marker_mask  & (1 << 6) ) value |= (1 << 4);
3246
    if( pos_marker_mask  & (1 << 6) ) value |= (1 << 4);
3247
3247
3248
    if( modified_gp_leds & (1 << 7) ) value |= (1 << 7);
3248
    if( modified_gp_leds & (1 << 7) ) value |= (1 << 7);
3249
    if( pos_marker_mask  & (1 << 7) ) value |= (1 << 6);
3249
    if( pos_marker_mask  & (1 << 7) ) value |= (1 << 6);
3250
3250
-
 
3251
    seq_blm8x8_led_row[0][5] = value;
-
 
3252
      }
-
 
3253
-
 
3254
      // GP row, third quarter
-
 
3255
      {
-
 
3256
    u8 value = 0;
-
 
3257
-
 
3258
    if( modified_gp_leds & (1 << 8) ) value |= (1 << 0);
-
 
3259
    if( pos_marker_mask  & (1 << 8) ) value |= (1 << 1);
-
 
3260
-
 
3261
    if( modified_gp_leds & (1 << 9) ) value |= (1 << 3);
-
 
3262
    if( pos_marker_mask  & (1 << 9) ) value |= (1 << 2);
-
 
3263
-
 
3264
    if( modified_gp_leds & (1 << 10) ) value |= (1 << 5);
-
 
3265
    if( pos_marker_mask  & (1 << 10) ) value |= (1 << 4);
-
 
3266
-
 
3267
    if( modified_gp_leds & (1 << 11) ) value |= (1 << 7);
-
 
3268
    if( pos_marker_mask  & (1 << 11) ) value |= (1 << 6);
-
 
3269
-
 
3270
    seq_blm8x8_led_row[1][1] = value;
-
 
3271
      }
-
 
3272
-
 
3273
      // GP row, fourth quarter
-
 
3274
      {
-
 
3275
    u8 value = 0;
-
 
3276
-
 
3277
    if( modified_gp_leds & (1 << 12) ) value |= (1 << 0);
-
 
3278
    if( pos_marker_mask  & (1 << 12) ) value |= (1 << 1);
-
 
3279
-
 
3280
    if( modified_gp_leds & (1 << 13) ) value |= (1 << 3);
-
 
3281
    if( pos_marker_mask  & (1 << 13) ) value |= (1 << 2);
-
 
3282
-
 
3283
    if( modified_gp_leds & (1 << 14) ) value |= (1 << 5);
-
 
3284
    if( pos_marker_mask  & (1 << 14) ) value |= (1 << 4);
-
 
3285
-
 
3286
    if( modified_gp_leds & (1 << 15) ) value |= (1 << 7);
-
 
3287
    if( pos_marker_mask  & (1 << 15) ) value |= (1 << 6);
-
 
3288
3251
    BLM_X_LED_rows[5][0] = value;
3289
    seq_blm8x8_led_row[1][5] = value;
3252
      }
3290
      }
3253
3291
3254
3292
3255
      // BLM_X DOUT -> Select LED mapping
3293
      // BLM_X DOUT -> Select LED mapping
3256
      // like above, just next SR
3294
      // like above, just next SR
Line 3269... Line 3307...
3269
    if( ui_select_leds_red   & (1 << 2) ) value |= (1 << 4);
3307
    if( ui_select_leds_red   & (1 << 2) ) value |= (1 << 4);
3270
3308
3271
    if( ui_select_leds_green & (1 << 3) ) value |= (1 << 7);
3309
    if( ui_select_leds_green & (1 << 3) ) value |= (1 << 7);
3272
    if( ui_select_leds_red   & (1 << 3) ) value |= (1 << 6);
3310
    if( ui_select_leds_red   & (1 << 3) ) value |= (1 << 6);
3273
3311
3274
    BLM_X_LED_rows[2][0] = value;
3312
    seq_blm8x8_led_row[0][2] = value;
3275
      }
3313
      }
3276
3314
3277
      // Select row, second quarter
3315
      // Select row, second quarter
3278
      {
3316
      {
3279
    u8 value = 0;
3317
    u8 value = 0;
Line 3288... Line 3326...
3288
    if( ui_select_leds_red   & (1 << 6) ) value |= (1 << 4);
3326
    if( ui_select_leds_red   & (1 << 6) ) value |= (1 << 4);
3289
3327
3290
    if( ui_select_leds_green & (1 << 7) ) value |= (1 << 7);
3328
    if( ui_select_leds_green & (1 << 7) ) value |= (1 << 7);
3291
    if( ui_select_leds_red   & (1 << 7) ) value |= (1 << 6);
3329
    if( ui_select_leds_red   & (1 << 7) ) value |= (1 << 6);
3292
3330
-
 
3331
    seq_blm8x8_led_row[0][6] = value;
-
 
3332
      }
-
 
3333
-
 
3334
      // Select row, third quarter
-
 
3335
      {
-
 
3336
    u8 value = 0;
-
 
3337
-
 
3338
    if( ui_select_leds_green & (1 << 8) ) value |= (1 << 0);
-
 
3339
    if( ui_select_leds_red   & (1 << 8) ) value |= (1 << 1);
-
 
3340
-
 
3341
    if( ui_select_leds_green & (1 << 9) ) value |= (1 << 3);
-
 
3342
    if( ui_select_leds_red   & (1 << 9) ) value |= (1 << 2);
-
 
3343
-
 
3344
    if( ui_select_leds_green & (1 << 10) ) value |= (1 << 5);
-
 
3345
    if( ui_select_leds_red   & (1 << 10) ) value |= (1 << 4);
-
 
3346
-
 
3347
    if( ui_select_leds_green & (1 << 11) ) value |= (1 << 7);
-
 
3348
    if( ui_select_leds_red   & (1 << 11) ) value |= (1 << 6);
-
 
3349
-
 
3350
    seq_blm8x8_led_row[1][2] = value;
-
 
3351
      }
-
 
3352
-
 
3353
      // Select row, fourth quarter
-
 
3354
      {
-
 
3355
    u8 value = 0;
-
 
3356
-
 
3357
    if( ui_select_leds_green & (1 << 12) ) value |= (1 << 0);
-
 
3358
    if( ui_select_leds_red   & (1 << 12) ) value |= (1 << 1);
-
 
3359
-
 
3360
    if( ui_select_leds_green & (1 << 13) ) value |= (1 << 3);
-
 
3361
    if( ui_select_leds_red   & (1 << 13) ) value |= (1 << 2);
-
 
3362
-
 
3363
    if( ui_select_leds_green & (1 << 14) ) value |= (1 << 5);
-
 
3364
    if( ui_select_leds_red   & (1 << 14) ) value |= (1 << 4);
-
 
3365
-
 
3366
    if( ui_select_leds_green & (1 << 15) ) value |= (1 << 7);
-
 
3367
    if( ui_select_leds_red   & (1 << 15) ) value |= (1 << 6);
-
 
3368
3293
    BLM_X_LED_rows[6][0] = value;
3369
    seq_blm8x8_led_row[1][6] = value;
3294
      }
3370
      }
3295
    }
3371
    }
3296
  }
3372
  }
3297
3373
3298
  return 0; // no error
3374
  return 0; // no error