18
18
#if DEVICE_SERIAL && DEVICE_SERIAL_FC
19
19
20
20
#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>
21
27
22
28
namespace ble {
23
29
namespace vendor {
24
30
namespace cypress_ble {
25
31
32
+ using namespace std ::chrono_literals;
26
33
27
34
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) :
28
35
cts (cts), rts(rts),
@@ -112,7 +119,7 @@ static void on_controller_irq(void *callback_arg, cyhal_uart_event_t event)
112
119
void CyH4TransportDriver::initialize ()
113
120
{
114
121
#if (defined(MBED_TICKLESS) && DEVICE_SLEEP && DEVICE_LPTICKER)
115
- InterruptIn *host_wake_pin;
122
+ mbed:: InterruptIn *host_wake_pin;
116
123
#endif
117
124
118
125
sleep_manager_lock_deep_sleep ();
@@ -126,9 +133,9 @@ void CyH4TransportDriver::initialize()
126
133
#if (defined(MBED_TICKLESS) && DEVICE_SLEEP && DEVICE_LPTICKER)
127
134
if (bt_host_wake_name != NC) {
128
135
// 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));
132
139
}
133
140
#endif
134
141
if (dev_wake_irq_event == WAKE_EVENT_ACTIVE_LOW) {
0 commit comments