forked from mirror/qmk_firmware
Refactor battery driver (#25550)
This commit is contained in:
@@ -3,4 +3,4 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define BATTERY_PIN ADC_PIN
|
||||
#define BATTERY_ADC_PIN ADC_PIN
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "battery.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
LAYOUT_ortho_1x1(KC_A)
|
||||
@@ -14,8 +13,6 @@ void keyboard_post_init_user(void) {
|
||||
// debug_matrix=false;
|
||||
// debug_keyboard=true;
|
||||
// debug_mouse=false;
|
||||
|
||||
battery_init();
|
||||
}
|
||||
|
||||
void housekeeping_task_user(void) {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
{
|
||||
"config": {
|
||||
"battery": {
|
||||
"driver": "adc"
|
||||
},
|
||||
"features": {
|
||||
"battery": true,
|
||||
"console": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
BATTERY_DRIVER_REQUIRED = yes
|
||||
@@ -64,8 +64,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define PS2_MOUSE_INIT_DELAY 2000
|
||||
|
||||
#define BATTERY_PIN B5
|
||||
|
||||
#ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file
|
||||
enum led_sequence {
|
||||
LED_IND_LINUX,
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
"ws2812": {
|
||||
"pin": "B5"
|
||||
},
|
||||
"battery": {
|
||||
"driver": "adc",
|
||||
"adc": {
|
||||
"pin": "B5"
|
||||
}
|
||||
},
|
||||
"bluetooth": {
|
||||
"driver": "bluefruit_le"
|
||||
},
|
||||
@@ -22,6 +28,7 @@
|
||||
"nkro": true,
|
||||
"ps2_mouse": true,
|
||||
"ps2": true,
|
||||
"battery": true,
|
||||
"bluetooth": true
|
||||
},
|
||||
"build": {
|
||||
|
||||
@@ -5,7 +5,6 @@ PS2_DRIVER = interrupt
|
||||
CUSTOM_MATRIX = yes
|
||||
|
||||
WS2812_DRIVER_REQUIRED = yes
|
||||
BATTERY_DRIVER_REQUIRED = yes
|
||||
|
||||
SRC += rgbsps.c
|
||||
SRC += matrix.c
|
||||
|
||||
Reference in New Issue
Block a user