1717
1818#include < STM32duinoBLE.h>
1919
20+ #ifdef USER_BTN
21+ const int buttonPin = USER_BTN; // set buttonPin to on-board user button
22+ #else
23+ const int buttonPin = PC13; // set buttonPin to digital pin PC13 */
24+ #endif
25+
2026#if defined(ARDUINO_STEVAL_MKBOXPRO)
2127/* STEVAL-MKBOXPRO */
2228SPIClass SpiHCI (PA7, PA6, PA5);
@@ -25,7 +31,6 @@ HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_LP, PA2, PB11, PD4, 1000000
2531BLELocalDevice BLEObj (&HCISpiTransport);
2632BLELocalDevice& BLE = BLEObj;
2733#endif
28- const int buttonPin = PC13; // set buttonPin to digital pin PC13
2934#elif defined(ARDUINO_STEVAL_MKSBOX1V1)
3035/* STEVAL-MKSBOX1V1 */
3136SPIClass SpiHCI (PC3, PD3, PD1);
@@ -34,7 +39,6 @@ HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_1S, PD0, PD4, PA8, 1000000,
3439BLELocalDevice BLEObj (&HCISpiTransport);
3540BLELocalDevice& BLE = BLEObj;
3641#endif
37- const int buttonPin = PG1; // set buttonPin to digital pin PG1
3842#elif defined(ARDUINO_B_L475E_IOT01A) || defined(ARDUINO_B_L4S5I_IOT01A)
3943/* B-L475E-IOT01A1 or B_L4S5I_IOT01A */
4044SPIClass SpiHCI (PC12, PC11, PC10);
@@ -43,14 +47,12 @@ HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_RF, PD13, PE6, PA8, 8000000,
4347BLELocalDevice BLEObj (&HCISpiTransport);
4448BLELocalDevice& BLE = BLEObj;
4549#endif
46- const int buttonPin = PC13; // set buttonPin to digital pin PC13
4750#elif defined(ARDUINO_NUCLEO_WB15CC) || defined(ARDUINO_P_NUCLEO_WB55RG) || defined(ARDUINO_STM32WB5MM_DK)
4851HCISharedMemTransportClass HCISharedMemTransport;
4952#if !defined(FAKE_BLELOCALDEVICE)
5053BLELocalDevice BLEObj (&HCISharedMemTransport);
5154BLELocalDevice& BLE = BLEObj;
5255#endif
53- const int buttonPin = PC4; // set buttonPin to digital pin PC4
5456#else
5557/* Shield IDB05A2 with SPI clock on D3 */
5658SPIClass SpiHCI (D11, D12, D3);
@@ -59,47 +61,41 @@ HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_M0, A1, A0, D7, 8000000, SP
5961BLELocalDevice BLEObj (&HCISpiTransport);
6062BLELocalDevice& BLE = BLEObj;
6163#endif
62- const int buttonPin = PC13; // set buttonPin to digital pin PC13
6364/* Shield IDB05A2 with SPI clock on D13 */
6465/* #define SpiHCI SPI
6566HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_M0, A1, A0, D7, 8000000, SPI_MODE0);
6667#if !defined(FAKE_BLELOCALDEVICE)
6768BLELocalDevice BLEObj(&HCISpiTransport);
6869BLELocalDevice& BLE = BLEObj;
6970#endif
70- const int buttonPin = PC13; // set buttonPin to digital pin PC13 */
7171/* Shield IDB05A1 with SPI clock on D3 */
7272/* SPIClass SpiHCI(D11, D12, D3);
7373HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_RF, A1, A0, D7, 8000000, SPI_MODE0);
7474#if !defined(FAKE_BLELOCALDEVICE)
7575BLELocalDevice BLEObj(&HCISpiTransport);
7676BLELocalDevice& BLE = BLEObj;
7777#endif
78- const int buttonPin = PC13; // set buttonPin to digital pin PC13 */
7978/* Shield IDB05A1 with SPI clock on D13 */
8079/* #define SpiHCI SPI
8180HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_RF, A1, A0, D7, 8000000, SPI_MODE0);
8281#if !defined(FAKE_BLELOCALDEVICE)
8382BLELocalDevice BLEObj(&HCISpiTransport);
8483BLELocalDevice& BLE = BLEObj;
8584#endif
86- const int buttonPin = PC13; // set buttonPin to digital pin PC13 */
8785/* Shield BNRG2A1 with SPI clock on D3 */
8886/* SPIClass SpiHCI(D11, D12, D3);
8987HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_M2SP, A1, A0, D7, 1000000, SPI_MODE1);
9088#if !defined(FAKE_BLELOCALDEVICE)
9189BLELocalDevice BLEObj(&HCISpiTransport);
9290BLELocalDevice& BLE = BLEObj;
9391#endif
94- const int buttonPin = PC13; // set buttonPin to digital pin PC13 */
9592/* Shield BNRG2A1 with SPI clock on D13 */
9693/* #define SpiHCI SPI
9794HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_M2SP, A1, A0, D7, 1000000, SPI_MODE1);
9895#if !defined(FAKE_BLELOCALDEVICE)
9996BLELocalDevice BLEObj(&HCISpiTransport);
10097BLELocalDevice& BLE = BLEObj;
10198#endif
102- const int buttonPin = PC13; // set buttonPin to digital pin PC13 */
10399#endif
104100
105101const int ledPin = LED_BUILTIN; // set ledPin to on-board LED
0 commit comments