• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ eeconfig_init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中eeconfig_init函数的典型用法代码示例。如果您正苦于以下问题:C++ eeconfig_init函数的具体用法?C++ eeconfig_init怎么用?C++ eeconfig_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了eeconfig_init函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rgb_matrix_init

void rgb_matrix_init(void) {
  rgb_matrix_driver.init();

  // TODO: put the 1 second startup delay here?

#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
  g_last_hit_tracker.count = 0;
  for (uint8_t i = 0; i < LED_HITS_TO_REMEMBER; ++i) {
    g_last_hit_tracker.tick[i] = UINT16_MAX;
  }

  last_hit_buffer.count = 0;
  for (uint8_t i = 0; i < LED_HITS_TO_REMEMBER; ++i) {
    last_hit_buffer.tick[i] = UINT16_MAX;
  }
#endif // RGB_MATRIX_KEYREACTIVE_ENABLED

  if (!eeconfig_is_enabled()) {
    dprintf("rgb_matrix_init_drivers eeconfig is not enabled.\n");
    eeconfig_init();
    eeconfig_update_rgb_matrix_default();
  }

  rgb_matrix_config.raw = eeconfig_read_rgb_matrix();
  rgb_matrix_config.speed = UINT8_MAX / 2; //EECONFIG needs to be increased to support this
  if (!rgb_matrix_config.mode) {
    dprintf("rgb_matrix_init_drivers rgb_matrix_config.mode = 0. Write default values to EEPROM.\n");
    eeconfig_update_rgb_matrix_default();
    rgb_matrix_config.raw = eeconfig_read_rgb_matrix();
  }
  eeconfig_debug_rgb_matrix(); // display current eeprom values
}
开发者ID:Xyverz,项目名称:qmk_firmware,代码行数:32,代码来源:rgb_matrix.c


示例2: process_record_user

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch (keycode) {
    // dynamically generate these.
    case EPRM:
      if (record->event.pressed) {
        eeconfig_init();
      }
      return false;
      break;
    case VRSN:
      if (record->event.pressed) {
        SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
      }
      return false;
      break;
    case RGB_SLD:
      if (record->event.pressed) {
        #ifdef RGBLIGHT_ENABLE
          rgblight_mode(1);
        #endif
      }
      return false;
      break;
  }
  return true;
}
开发者ID:0xdec,项目名称:qmk_firmware,代码行数:26,代码来源:keymap.c


