forked from mirrors/qmk_userspace
Fix battery level code in adafruit_ble.cpp (#6648)
* Fix battery level code in adafruit_ble.cpp The code in tsk_core/protocol/lufa/adafluit_ble.cpp that polls the battery level for the Adafruit feather BLE controller reads the regulated voltage, not the raw voltage coming from the battery. To do that, the Adafruit Feather docs say you should read from pin A9: https://learn.adafruit.com/adafruit-feather-32u4-basic-proto/power-management#measuring-battery-4-9. (See also https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/pinouts#logic-pins-2-9.) I'm not sure why, but analogRead(9); doesn't read the correct pin. Checking all available analog pins experimentally, it turns out that analogRead(7); returns the correct value. So the code above should read: state.vbat = analogRead(7); * Update tmk_core/protocol/lufa/adafruit_ble.cpp Co-Authored-By: Drashna Jaelre <drashna@live.com> * Remove old comment * Fix linking error * Remove `#ifdef` around `#include analog.h`. * Really fix linking error
This commit is contained in:
parent
e6a6b1f122
commit
fa71c4c91e
3 changed files with 16 additions and 6 deletions
|
@ -29,6 +29,7 @@ ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
|
|||
endif
|
||||
|
||||
ifeq ($(strip $(BLUETOOTH)), AdafruitBLE)
|
||||
LUFA_SRC += analog.c
|
||||
LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp
|
||||
endif
|
||||
|
||||
|
@ -51,6 +52,7 @@ SRC += $(LUFA_SRC)
|
|||
# Search Path
|
||||
VPATH += $(TMK_PATH)/$(LUFA_DIR)
|
||||
VPATH += $(LUFA_PATH)
|
||||
VPATH += $(DRIVER_PATH)/avr
|
||||
|
||||
# Option modules
|
||||
#ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue