Change analogRead calls to analogReadPin (#9023)
* Change analogRead calls to analogReadPin * Add ChangeLog * Update docs, remove mention of `analogRead()` * Retarget changelog for next round
This commit is contained in:
@@ -37,9 +37,10 @@
|
|||||||
#define ConnectionUpdateInterval 1000 /* milliseconds */
|
#define ConnectionUpdateInterval 1000 /* milliseconds */
|
||||||
|
|
||||||
#ifdef SAMPLE_BATTERY
|
#ifdef SAMPLE_BATTERY
|
||||||
#ifndef BATTERY_LEVEL_PIN
|
|
||||||
# define BATTERY_LEVEL_PIN 7
|
# ifndef BATTERY_LEVEL_PIN
|
||||||
#endif
|
# define BATTERY_LEVEL_PIN B5
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
@@ -556,7 +557,7 @@ void adafruit_ble_task(void) {
|
|||||||
if (timer_elapsed(state.last_battery_update) > BatteryUpdateInterval && resp_buf.empty()) {
|
if (timer_elapsed(state.last_battery_update) > BatteryUpdateInterval && resp_buf.empty()) {
|
||||||
state.last_battery_update = timer_read();
|
state.last_battery_update = timer_read();
|
||||||
|
|
||||||
state.vbat = analogRead(BATTERY_LEVEL_PIN);
|
state.vbat = analogReadPin(BATTERY_LEVEL_PIN);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user