Skip to content

Commit f6f791c

Browse files
authored
Merge pull request #264 from adafruit/develop
sync Develop with master
2 parents bcc41ff + 85ea29d commit f6f791c

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

keywords.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ PIN_A6 LITERAL1
107107
PIN_A7 LITERAL1
108108

109109
PIN_AREF LITERAL1
110-
PIN_DFU LITERAL1
111110
PIN_NFC1 LITERAL1
112111
PIN_NFC2 LITERAL1
113112

libraries/Bluefruit52Lib/examples/Hardware/adc_vbat/adc_vbat.ino

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
#include <Arduino.h>
2+
3+
uint32_t vbat_pin = PIN_VBAT; // A7 for feather nRF52832, A6 for nRF52840
14

25
#define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096
36

47
#ifdef NRF52840_XXAA // if this is for nrf52840
5-
#define VBAT_PIN (A6)
6-
#define VBAT_DIVIDER (0.5F) // 150K + 150K voltage divider on VBAT
8+
#define VBAT_DIVIDER (0.5F) // 150K + 150K voltage divider on VBAT
79
#define VBAT_DIVIDER_COMP (2.0F) // Compensation factor for the VBAT divider
810
#else
9-
#define VBAT_PIN (A7)
1011
#define VBAT_DIVIDER (0.71275837F) // 2M + 0.806M voltage divider on VBAT = (2M / (0.806M + 2M))
1112
#define VBAT_DIVIDER_COMP (1.403F) // Compensation factor for the VBAT divider
1213
#endif
@@ -27,7 +28,7 @@ float readVBAT(void) {
2728
delay(1);
2829

2930
// Get the raw 12-bit, 0..3000mV ADC value
30-
raw = analogRead(VBAT_PIN);
31+
raw = analogRead(vbat_pin);
3132

3233
// Set the ADC back to the default settings
3334
analogReference(AR_DEFAULT);

variants/feather_nrf52832/variant.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static const uint8_t A7 = PIN_A7 ;
7878

7979
// Other pins
8080
#define PIN_AREF (24)
81-
#define PIN_DFU (20)
81+
#define PIN_VBAT PIN_A7
8282
#define PIN_NFC1 (9)
8383
#define PIN_NFC2 (10)
8484

variants/feather_nrf52840_express/variant.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ static const uint8_t A7 = PIN_A7 ;
8686
#define ADC_RESOLUTION 14
8787

8888
// Other pins
89-
#define PIN_AREF (PIN_A7)
90-
#define PIN_DFU (7)
89+
#define PIN_AREF PIN_A7
90+
#define PIN_VBAT PIN_A6
9191
#define PIN_NFC1 (33)
9292
#define PIN_NFC2 (2)
9393

variants/metro_nrf52840_express/variant.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ static const uint8_t A7 = PIN_A7 ;
8686
#define ADC_RESOLUTION 14
8787

8888
// Other pins
89-
#define PIN_AREF (PIN_A7)
90-
#define PIN_DFU (7)
89+
#define PIN_AREF PIN_A7
90+
#define PIN_VBAT PIN_A6
9191
#define PIN_NFC1 (2)
9292
#define PIN_NFC2 (51)
9393

variants/pca10056/variant.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ static const uint8_t A7 = PIN_A7 ;
7878

7979
// Other pins
8080
#define PIN_AREF (2)
81-
#define PIN_DFU (11)
8281
#define PIN_NFC1 (9)
8382
#define PIN_NFC2 (10)
8483

0 commit comments

Comments
 (0)