diff --git a/keyboards/4pplet/eagle_viper_rep/rev_b/chconf.h b/keyboards/4pplet/eagle_viper_rep/rev_b/chconf.h new file mode 100644 index 000000000000..35fb8831836a --- /dev/null +++ b/keyboards/4pplet/eagle_viper_rep/rev_b/chconf.h @@ -0,0 +1,31 @@ +/* Copyright 2020 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/acheron/austin/chconf.h -r platforms/chibios/common/configs/chconf.h` + */ + +#pragma once + +#define CH_CFG_ST_FREQUENCY 10000 + +#define CH_CFG_OPTIMIZE_SPEED FALSE + +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +#include_next + diff --git a/keyboards/4pplet/eagle_viper_rep/rev_b/config.h b/keyboards/4pplet/eagle_viper_rep/rev_b/config.h index 5b3e5e080cb6..fb71feef9fc9 100644 --- a/keyboards/4pplet/eagle_viper_rep/rev_b/config.h +++ b/keyboards/4pplet/eagle_viper_rep/rev_b/config.h @@ -27,26 +27,30 @@ along with this program. If not, see . #define BACKLIGHT_PIN A6 #define BACKLIGHT_PWM_DRIVER PWMD3 #define BACKLIGHT_PWM_CHANNEL 1 -#define BACKLIGHT_PAL_MODE 2 +#define BACKLIGHT_PAL_MODE 1 +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 #define BACKLIGHT_ON_STATE 1 -#define BACKLIGHT_LEVELS 10 -#define BACKLIGHT_BREATHING TRUE - -// UPDATED: -// In switch on PA6 -// Underglow on PA8 like waffling80 /* Underglow */ #define RGBLED_NUM 16 #define WS2812_EXTERNAL_PULLUP #define RGB_DI_PIN A8 -#define WS2812_PWM_DRIVER PWMD1 -#define WS2812_PWM_CHANNEL 1 -#define WS2812_PWM_PAL_MODE 2 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 -//#define WS2812_PWM_COMPLEMENTARY_OUTPUT // Define for a complementary timer output (TIMx_CHyN); omit for a normal timer output (TIMx_CHy). -//#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -//#define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -//#define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. + +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE diff --git a/keyboards/4pplet/eagle_viper_rep/rev_b/rev_b.c b/keyboards/4pplet/eagle_viper_rep/rev_b/rev_b.c index 5b4d8e442629..f6fceea7a2ec 100644 --- a/keyboards/4pplet/eagle_viper_rep/rev_b/rev_b.c +++ b/keyboards/4pplet/eagle_viper_rep/rev_b/rev_b.c @@ -16,36 +16,29 @@ along with this program. If not, see . */ #include "rev_b.h" -void board_init(void) { - setPinInputHigh(CAPS_PIN); - setPinInputHigh(SCROLL_PIN); - setPinInputHigh(NUM_PIN); + + +void keyboard_pre_init_kb(void) { + setPinOutput(CAPS_PIN); + setPinOutput(SCROLL_PIN); + setPinOutput(NUM_PIN); + setPinOutput(LAYER_1); + setPinOutput(LAYER_2); + setPinOutput(LAYER_3); + setPinOutput(LAYER_4); + setPinOutput(LAYER_5); + keyboard_pre_init_user(); } /* Set indicator leds to indicate lock states */ bool led_update_kb(led_t led_state) { bool res = led_update_user(led_state); - if(res && LOCK_LIGHTS) { - if(led_state.caps_lock){ - setPinOutput(CAPS_PIN); - writePin(CAPS_PIN, 0); - } - else - setPinInputHigh(CAPS_PIN); - if(led_state.scroll_lock){ - setPinOutput(SCROLL_PIN); - writePin(SCROLL_PIN, 0); - } - else - setPinInputHigh(SCROLL_PIN); - if(led_state.num_lock){ - setPinOutput(NUM_PIN); - writePin(NUM_PIN, 0); - } - else - setPinInputHigh(NUM_PIN); + if (res && LOCK_LIGHTS) { + writePin(NUM_PIN, led_state.num_lock); + writePin(CAPS_PIN, led_state.caps_lock); + writePin(SCROLL_PIN, led_state.scroll_lock); } - return res; + return true; } layer_state_t layer_state_set_kb(layer_state_t state) { @@ -59,50 +52,45 @@ layer_state_t layer_state_set_kb(layer_state_t state) { void setLayerLed(layer_state_t state){ switch(get_highest_layer(state)){ case 0 : - setPinOutput(LAYER_1); - writePin(LAYER_1, 0); - setPinInputHigh(LAYER_2); - setPinInputHigh(LAYER_3); - setPinInputHigh(LAYER_4); - setPinInputHigh(LAYER_5); + writePin(LAYER_1, 1); + writePin(LAYER_2, 0); + writePin(LAYER_3, 0); + writePin(LAYER_4, 0); + writePin(LAYER_5, 0); break; case 1 : - setPinOutput(LAYER_2); - writePin(LAYER_2, 0); - setPinInputHigh(LAYER_1); - setPinInputHigh(LAYER_3); - setPinInputHigh(LAYER_4); - setPinInputHigh(LAYER_5); + writePin(LAYER_1, 0); + writePin(LAYER_2, 1); + writePin(LAYER_3, 0); + writePin(LAYER_4, 0); + writePin(LAYER_5, 0); break; case 2 : - setPinOutput(LAYER_3); - writePin(LAYER_3, 0); - setPinInputHigh(LAYER_1); - setPinInputHigh(LAYER_2); - setPinInputHigh(LAYER_4); - setPinInputHigh(LAYER_5); + writePin(LAYER_1, 0); + writePin(LAYER_2, 0); + writePin(LAYER_3, 1); + writePin(LAYER_4, 0); + writePin(LAYER_5, 0); break; case 3 : - writePin(LAYER_4, 0); - setPinInputHigh(LAYER_5); - setPinInputHigh(LAYER_1); - setPinInputHigh(LAYER_2); - setPinInputHigh(LAYER_3); - setPinOutput(LAYER_4); + writePin(LAYER_1, 0); + writePin(LAYER_2, 0); + writePin(LAYER_3, 0); + writePin(LAYER_4, 1); + writePin(LAYER_5, 0); break; case 4 : - setPinOutput(LAYER_5); - writePin(LAYER_5, 0); - setPinInputHigh(LAYER_1); - setPinInputHigh(LAYER_2); - setPinInputHigh(LAYER_3); - setPinInputHigh(LAYER_4); + writePin(LAYER_1, 0); + writePin(LAYER_2, 0); + writePin(LAYER_3, 0); + writePin(LAYER_4, 0); + writePin(LAYER_5, 1); break; default : - setPinInputHigh(LAYER_1); - setPinInputHigh(LAYER_2); - setPinInputHigh(LAYER_3); - setPinInputHigh(LAYER_4); - setPinInputHigh(LAYER_5); + writePin(LAYER_1, 0); + writePin(LAYER_2, 0); + writePin(LAYER_3, 0); + writePin(LAYER_4, 0); + writePin(LAYER_5, 0); } } diff --git a/keyboards/4pplet/eagle_viper_rep/rev_b/rules.mk b/keyboards/4pplet/eagle_viper_rep/rev_b/rules.mk index c15ca80916c9..877f1939f24d 100644 --- a/keyboards/4pplet/eagle_viper_rep/rev_b/rules.mk +++ b/keyboards/4pplet/eagle_viper_rep/rev_b/rules.mk @@ -14,9 +14,7 @@ CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = yes -# BACKLIGHT_DRIVER = pwm RGBLIGHT_ENABLE = yes -WS2812_DRIVER = pwm # Wildcard to allow APM32 MCU DFU_SUFFIX_ARGS = -p FFFF -v FFFF