Bluetooth: nble: Drive BTWAKE high

Refactored Johan Hedberg's code adding writing to NBLE_BTWAKE_PIN one
to drive it high, needed to wake up NBLE chip.

Change-Id: I63b9583281db897f2326e4570716c25ce181128f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2016-01-21 12:07:13 +02:00 committed by Anas Nashif
commit 500b59809f

View file

@ -29,6 +29,7 @@
#define NBLE_SWDIO_PIN 6
#define NBLE_RESET_PIN NBLE_SWDIO_PIN
#define NBLE_BTWAKE_PIN 5
#define NBLE_CHANNEL 0
@ -89,6 +90,18 @@ int bt_enable(bt_ready_cb_t cb)
return -EINVAL;
}
ret = gpio_pin_configure(gpio, NBLE_BTWAKE_PIN, GPIO_DIR_OUT);
if (ret) {
BT_ERR("Error configuring pin %d", NBLE_BTWAKE_PIN);
return -ENODEV;
}
ret = gpio_pin_write(gpio, NBLE_BTWAKE_PIN, 1);
if (ret) {
BT_ERR("Error pin write %d", NBLE_BTWAKE_PIN);
return -EINVAL;
}
/**
* NBLE reset is achieved by asserting low the SWDIO pin.
* However, the BLE Core chip can be in SWD debug mode,