示例3: switch

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
  // MACRODOWN only works in this function
  switch(id) {
    case 0:
    if (record->event.pressed) {
      SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
    }
    break;
    case 1:
    if (record->event.pressed) { // For resetting EEPROM
      eeconfig_init();
    }
    break;
#ifdef CFQ_USE_EXPEREMENTAL_LAYER
    case M_SPACES_1:
      if (record->event.pressed) { return MACRO(T(SPC), END); }
    case M_SPACES_2:
      if (record->event.pressed) { return MACRO(T(SPC), T(SPC), END); }
    case M_SPACES_3:
      if (record->event.pressed) { return MACRO(T(SPC), T(SPC), T(SPC), END); }
    case M_SPACES_4:
      if (record->event.pressed) { return MACRO(T(SPC), T(SPC), T(SPC), T(SPC), END); }
    case M_SPACES_5:
      if (record->event.pressed) { return MACRO(T(SPC), T(SPC), T(SPC), T(SPC), T(SPC), END); }
    case M_SPACES_6:
      if (record->event.pressed) { return MACRO(T(SPC), T(SPC), T(SPC), T(SPC), T(SPC), T(SPC), END); }
    case M_SPACES_7:
      if (record->event.pressed) { return MACRO(T(SPC), T(SPC), T(SPC), T(SPC), T(SPC), T(SPC), T(SPC), END); }
    case M_SPACES_8:
      if (record->event.pressed) { return MACRO(T(SPC), T(SPC), T(SPC), T(SPC), T(SPC), T(SPC), T(SPC), T(SPC), END); }
#endif // CFQ_USE_EXPEREMENTAL_LAYER
    case M_BRACKET_IN_CBR: // {}
      if (record->event.pressed) { return MACRO(D(LSFT), T(LBRC), T(RBRC), U(LSFT), T(LEFT), END); }
    case M_BRACKET_IN_PRN: // ()
      if (record->event.pressed) { return MACRO(D(LSFT), T(9), T(0), U(LSFT), T(LEFT), END); }
    case M_BRACKET_IN_BRC: // []
      if (record->event.pressed) { return MACRO(T(LBRC), T(RBRC), T(LEFT), END); }
    case M_BRACKET_IN_ANG: // <>
      if (record->event.pressed) { return MACRO(D(LSFT), T(COMM), T(DOT), U(LSFT), T(LEFT), END); }
    case M_BRACKET_OUT_CBR: // }{
      if (record->event.pressed) { return MACRO(D(LSFT), T(RBRC), T(LBRC), U(LSFT), T(LEFT), END); }
    case M_BRACKET_OUT_PRN: // )(
      if (record->event.pressed) { return MACRO(D(LSFT), T(0), T(9), U(LSFT), T(LEFT), END); }
    case M_BRACKET_OUT_BRC: // ][
      if (record->event.pressed) { return MACRO(T(RBRC), T(LBRC), T(LEFT), END); }
    case M_BRACKET_OUT_ANG: // ><
      if (record->event.pressed) { return MACRO(D(LSFT), T(DOT), T(COMM), U(LSFT), T(LEFT), END); }

    case M_ARROW_RMINUS:
      if (record->event.pressed) { return MACRO(T(MINUS), D(LSFT), T(DOT), U(LSFT), END); }
    case M_ARROW_LMINUS:
      if (record->event.pressed) { return MACRO(D(LSFT), T(COMM), U(LSFT), T(MINUS), END); }
    case M_ARROW_REQL:
      if (record->event.pressed) { return MACRO(T(EQL), D(LSFT), T(DOT), U(LSFT), END); }
    case M_ARROW_LEQL:
      if (record->event.pressed) { return MACRO(D(LSFT), T(COMM), U(LSFT), T(EQL), END); }
  }
  return MACRO_NONE;
};
开发者ID:ScrelliCopter,项目名称:qmk_firmware,代码行数:60,代码来源:keymap.c


示例4: rgblight_init

void rgblight_init(void) {
  debug_enable = 1; // Debug ON!
  dprintf("rgblight_init called.\n");
  dprintf("rgblight_init start!\n");
  if (!eeconfig_is_enabled()) {
    dprintf("rgblight_init eeconfig is not enabled.\n");
    eeconfig_init();
    eeconfig_update_rgblight_default();
  }
  rgblight_config.raw = eeconfig_read_rgblight();
  if (!rgblight_config.mode) {
    dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n");
    eeconfig_update_rgblight_default();
    rgblight_config.raw = eeconfig_read_rgblight();
  }
  eeconfig_debug_rgblight(); // display current eeprom values

  #ifdef RGBLIGHT_ANIMATIONS
    rgblight_timer_init(); // setup the timer
  #endif

  if (rgblight_config.enable) {
    rgblight_mode_noeeprom(rgblight_config.mode);
  }
}
开发者ID:anechiporuk,项目名称:qmk_firmware,代码行数:25,代码来源:rgblight.c


示例5: backlight_init

void backlight_init(void)
{
    /* check signature */
    if (!eeconfig_is_enabled()) {
        eeconfig_init();
    }
    backlight_config.raw = eeconfig_read_backlight();
    backlight_set(backlight_config.enable ? backlight_config.level : 0);
}
开发者ID:kairyu,项目名称:tmk_core_custom,代码行数:9,代码来源:backlight.c


