Skip to content

Commit 8c99950

Browse files
committed
fix sketch build error for itsybitsy and clue variants
1 parent 6a33251 commit 8c99950

File tree

4 files changed

+33
-32
lines changed

4 files changed

+33
-32
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ uint32_t vbat_pin = PIN_VBAT; // A7 for feather nRF52832, A6 for nRF
88

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

11-
#ifdef NRF52840_XXAA // if this is for nrf52840
12-
#define VBAT_DIVIDER (0.5F) // 150K + 150K voltage divider on VBAT
11+
#ifdef NRF52840_XXAA
12+
#define VBAT_DIVIDER (0.5F) // 150K + 150K voltage divider on VBAT
1313
#define VBAT_DIVIDER_COMP (2.0F) // Compensation factor for the VBAT divider
1414
#else
1515
#define VBAT_DIVIDER (0.71275837F) // 2M + 0.806M voltage divider on VBAT = (2M / (0.806M + 2M))
@@ -81,4 +81,5 @@ void loop() {
8181
Serial.println("%)");
8282

8383
delay(1000);
84-
}
84+
}
85+

libraries/Bluefruit52Lib/examples/Peripheral/ancs_oled/ancs_oled.ino

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,23 @@
2828

2929
/*------------- OLED and Buttons -------------*/
3030
#if defined ARDUINO_NRF52832_FEATHER
31-
// Feather nRF52832
32-
#define BUTTON_A 31
33-
#define BUTTON_B 30
34-
#define BUTTON_C 27
35-
36-
#elif defined ARDUINO_NRF52840_FEATHER
37-
// Feather nRF52840
38-
#define BUTTON_A 9
39-
#define BUTTON_B 6
40-
#define BUTTON_C 5
31+
// Feather nRF52832
32+
#define BUTTON_A 31
33+
#define BUTTON_B 30
34+
#define BUTTON_C 27
4135

4236
#elif defined ARDUINO_NRF52840_CIRCUITPLAY
43-
// Circuit Playground nRF52840 - FYI doesnt work probably because of button polarity!
44-
#define BUTTON_A 4 // left button
45-
#define BUTTON_B 7 // center switch
46-
#define BUTTON_C 5 // right button
37+
// Circuit Playground nRF52840 - FYI doesnt work probably because of button polarity!
38+
#define BUTTON_A 4 // left button
39+
#define BUTTON_B 7 // center switch
40+
#define BUTTON_C 5 // right button
4741

4842
#else
49-
#error board not supported
43+
// Default for others
44+
#define BUTTON_A 9
45+
#define BUTTON_B 6
46+
#define BUTTON_C 5
47+
5048
#endif
5149

5250
Adafruit_SSD1306 oled(-1);

libraries/Bluefruit52Lib/examples/Peripheral/image_upload/image_upload.ino

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,24 @@
3030
#include <SPI.h>
3131
#include <Adafruit_GFX.h>
3232

33-
#ifdef ARDUINO_NRF52832_FEATHER
34-
#define TFT_DC 11
35-
#define TFT_CS 31
36-
#endif
33+
#if defined(ARDUINO_NRF52832_FEATHER)
34+
// Feather nRF52832
35+
#define TFT_DC 11
36+
#define TFT_CS 31
3737

38-
#ifdef ARDUINO_NRF52840_FEATHER
39-
#define TFT_DC 10
40-
#define TFT_CS 9
41-
#endif
38+
#elif defined(ARDUINO_NRF52840_CIRCUITPLAY)
39+
// Circuit Playground Bluefruit for use with TFT 1.5" GIZMO
40+
#define TFT_DC 1
41+
#define TFT_CS 0
42+
#define TFT_BACKLIGHT A3
4243

43-
// Circuit Playground Bluefruit for use with TFT 1.5" GIZMO
44-
#ifdef ARDUINO_NRF52840_CIRCUITPLAY
45-
#define TFT_DC 1
46-
#define TFT_CS 0
47-
#define TFT_BACKLIGHT A3
44+
#else
45+
// Default for others
46+
#define TFT_DC 10
47+
#define TFT_CS 9
4848
#endif
4949

50+
5051
#if TFT_IN_USE == TFT_35_FEATHERWING
5152
#include "Adafruit_HX8357.h"
5253
Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC);

variants/itsybitsy_nrf52840_express/variant.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ extern "C"
7373
#define PIN_A4 (18)
7474
#define PIN_A5 (19)
7575
#define PIN_A6 (20)
76+
#define PIN_A7 (0xff) // to compile with Firmata library
7677

7778
static const uint8_t A0 = PIN_A0 ;
7879
static const uint8_t A1 = PIN_A1 ;
@@ -83,7 +84,7 @@ static const uint8_t A5 = PIN_A5 ;
8384
static const uint8_t A6 = PIN_A6 ;
8485
#define ADC_RESOLUTION 14
8586

86-
//static const uint8_t AREF = PIN_AREF;
87+
//static const uint8_t AREF = PIN_AREF;
8788

8889
/*
8990
* Serial interfaces

0 commit comments

Comments
 (0)