1
0

Refactor battery driver (#25550)

This commit is contained in:
Joel Challis
2025-08-17 01:14:48 +01:00
committed by GitHub
parent f29d8117bf
commit cc696a2ae8
26 changed files with 287 additions and 73 deletions

View File

@@ -3,4 +3,4 @@
#pragma once
#define BATTERY_PIN ADC_PIN
#define BATTERY_ADC_PIN ADC_PIN

View File

@@ -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) {

View File

@@ -1,6 +1,10 @@
{
"config": {
"battery": {
"driver": "adc"
},
"features": {
"battery": true,
"console": true
}
}

View File

@@ -1 +0,0 @@
BATTERY_DRIVER_REQUIRED = yes

View File

@@ -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,

View File

@@ -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": {

View File

@@ -5,7 +5,6 @@ PS2_DRIVER = interrupt
CUSTOM_MATRIX = yes
WS2812_DRIVER_REQUIRED = yes
BATTERY_DRIVER_REQUIRED = yes
SRC += rgbsps.c
SRC += matrix.c