示例6: process_record_user

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch (keycode) {
    case DVORAK:
      if (record->event.pressed) {
        set_single_persistent_default_layer(_DVORAK);
      }
      return false;
      break;
    case BACKLIT:
      if (record->event.pressed) {
        register_code(KC_RSFT);
        #ifdef BACKLIGHT_ENABLE
          backlight_step();
        #endif
        #ifdef KEYBOARD_planck_rev5
          PORTE &= ~(1<<6);
        #endif
      } else {
        unregister_code(KC_RSFT);
        #ifdef KEYBOARD_planck_rev5
          PORTE |= (1<<6);
        #endif
      }
      return false;
      break;
    case PLOVER:
      if (record->event.pressed) {
        #ifdef AUDIO_ENABLE
          stop_all_notes();
          PLAY_SONG(plover_song);
        #endif
        layer_off(_CUSTOM);
        layer_off(_RAISE);
        layer_off(_LOWER);
        layer_off(_ADJUST);
        layer_on(_PLOVER);
        if (!eeconfig_is_enabled()) {
            eeconfig_init();
        }
        keymap_config.raw = eeconfig_read_keymap();
        keymap_config.nkro = 1;
        eeconfig_update_keymap(keymap_config.raw);
      }
      return false;
      break;
    case EXT_PLV:
      if (record->event.pressed) {
        #ifdef AUDIO_ENABLE
          PLAY_SONG(plover_gb_song);
        #endif
        layer_off(_PLOVER);
      }
      return false;
      break;
  }
  return true;
}
开发者ID:david-pitty,项目名称:planck_layout,代码行数:57,代码来源:keymap.c


示例7: process_record_user

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch (keycode) {
    case QWERTY:
      if (record->event.pressed) {
        print("mode just switched to qwerty and this is a huge string\n");
        set_single_persistent_default_layer(_QWERTY);
      }
      return false; break;
    case LOWER:
      if (record->event.pressed) {
        layer_on(_LOWER);
        update_tri_layer(_LOWER, _RAISE, _ADJUST);
      } else {
        layer_off(_LOWER);
        update_tri_layer(_LOWER, _RAISE, _ADJUST);
      }
      return false; break;
    case RAISE:
      if (record->event.pressed) {
        layer_on(_RAISE);
        update_tri_layer(_LOWER, _RAISE, _ADJUST);
      } else {
        layer_off(_RAISE);
        update_tri_layer(_LOWER, _RAISE, _ADJUST);
      }
      return false; break;
    case PLOVER:
      if (record->event.pressed) {
        #ifdef AUDIO_ENABLE
          stop_all_notes();
          PLAY_SONG(plover_song);
        #endif
        layer_off(_RAISE);
        layer_off(_LOWER);
        layer_off(_ADJUST);
        layer_on(_PLOVER);
        if (!eeconfig_is_enabled()) {
            eeconfig_init();
        }
        keymap_config.raw = eeconfig_read_keymap();
        keymap_config.nkro = 1;
        eeconfig_update_keymap(keymap_config.raw);
      }
      return false; break;
    case EXT_PLV:
      if (record->event.pressed) {
        #ifdef AUDIO_ENABLE
          PLAY_SONG(plover_gb_song);
        #endif
        layer_off(_PLOVER);
      }
      return false; break;
  }
  return true;
}
开发者ID:0tsuki,项目名称:qmk_firmware,代码行数:55,代码来源:keymap.c


示例8: audio_init

void audio_init() {

  if (audio_initialized) {
    return;
  }

  // Check EEPROM
  #if defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE)
    if (!eeconfig_is_enabled()) {
      eeconfig_init();
    }
    audio_config.raw = eeconfig_read_audio();
#else // ARM EEPROM
    audio_config.enable = true;
  #ifdef AUDIO_CLICKY_ON
    audio_config.clicky_enable = true;
  #endif
#endif // ARM EEPROM

  /*
   * Starting DAC1 driver, setting up the output pin as analog as suggested
   * by the Reference Manual.
   */
  palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG);
  palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG);
  dacStart(&DACD1, &dac1cfg1);
  dacStart(&DACD2, &dac1cfg2);

  /*
   * Starting GPT6/7 driver, it is used for triggering the DAC.
   */
  START_CHANNEL_1();
  START_CHANNEL_2();

  /*
   * Starting a continuous conversion.
   */
  dacStartConversion(&DACD1, &dacgrpcfg1, (dacsample_t *)dac_buffer, DAC_BUFFER_SIZE);
  dacStartConversion(&DACD2, &dacgrpcfg2, (dacsample_t *)dac_buffer_2, DAC_BUFFER_SIZE);

  audio_initialized = true;

  if (audio_config.enable) {
    PLAY_SONG(startup_song);
  } else {
    stop_all_notes();
  }

}
开发者ID:Talljoe,项目名称:qmk_firmware,代码行数:49,代码来源:audio_arm.c


