void ergodox_blink_all_leds(void) { ergodox_led_all_off(); ergodox_led_all_set(LED_BRIGHTNESS_HI); ergodox_led_all_on(); _delay_ms(333); ergodox_led_all_off(); }
void matrix_init_user(void) { ergodox_led_all_on(); rgblight_init(); rgblight_enable(); rgblight_setrgb(255, 0, 0); for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { ergodox_led_all_set(i); wait_ms(5); } rgblight_setrgb(255, 255, 0); wait_ms(1000); for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { ergodox_led_all_set(i); wait_ms(10); } rgblight_setrgb(0, 255, 255); ergodox_led_all_off(); wait_ms(1000); rgblight_effect_knight(50); }
void UltramodSetLeds(void) { #ifdef ERGODOX ergodox_led_all_off(); // todo: Consider changing these so that they progress from left to right, or maybe right to left switch (ultramod.machine.state) { case NORMAL_STATE: break; case HELD_STATE: case MOMENTARY_STATE: ergodox_right_led_3_on(); // Blue break; case ONE_SHOT_STATE: ergodox_right_led_2_on(); // Green break; case LOCKED_STATE: ergodox_right_led_1_on(); // Red break; } // Something seems to keep resetting the brightness ergodox_led_all_set(LED_BRIGHTNESS_LO); #endif // ERGODOX }
void ergodox_blink_all_leds(void) { ergodox_led_all_off(); ergodox_led_all_set(LED_BRIGHTNESS_HI); ergodox_right_led_1_on(); _delay_ms(50); ergodox_right_led_2_on(); _delay_ms(50); ergodox_right_led_3_on(); _delay_ms(50); ergodox_right_led_1_off(); _delay_ms(50); ergodox_right_led_2_off(); _delay_ms(50); ergodox_right_led_3_off(); //ergodox_led_all_on(); //_delay_ms(333); ergodox_led_all_off(); }
// keyboard initialization void matrix_init_user() { ergodox_led_all_on(); for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { ergodox_led_all_set(i); wait_ms(5); } wait_ms(1000); for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { ergodox_led_all_set(i); wait_ms(10); } ergodox_led_all_off(); }
void SetNormalState(void) { // TODO: Do we have to do this here? clear_keyboard(); layer_clear(); #ifdef ERGODOX ergodox_led_all_off(); #endif // ERGODOX UltramodEventReset(); UltramodMachineReset(); }
void UltramodReset(void) { clear_keyboard(); layer_clear(); #ifdef ERGODOX ergodox_led_all_off(); #endif // ERGODOX UltramodSettingsReset(); UltramodEventReset(); UltramodMachineReset(); }
// Runs constantly in the background, in a loop. void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); ergodox_led_all_off(); ergodox_led_all_set(LED_BRIGHTNESS_LO); switch (layer) { case BASE: current_layer = BASE; break; case KEYPAD: current_layer = KEYPAD; break; default: // none break; } // layer leds if (current_layer == KEYPAD) { ergodox_right_led_3_on(); } // capslock if (host_keyboard_leds() & (3<<USB_LED_CAPS_LOCK)) { ergodox_right_led_1_on(); } // Temporary leds // The function layer takes over other layers and we need to reflect that on the leds. // If the current layer is the BASE, we simply turn on the FN led, but if the current // layer is the KEYPAD, than we must turn it off before turning on the FN led. if (layer == FN && !has_oneshot_layer_timed_out()) { ergodox_right_led_3_off(); ergodox_right_led_2_on(); } // if the shifted is pressed I show the case led in a brighter color. This is nice to // differenciate the shift from the capslock. // Notice that I make sure that we're not using the shift on a chord shortcut (pressing // shift togather with other modifiers). if((keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) && // is shift pressed and there is no other !(keyboard_report->mods & (~MOD_BIT(KC_LSFT) & ~MOD_BIT(KC_RSFT)))) || // modifier being pressed as well (get_oneshot_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) && !has_oneshot_mods_timed_out())) { // or the one shot shift didn't timed out ergodox_right_led_1_set(LED_BRIGHTNESS_HI); ergodox_right_led_1_on(); } };
uint32_t layer_state_set_user(uint32_t state) { ergodox_led_all_off(); switch (biton32(state)) { case FN: // Red led on Pro Micro for Fn layer ergodox_board_led_on(); break; }; if (CAPS_LED) { ergodox_right_led_1_on(); } default_layer_led_set(); return state; };
static void blink_led(uint8_t led) { ergodox_led_all_off(); ergodox_right_led_set(led, LED_BRIGHTNESS_HI); ergodox_right_led_on(led); _delay_ms(150); ergodox_right_led_off(led); _delay_ms(50); ergodox_right_led_on(led); _delay_ms(150); ergodox_right_led_off(led); _delay_ms(50); ergodox_right_led_on(led); _delay_ms(150); ergodox_right_led_off(led); }
void suspend_power_down_user(void) { ergodox_led_all_off(); };