コード例 #1
0
ファイル: rgblight.c プロジェクト: Xyverz/qmk_firmware
/* for split keyboard slave side */
void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom) {
    if (syncinfo->status.change_flags & RGBLIGHT_STATUS_CHANGE_MODE) {
        if (syncinfo->config.enable) {
            rgblight_config.enable = 1; // == rgblight_enable_noeeprom();
            rgblight_mode_eeprom_helper(syncinfo->config.mode, write_to_eeprom);
        } else {
            rgblight_disable_noeeprom();
        }
    }
    if (syncinfo->status.change_flags & RGBLIGHT_STATUS_CHANGE_HSVS) {
        rgblight_sethsv_eeprom_helper(syncinfo->config.hue, syncinfo->config.sat, syncinfo->config.val, write_to_eeprom);
        // rgblight_config.speed = config->speed; // NEED???
    }
  #ifdef RGBLIGHT_USE_TIMER
    if (syncinfo->status.change_flags & RGBLIGHT_STATUS_CHANGE_TIMER) {
        if (syncinfo->status.timer_enabled) {
            rgblight_timer_enable();
        } else {
            rgblight_timer_disable();
        }
    }
    #ifndef RGBLIGHT_SPLIT_NO_ANIMATION_SYNC
    if (syncinfo->status.change_flags & RGBLIGHT_STATUS_ANIMATION_TICK) {
        animation_status.restart = true;
    }
    #endif /* RGBLIGHT_SPLIT_NO_ANIMATION_SYNC */
  #endif /* RGBLIGHT_USE_TIMER */
}
コード例 #2
0
ファイル: rgblight.c プロジェクト: Xyverz/qmk_firmware
void rgblight_step_reverse_helper(bool write_to_eeprom) {
  uint8_t mode = 0;
  mode = rgblight_config.mode - 1;
  if (mode < 1) {
    mode = RGBLIGHT_MODES;
  }
  rgblight_mode_eeprom_helper(mode, write_to_eeprom);
}
コード例 #3
0
ファイル: rgblight.c プロジェクト: Xyverz/qmk_firmware
void rgblight_step_helper(bool write_to_eeprom) {
  uint8_t mode = 0;
  mode = rgblight_config.mode + 1;
  if (mode > RGBLIGHT_MODES) {
    mode = 1;
  }
  rgblight_mode_eeprom_helper(mode, write_to_eeprom);
}
コード例 #4
0
ファイル: rgblight.c プロジェクト: anechiporuk/qmk_firmware
void rgblight_mode_noeeprom(uint8_t mode) {
  rgblight_mode_eeprom_helper(mode, false);
}
コード例 #5
0
ファイル: rgblight.c プロジェクト: anechiporuk/qmk_firmware
void rgblight_mode(uint8_t mode) {
  rgblight_mode_eeprom_helper(mode, true);
}