Skip to content

Commit c8be9a5

Browse files
authored
Merge pull request #231 from LMESTM/NUCLEO_WB55RG_button
Define BLE BUTTON for NUCLEO_WB55RG ,and handles button pull-up direction variations for targets
2 parents 755f66b + bc964c2 commit c8be9a5

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

BLE_Button/mbed_app.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"help": "The pin name used as button in this application",
55
"macro_name": "BLE_BUTTON_PIN_NAME",
66
"required": true
7+
},
8+
"ble_button_pin_pull": {
9+
"help": "The BLE button may need a pull-up. Possible values are PullUp, PullDown, PullNone (default).",
10+
"macro_name": "BLE_BUTTON_PIN_PULL",
11+
"value": "PullNone"
712
}
813
},
914
"target_overrides": {
@@ -25,6 +30,10 @@
2530
"target.extra_labels_add": ["CORDIO", "CORDIO_BLUENRG"],
2631
"ble_button_pin_name": "USER_BUTTON"
2732
},
33+
"NUCLEO_WB55RG": {
34+
"ble_button_pin_name": "USER_BUTTON",
35+
"ble_button_pin_pull": "PullUp"
36+
},
2837
"NRF52840_DK": {
2938
"target.features_add": ["BLE"],
3039
"target.extra_labels_add": ["CORDIO", "CORDIO_LL", "SOFTDEVICE_NONE", "NORDIC_CORDIO"],
@@ -39,6 +48,6 @@
3948
},
4049
"MTB_UBLOX_NINA_B1": {
4150
"ble_button_pin_name": "BUTTON1"
42-
}
51+
}
4352
}
4453
}

BLE_Button/source/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class BatteryDemo : ble::Gap::EventHandler {
3232
_ble(ble),
3333
_event_queue(event_queue),
3434
_led1(LED1, 1),
35-
_button(BLE_BUTTON_PIN_NAME),
35+
_button(BLE_BUTTON_PIN_NAME, BLE_BUTTON_PIN_PULL),
3636
_button_service(NULL),
3737
_button_uuid(ButtonService::BUTTON_SERVICE_UUID),
3838
_adv_data_builder(_adv_buffer) { }

BLE_GAPButton/mbed_app.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"help": "The pin name used as button in this application",
55
"macro_name": "BLE_BUTTON_PIN_NAME",
66
"required": true
7+
},
8+
"ble_button_pin_pull": {
9+
"help": "The BLE button may need a pull-up. Possible values are PullUp, PullDown, PullNone (default).",
10+
"macro_name": "BLE_BUTTON_PIN_PULL",
11+
"value": "PullNone"
712
}
813
},
914
"target_overrides": {
@@ -25,6 +30,10 @@
2530
"target.extra_labels_add": ["CORDIO", "CORDIO_BLUENRG"],
2631
"ble_button_pin_name": "USER_BUTTON"
2732
},
33+
"NUCLEO_WB55RG": {
34+
"ble_button_pin_name": "USER_BUTTON",
35+
"ble_button_pin_pull": "PullUp"
36+
},
2837
"NRF52840_DK": {
2938
"target.features_add": ["BLE"],
3039
"target.extra_labels_add": ["CORDIO", "CORDIO_LL", "SOFTDEVICE_NONE", "NORDIC_CORDIO"],

BLE_GAPButton/source/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class GapButtonDemo : private mbed::NonCopyable<GapButtonDemo>, public ble::Gap:
3636
* as long as it does not overlap with the UUIDs defined here:
3737
* https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx */
3838
_button_uuid(0xAA00),
39-
_button(BLE_BUTTON_PIN_NAME),
39+
_button(BLE_BUTTON_PIN_NAME, BLE_BUTTON_PIN_PULL),
4040
_adv_data_builder(_adv_buffer) { }
4141

4242
~GapButtonDemo()

0 commit comments

Comments
 (0)