mirror of
https://github.com/qmk/qmk_firmware
synced 2024-12-22 16:36:58 +00:00
Relocate backlight drivers (#21444)
This commit is contained in:
parent
636093f75d
commit
cb2331713c
@ -565,18 +565,18 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
COMMON_VPATH += $(QUANTUM_DIR)/backlight
|
COMMON_VPATH += $(QUANTUM_DIR)/backlight
|
||||||
|
COMMON_VPATH += $(DRIVER_PATH)/backlight
|
||||||
SRC += $(QUANTUM_DIR)/backlight/backlight.c
|
SRC += $(QUANTUM_DIR)/backlight/backlight.c
|
||||||
SRC += $(QUANTUM_DIR)/process_keycode/process_backlight.c
|
SRC += $(QUANTUM_DIR)/process_keycode/process_backlight.c
|
||||||
OPT_DEFS += -DBACKLIGHT_ENABLE
|
OPT_DEFS += -DBACKLIGHT_ENABLE
|
||||||
|
|
||||||
ifeq ($(strip $(BACKLIGHT_DRIVER)), custom)
|
ifneq ($(strip $(BACKLIGHT_DRIVER)), custom)
|
||||||
OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
|
|
||||||
else
|
|
||||||
SRC += $(QUANTUM_DIR)/backlight/backlight_driver_common.c
|
SRC += $(QUANTUM_DIR)/backlight/backlight_driver_common.c
|
||||||
ifeq ($(strip $(BACKLIGHT_DRIVER)), pwm)
|
|
||||||
SRC += $(QUANTUM_DIR)/backlight/backlight_$(PLATFORM_KEY).c
|
ifeq ($(strip $(BACKLIGHT_DRIVER)), software)
|
||||||
|
SRC += $(DRIVER_PATH)/backlight/backlight_software.c
|
||||||
else
|
else
|
||||||
SRC += $(QUANTUM_DIR)/backlight/backlight_$(strip $(BACKLIGHT_DRIVER)).c
|
SRC += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/backlight_$(strip $(BACKLIGHT_DRIVER)).c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "quantum.h"
|
|
||||||
#include "backlight.h"
|
#include "backlight.h"
|
||||||
#include "backlight_driver_common.h"
|
#include "backlight_driver_common.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
#ifdef BACKLIGHT_BREATHING
|
#ifdef BACKLIGHT_BREATHING
|
||||||
# error "Backlight breathing is not available for software PWM. Please disable."
|
# error "Backlight breathing is not available for software PWM. Please disable."
|
@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD2
|
#define BACKLIGHT_PWM_DRIVER PWMD2
|
||||||
#define BACKLIGHT_PWM_CHANNEL 4
|
#define BACKLIGHT_PWM_CHANNEL 4
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
/* Underglow */
|
/* Underglow */
|
||||||
#define WS2812_SPI SPID1
|
#define WS2812_SPI SPID1
|
||||||
|
@ -23,7 +23,7 @@ void board_init(void) {
|
|||||||
|
|
||||||
void keyboard_post_init_kb(void){
|
void keyboard_post_init_kb(void){
|
||||||
// Defining the backlight pin (A6) as an floating (no pullup or pulldown resistor) opendrain output pin
|
// Defining the backlight pin (A6) as an floating (no pullup or pulldown resistor) opendrain output pin
|
||||||
palSetLineMode(BACKLIGHT_PIN, PAL_MODE_ALTERNATE(BACKLIGHT_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUPDR_FLOATING);
|
palSetLineMode(BACKLIGHT_PIN, PAL_MODE_ALTERNATE(2) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUPDR_FLOATING);
|
||||||
}
|
}
|
||||||
|
|
||||||
void led_init_ports(void) {
|
void led_init_ports(void) {
|
||||||
|
@ -22,7 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD3
|
#define BACKLIGHT_PWM_DRIVER PWMD3
|
||||||
#define BACKLIGHT_PWM_CHANNEL 1
|
#define BACKLIGHT_PWM_CHANNEL 1
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define RGBLIGHT_EFFECT_BREATHING
|
#define RGBLIGHT_EFFECT_BREATHING
|
||||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||||
|
@ -21,8 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define LOCKING_RESYNC_ENABLE
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD3
|
#define BACKLIGHT_PWM_DRIVER PWMD3
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define RGBLIGHT_EFFECT_BREATHING
|
#define RGBLIGHT_EFFECT_BREATHING
|
||||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||||
|
@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD3
|
#define BACKLIGHT_PWM_DRIVER PWMD3
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
|
|
||||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
#define LOCKING_SUPPORT_ENABLE
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
@ -22,7 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD3
|
#define BACKLIGHT_PWM_DRIVER PWMD3
|
||||||
#define BACKLIGHT_PWM_CHANNEL 1
|
#define BACKLIGHT_PWM_CHANNEL 1
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define RGBLIGHT_EFFECT_BREATHING
|
#define RGBLIGHT_EFFECT_BREATHING
|
||||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||||
|
@ -17,8 +17,6 @@ Copyright 2021 Nathan Spears
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD3
|
|
||||||
|
|
||||||
// ws2812 options
|
// ws2812 options
|
||||||
#define RGBLIGHT_EFFECT_BREATHING
|
#define RGBLIGHT_EFFECT_BREATHING
|
||||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD1
|
#define BACKLIGHT_PWM_DRIVER PWMD1
|
||||||
#define BACKLIGHT_PWM_CHANNEL 2
|
#define BACKLIGHT_PWM_CHANNEL 2
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef OLED_ENABLE
|
#ifdef OLED_ENABLE
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
/* Backlight */
|
/* Backlight */
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD1
|
#define BACKLIGHT_PWM_DRIVER PWMD1
|
||||||
#define BACKLIGHT_PWM_CHANNEL 2
|
#define BACKLIGHT_PWM_CHANNEL 2
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
#define BACKLIGHT_PWM_OUTPUT_FREQUENCY 1000 // Increases backlight PWM freq if compiled with an unmerged PR. Does no harm without it.
|
#define BACKLIGHT_PWM_OUTPUT_FREQUENCY 1000 // Increases backlight PWM freq if compiled with an unmerged PR. Does no harm without it.
|
||||||
|
|
||||||
/* Underglow */
|
/* Underglow */
|
||||||
|
@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD1
|
#define BACKLIGHT_PWM_DRIVER PWMD1
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
#define BACKLIGHT_PAL_MODE 1
|
#define BACKLIGHT_PAL_MODE 1
|
||||||
|
|
||||||
#define I2C_DRIVER I2CD1
|
#define I2C_DRIVER I2CD1
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD5
|
#define BACKLIGHT_PWM_DRIVER PWMD5
|
||||||
#define BACKLIGHT_PWM_CHANNEL 1
|
#define BACKLIGHT_PWM_CHANNEL 1
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define ADC_PIN A0
|
#define ADC_PIN A0
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD5
|
#define BACKLIGHT_PWM_DRIVER PWMD5
|
||||||
#define BACKLIGHT_PWM_CHANNEL 1
|
#define BACKLIGHT_PWM_CHANNEL 1
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define ADC_PIN A0
|
#define ADC_PIN A0
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD5
|
#define BACKLIGHT_PWM_DRIVER PWMD5
|
||||||
#define BACKLIGHT_PWM_CHANNEL 1
|
#define BACKLIGHT_PWM_CHANNEL 1
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define ADC_PIN A0
|
#define ADC_PIN A0
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD5
|
#define BACKLIGHT_PWM_DRIVER PWMD5
|
||||||
#define BACKLIGHT_PWM_CHANNEL 1
|
#define BACKLIGHT_PWM_CHANNEL 1
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define ADC_PIN A0
|
#define ADC_PIN A0
|
||||||
|
|
||||||
|
@ -3,13 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#define ADC_PIN A0
|
#define ADC_PIN A0
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD4
|
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4)))
|
#define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4)))
|
||||||
|
|
||||||
#define SOLENOID_PIN B12
|
#define SOLENOID_PIN B12
|
||||||
|
@ -3,13 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#define ADC_PIN A0
|
#define ADC_PIN A0
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD4
|
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4)))
|
#define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4)))
|
||||||
|
|
||||||
#define SOLENOID_PIN B12
|
#define SOLENOID_PIN B12
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD4
|
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define ADC_PIN A0
|
#define ADC_PIN A0
|
||||||
|
|
||||||
#define SOLENOID_PINS { B12, B13, B14, B15 }
|
#define SOLENOID_PINS { B12, B13, B14, B15 }
|
||||||
|
@ -2,9 +2,4 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD4
|
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define ADC_PIN A0
|
#define ADC_PIN A0
|
||||||
|
@ -16,9 +16,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD4
|
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
|
|
||||||
#define ADC_PIN A0
|
#define ADC_PIN A0
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP25
|
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP25
|
||||||
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U
|
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD4
|
|
||||||
#define BACKLIGHT_PWM_CHANNEL RP2040_PWM_CHANNEL_B
|
#define BACKLIGHT_PWM_CHANNEL RP2040_PWM_CHANNEL_B
|
||||||
|
|
||||||
#define AUDIO_PIN GP16
|
#define AUDIO_PIN GP16
|
||||||
|
@ -16,9 +16,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD3
|
#define BACKLIGHT_PWM_DRIVER PWMD3
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
#define BACKLIGHT_PAL_MODE 0
|
#define BACKLIGHT_PAL_MODE 0
|
||||||
|
|
||||||
#define ADC_PIN A0
|
#define ADC_PIN A0
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
/* Copyright 2020 Imam Rafii
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD5
|
|
||||||
#define BACKLIGHT_PWM_CHANNEL 1
|
|
@ -19,5 +19,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD2
|
#define BACKLIGHT_PWM_DRIVER PWMD2
|
||||||
#define BACKLIGHT_PWM_CHANNEL 2
|
#define BACKLIGHT_PWM_CHANNEL 2
|
||||||
#define BACKLIGHT_PAL_MODE 2
|
|
||||||
#define BACKLIGHT_PWM_OUTPUT_FREQUENCY 1000 // Increases backlight PWM freq if compiled with an unmerged PR. Does no harm without it.
|
#define BACKLIGHT_PWM_OUTPUT_FREQUENCY 1000 // Increases backlight PWM freq if compiled with an unmerged PR. Does no harm without it.
|
||||||
|
@ -15,7 +15,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD1
|
#define BACKLIGHT_PWM_DRIVER PWMD1
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
#define BACKLIGHT_PAL_MODE 6
|
#define BACKLIGHT_PAL_MODE 6
|
||||||
#define BACKLIGHT_PWM_OUTPUT_FREQUENCY 1000 // Increases backlight PWM freq if compiled with an unmerged PR. Does no harm without it.
|
#define BACKLIGHT_PWM_OUTPUT_FREQUENCY 1000 // Increases backlight PWM freq if compiled with an unmerged PR. Does no harm without it.
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD3
|
#define BACKLIGHT_PWM_DRIVER PWMD3
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
|
|
||||||
#define RGBLIGHT_EFFECT_BREATHING
|
#define RGBLIGHT_EFFECT_BREATHING
|
||||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2020 Team Mechlovin
|
|
||||||
|
|
||||||
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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD4
|
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
@ -1,20 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2020 Team Mechlovin
|
|
||||||
|
|
||||||
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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD4
|
|
@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define BACKLIGHT_PWM_DRIVER PWMD3
|
#define BACKLIGHT_PWM_DRIVER PWMD3
|
||||||
#define BACKLIGHT_PWM_CHANNEL 3
|
|
||||||
|
|
||||||
#define WEAR_LEVELING_BACKING_SIZE 4096
|
#define WEAR_LEVELING_BACKING_SIZE 4096
|
||||||
#define WEAR_LEVELING_LOGICAL_SIZE 2048
|
#define WEAR_LEVELING_LOGICAL_SIZE 2048
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user