示例9: eeconfig_init

/*
 * Macro definition
 */
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    if (!eeconfig_is_enabled()) {
      eeconfig_init();
    }

    switch (id) {
      case KC_DEMOMACRO:
        if (record->event.pressed){
          return MACRO (I(1), T(H),T(E),T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D),  END);
        }
    }

    return MACRO_NONE;
}
开发者ID:0tsuki,项目名称:qmk_firmware,代码行数:18,代码来源:keymap.c


示例10: process_record_user

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch (keycode) {
    case STENO:
      if (record->event.pressed) {
#ifdef AUDIO_ENABLE
        stop_all_notes();
        PLAY_SONG(plover_song);
#endif
        layer_off(RAISE_LAYER);
        layer_off(LOWER_LAYER);
        layer_off(ADJUST_LAYER);
        layer_on(STENO_LAYER);
        if (!eeconfig_is_enabled()) {
          eeconfig_init();
        }
        keymap_config.raw = eeconfig_read_keymap();
        keymap_config.nkro = 1;
        eeconfig_update_keymap(keymap_config.raw);
        plover_resume();
      }
      return false;
    case PV_EXIT:
      if (record->event.pressed) {
#ifdef AUDIO_ENABLE
        PLAY_SONG(plover_gb_song);
#endif
        plover_suspend();
        layer_off(STENO_LAYER);
      }
      return false;
    case PV_LOOK:
      if (record->event.pressed) {
        plover_lookup();
      }
      return false;
    case SEND_VERSION:
      if (record->event.pressed) {
        SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION " (" QMK_BUILDDATE ")");
      }
      return false;
    case SEND_MAKE:
      if (record->event.pressed) {
        SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP ":dfu\n");
      }
      return false;
  }
  return true;
}
开发者ID:algernon,项目名称:qmk_firmware,代码行数:48,代码来源:keymap.c


示例11: switch

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
  // MACRODOWN only works in this function
      switch(id) {
        case 0:
        if (record->event.pressed) {
          SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
        }
        break;
        case 1:
        if (record->event.pressed) { // For resetting EEPROM
          eeconfig_init();
        }
        break;
      }
    return MACRO_NONE;
};
开发者ID:robotmaxtron,项目名称:qmk_firmware,代码行数:17,代码来源:keymap.c


示例12: switch

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
  switch (id)
  {
  case F_PASTE:
    if (record->event.pressed)
    {
      register_code(KC_LCTL);
      register_code(KC_V);
      unregister_code(KC_V);
      unregister_code(KC_LCTL);
    }
    break;
  case RGB_ANI:
    if (record->event.pressed)
    {
      rgb_timer = timer_read();
    }
    else
    {
      if (timer_elapsed(rgb_timer) > 300)
      {
        rgblight_mode(1);
      }
      else
      {
        rgblight_step();
      }
    }
  case CF_EPRM:
    if (record->event.pressed)
    {
      eeconfig_init();
    }
    return false;
    break;
  case CF_VERS:
    if (record->event.pressed)
    {
      SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
    }
    return false;
    break;
  }
  return MACRO_NONE;
};
开发者ID:berfarah,项目名称:qmk_firmware,代码行数:46,代码来源:keymap.c


示例13: process_record_user

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch (keycode) {
    // dynamically generate these.
    case EPRM:
      if (record->event.pressed) {
        eeconfig_init();
      }
      return false;
      break;
    case VRSN:
      if (record->event.pressed) {
        SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
      }
      return false;
      break;
  }
  return true;
}
开发者ID:Bubblepoint,项目名称:qmk_firmware,代码行数:18,代码来源:keymap.c


示例14: magic

void magic(void)
{
    /* check signature */
    if (!eeconfig_is_enabled()) {
        eeconfig_init();
    }

    /* debug enable */
    debug_config.raw = eeconfig_read_debug();

    /* keymap config */
    keymap_config.raw = eeconfig_read_keymap();

    uint8_t default_layer = 0;
    default_layer = eeconfig_read_default_layer();
    default_layer_set((uint32_t)default_layer);

}
开发者ID:0tsuki,项目名称:qmk_firmware,代码行数:18,代码来源:magic.c


示例15: matrix_init_quantum

