qmk-keychron-q3-colemak-dh/drivers/avr
bwhelm fa71c4c91e 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
2019-09-04 04:29:23 +10:00
..
analog.c clang-format changes 2019-08-30 15:01:52 -07:00
analog.h Fix battery level code in adafruit_ble.cpp (#6648) 2019-09-04 04:29:23 +10:00
apa102.c clang-format changes 2019-08-30 15:01:52 -07:00
apa102.h clang-format changes 2019-08-30 15:01:52 -07:00
glcdfont.c clang-format changes 2019-08-30 15:01:52 -07:00
hd44780.c clang-format changes 2019-08-30 15:01:52 -07:00
hd44780.h clang-format changes 2019-08-30 15:01:52 -07:00
i2c_master.c Removed prescaler define from avr i2c, as it was impossible to use (#6617) 2019-08-30 17:47:11 -07:00
i2c_master.h clang-format changes 2019-08-30 15:01:52 -07:00
i2c_slave.c clang-format changes 2019-08-30 15:01:52 -07:00
i2c_slave.h clang-format changes 2019-08-30 15:01:52 -07:00
pro_micro.h clang-format changes 2019-08-30 15:01:52 -07:00
ssd1306.c clang-format changes 2019-08-30 15:01:52 -07:00
ssd1306.h clang-format changes 2019-08-30 15:01:52 -07:00
ws2812.c clang-format changes 2019-08-30 15:01:52 -07:00
ws2812.h clang-format changes 2019-08-30 15:01:52 -07:00