Skip to content

Commit dc4dcec

Browse files
CY8CKIT driver fixed after mbed.h removal
1 parent 195e9e8 commit dc4dcec

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

connectivity/drivers/ble/COMPONENT_CYW43XXX/CyH4TransportDriver.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@
1818
#if DEVICE_SERIAL && DEVICE_SERIAL_FC
1919

2020
#include "CyH4TransportDriver.h"
21+
#include "mbed_power_mgmt.h"
22+
#include "drivers/InterruptIn.h"
23+
#include "cybsp_types.h"
24+
#include "Callback.h"
25+
#include "rtos/ThisThread.h"
26+
#include <chrono>
2127

2228
namespace ble {
2329
namespace vendor {
2430
namespace cypress_ble {
2531

32+
using namespace std::chrono_literals;
2633

2734
CyH4TransportDriver::CyH4TransportDriver(PinName tx, PinName rx, PinName cts, PinName rts, int baud, PinName bt_host_wake_name, PinName bt_device_wake_name, uint8_t host_wake_irq, uint8_t dev_wake_irq) :
2835
cts(cts), rts(rts),
@@ -112,7 +119,7 @@ static void on_controller_irq(void *callback_arg, cyhal_uart_event_t event)
112119
void CyH4TransportDriver::initialize()
113120
{
114121
#if (defined(MBED_TICKLESS) && DEVICE_SLEEP && DEVICE_LPTICKER)
115-
InterruptIn *host_wake_pin;
122+
mbed::InterruptIn *host_wake_pin;
116123
#endif
117124

118125
sleep_manager_lock_deep_sleep();
@@ -126,9 +133,9 @@ void CyH4TransportDriver::initialize()
126133
#if (defined(MBED_TICKLESS) && DEVICE_SLEEP && DEVICE_LPTICKER)
127134
if (bt_host_wake_name != NC) {
128135
//Register IRQ for Host WAKE
129-
host_wake_pin = new InterruptIn(bt_host_wake_name);
130-
host_wake_pin->fall(callback(this, &CyH4TransportDriver::bt_host_wake_fall_irq_handler));
131-
host_wake_pin->rise(callback(this, &CyH4TransportDriver::bt_host_wake_rise_irq_handler));
136+
host_wake_pin = new mbed::InterruptIn(bt_host_wake_name);
137+
host_wake_pin->fall(mbed::callback(this, &CyH4TransportDriver::bt_host_wake_fall_irq_handler));
138+
host_wake_pin->rise(mbed::callback(this, &CyH4TransportDriver::bt_host_wake_rise_irq_handler));
132139
}
133140
#endif
134141
if (dev_wake_irq_event == WAKE_EVENT_ACTIVE_LOW) {

connectivity/drivers/ble/COMPONENT_CYW43XXX/CyH4TransportDriver.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <stdint.h>
2424
#include "CordioHCITransportDriver.h"
2525
#include "drivers/DigitalInOut.h"
26+
#include "cyhal_uart.h"
2627

2728
namespace ble {
2829
namespace vendor {
@@ -94,8 +95,8 @@ class CyH4TransportDriver : public CordioHCITransportDriver {
9495
PinName bt_host_wake_name;
9596
PinName bt_device_wake_name;
9697

97-
DigitalInOut bt_host_wake;
98-
DigitalInOut bt_device_wake;
98+
mbed::DigitalInOut bt_host_wake;
99+
mbed::DigitalInOut bt_device_wake;
99100
bool bt_host_wake_active;
100101

101102
bool enabled_powersave;

0 commit comments

Comments
 (0)