void matrix_init_quantum() {
  #ifdef BOOTMAGIC_LITE
    bootmagic_lite();
  #endif
  if (!eeconfig_is_enabled()) {
    eeconfig_init();
  }
  #ifdef BACKLIGHT_ENABLE
    backlight_init_ports();
  #endif
  #ifdef AUDIO_ENABLE
    audio_init();
  #endif
  #ifdef RGB_MATRIX_ENABLE
    rgb_matrix_init();
  #endif
  #ifdef ENCODER_ENABLE
    encoder_init();
  #endif
  matrix_init_kb();
}
开发者ID:oli-obk,项目名称:qmk_firmware,代码行数:21,代码来源:quantum.c


示例16: audio_init

void audio_init() {

    /* check signature */
    if (!eeconfig_is_enabled()) {
        eeconfig_init();
    }
    audio_config.raw = eeconfig_read_audio();

    #ifdef PWM_AUDIO
        PLLFRQ = _BV(PDIV2);
        PLLCSR = _BV(PLLE);
        while(!(PLLCSR & _BV(PLOCK)));
        PLLFRQ |= _BV(PLLTM0); /* PCK 48MHz */

        /* Init a fast PWM on Timer4 */
        TCCR4A = _BV(COM4A0) | _BV(PWM4A); /* Clear OC4A on Compare Match */
        TCCR4B = _BV(CS40); /* No prescaling => f = PCK/256 = 187500Hz */
        OCR4A = 0;

        /* Enable the OC4A output */
        DDRC |= _BV(PORTC6);

        TIMSK3 &= ~_BV(OCIE3A); // Turn off 3A interputs

        TCCR3A = 0x0; // Options not needed
        TCCR3B = _BV(CS31) | _BV(CS30) | _BV(WGM32); // 64th prescaling and CTC
        OCR3A = SAMPLE_DIVIDER - 1; // Correct count/compare, related to sample playback
    #else
        DDRC |= _BV(PORTC6);

        TIMSK3 &= ~_BV(OCIE3A); // Turn off 3A interputs

        TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
        TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30);
    #endif

    inited = true;
}
开发者ID:DonHansDampf,项目名称:qmk_firmware,代码行数:38,代码来源:audio.c


示例17: rgblight_init

void rgblight_init(void) {
  /* if already initialized, don't do it again.
     If you must do it again, extern this and set to false, first.
     This is a dirty, dirty hack until proper hooks can be added for keyboard startup. */
  if (is_rgblight_initialized) { return; }

  debug_enable = 1; // Debug ON!
  dprintf("rgblight_init called.\n");
  dprintf("rgblight_init start!\n");
  if (!eeconfig_is_enabled()) {
    dprintf("rgblight_init eeconfig is not enabled.\n");
    eeconfig_init();
    eeconfig_update_rgblight_default();
  }
  rgblight_config.raw = eeconfig_read_rgblight();
  RGBLIGHT_SPLIT_SET_CHANGE_HSVS;
  if (!rgblight_config.mode) {
    dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n");
    eeconfig_update_rgblight_default();
    rgblight_config.raw = eeconfig_read_rgblight();
  }
  rgblight_check_config();

  eeconfig_debug_rgblight(); // display current eeprom values

#ifdef RGBLIGHT_USE_TIMER
    rgblight_timer_init(); // setup the timer
#endif

  if (rgblight_config.enable) {
    rgblight_mode_noeeprom(rgblight_config.mode);
  }

  is_rgblight_initialized = true;

}
开发者ID:Xyverz,项目名称:qmk_firmware,代码行数:36,代码来源:rgblight.c


示例18: audio_init

void audio_init()
{

    // Check EEPROM
    if (!eeconfig_is_enabled())
    {
        eeconfig_init();
    }
    audio_config.raw = eeconfig_read_audio();

	// Set port PC6 (OC3A and /OC4A) as output
    DDRC |= _BV(PORTC6);

    DISABLE_AUDIO_COUNTER_3_ISR;

	// TCCR3A / TCCR3B: Timer/Counter #3 Control Registers
	// Compare Output Mode (COM3An) = 0b00 = Normal port operation, OC3A disconnected from PC6
	// Waveform Generation Mode (WGM3n) = 0b1110 = Fast PWM Mode 14 (Period = ICR3, Duty Cycle = OCR3A)
	// Clock Select (CS3n) = 0b010 = Clock / 8
    TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
    TCCR3B = (1 << WGM33)  | (1 << WGM32)  | (0 << CS32)  | (1 << CS31) | (0 << CS30);

    audio_initialized = true;
}
开发者ID:82times,项目名称:qmk_firmware,代码行数:24,代码来源:audio.c


