本文整理汇总了C++中eeconfig_init函数的典型用法代码示例。如果您正苦于以下问题:C++ eeconfig_init函数的具体用法?C++ eeconfig_init怎么用?C++ eeconfig_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eeconfig_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
示例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;
}
示例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;
};
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
};
示例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;
};
示例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;
}
示例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);
}
示例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();
}