From 8c38482ebd1594988a3c3797b73cc534dca9a447 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 2 Jul 2020 13:12:34 +1000 Subject: [PATCH] Change analogRead calls to analogReadPin (#9023) * Change analogRead calls to analogReadPin * Add ChangeLog * Update docs, remove mention of `analogRead()` * Retarget changelog for next round --- tmk_core/protocol/lufa/adafruit_ble.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tmk_core/protocol/lufa/adafruit_ble.cpp b/tmk_core/protocol/lufa/adafruit_ble.cpp index a9cfc18558..07c3feb66e 100644 --- a/tmk_core/protocol/lufa/adafruit_ble.cpp +++ b/tmk_core/protocol/lufa/adafruit_ble.cpp @@ -37,9 +37,10 @@ #define ConnectionUpdateInterval 1000 /* milliseconds */ #ifdef SAMPLE_BATTERY -#ifndef BATTERY_LEVEL_PIN -# define BATTERY_LEVEL_PIN 7 -#endif + +# ifndef BATTERY_LEVEL_PIN +# define BATTERY_LEVEL_PIN B5 +# endif #endif static struct { @@ -556,7 +557,7 @@ void adafruit_ble_task(void) { if (timer_elapsed(state.last_battery_update) > BatteryUpdateInterval && resp_buf.empty()) { state.last_battery_update = timer_read(); - state.vbat = analogRead(BATTERY_LEVEL_PIN); + state.vbat = analogReadPin(BATTERY_LEVEL_PIN); } #endif }