示例19: switch

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
  // MACRODOWN only works in this function
      switch(id) {
        case 0:
        if (record->event.pressed) {
          register_code(KC_RSFT);
        } else {
          unregister_code(KC_RSFT);
        }
        break;
        case 1:
        if (record->event.pressed) { // For resetting EEPROM
          eeconfig_init();
        }
        break;
        case 2:
        if (record->event.pressed) { // For resetting EEPROM
          api_send_unicode(0x0CA0);
        }
        break;
      }
    return MACRO_NONE;
};
开发者ID:2k0ri,项目名称:qmk_firmware,代码行数:24,代码来源:keymap.c


示例20: process_record_user

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch (keycode) {
        case QWERTY:
          if (record->event.pressed) {
            #ifdef AUDIO_ENABLE
              PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
            #endif
            persistent_default_layer_set(1UL<<_QWERTY);
          }
          break;
      return false;
        case COLEMAK:
          if (record->event.pressed) {
            #ifdef AUDIO_ENABLE
              PLAY_NOTE_ARRAY(tone_colemak, false, 0);
            #endif
            persistent_default_layer_set(1UL<<_COLEMAK);
          }
          break;
      return false;
        case DVORAK:
          if (record->event.pressed) {
            #ifdef AUDIO_ENABLE
              PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
            #endif
            persistent_default_layer_set(1UL<<_DVORAK);
          }
          break;
      return false;
        case LOWER:
          if (record->event.pressed) {
            layer_on(_LOWER);
            #ifdef BACKLIGHT_ENABLE
                breathing_speed_set(2);
                breathing_pulse();
            #endif
            update_tri_layer(_LOWER, _RAISE, _ADJUST);
          } else {
            layer_off(_LOWER);
            update_tri_layer(_LOWER, _RAISE, _ADJUST);
          }
          break;
      return false;
        case RAISE:
          if (record->event.pressed) {
            layer_on(_RAISE);
            #ifdef BACKLIGHT_ENABLE
                breathing_speed_set(2);
                breathing_pulse();
            #endif
            update_tri_layer(_LOWER, _RAISE, _ADJUST);
          } else {
            layer_off(_RAISE);
            update_tri_layer(_LOWER, _RAISE, _ADJUST);
          }
          break;
      return false;
        case BACKLIT:
          if (record->event.pressed) {
            register_code(KC_RSFT);
            #ifdef BACKLIGHT_ENABLE
              backlight_step();
            #endif
          } else {
            unregister_code(KC_RSFT);
          }
        break;
      return false;
        case PLOVER:
          if (record->event.pressed) {
            #ifdef AUDIO_ENABLE
              stop_all_notes();
              PLAY_NOTE_ARRAY(tone_plover, false, 0);
            #endif
            layer_off(_RAISE);
            layer_off(_LOWER);
            layer_off(_ADJUST);
            layer_on(_PLOVER);
            if (!eeconfig_is_enabled()) {
                eeconfig_init();
            }
            keymap_config.raw = eeconfig_read_keymap();
            keymap_config.nkro = 1;
            eeconfig_update_keymap(keymap_config.raw);
          }
        break;
      return false;
        case EXT_PLV:
          if (record->event.pressed) {
            #ifdef AUDIO_ENABLE
              PLAY_NOTE_ARRAY(tone_plover_gb, false, 0);
            #endif
            layer_off(_PLOVER);
          }
        break;
      return false;

    case RGBLED_TOGGLE:
      //led operations
      if (record->event.pressed) {
//.........这里部分代码省略.........
开发者ID:2k0ri,项目名称:qmk_firmware,代码行数:101,代码来源:keymap.c



注:本文中的eeconfig_init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ eeconfig_update_default_layer函数代码示例发布时间:2022-05-30
下一篇:
C++ edp_write函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap