BLE: Fix uses of mbed.h

pull/13475/head
Vincent Coubard 2020-08-25 12:28:40 +01:00
parent 053e81ba0f
commit 5943a7360c
5 changed files with 13 additions and 14 deletions

View File

@ -19,10 +19,10 @@
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include <BLETypes.h> #include "platform/Callback.h"
#include "ble/common/BLETypes.h"
#include "ble/driver/CordioHCITransportDriver.h" #include "ble/driver/CordioHCITransportDriver.h"
#include "ble/common/blecommon.h" #include "ble/common/blecommon.h"
#include "mbed.h"
// FIXME: make this invisible! // FIXME: make this invisible!
#include "wsf_buf.h" #include "wsf_buf.h"

View File

@ -20,7 +20,7 @@
#if (DEVICE_SERIAL && DEVICE_SERIAL_FC) || defined(DOXYGEN_ONLY) #if (DEVICE_SERIAL && DEVICE_SERIAL_FC) || defined(DOXYGEN_ONLY)
#include <cstdint> #include <cstdint>
#include "mbed.h" #include "drivers/UnbufferedSerial.h"
#include "ble/driver/CordioHCITransportDriver.h" #include "ble/driver/CordioHCITransportDriver.h"
namespace ble { namespace ble {
@ -69,7 +69,7 @@ private:
// Use UnbufferedSerial as we don't require locking primitives. // Use UnbufferedSerial as we don't require locking primitives.
// We access the peripheral in interrupt context. // We access the peripheral in interrupt context.
UnbufferedSerial uart; mbed::UnbufferedSerial uart;
PinName cts; PinName cts;
PinName rts; PinName rts;
}; };

View File

@ -27,19 +27,19 @@ void H4TransportDriver::initialize()
{ {
uart.format( uart.format(
/* bits */ 8, /* bits */ 8,
/* parity */ SerialBase::None, /* parity */ mbed::SerialBase::None,
/* stop bit */ 1 /* stop bit */ 1
); );
uart.set_flow_control( uart.set_flow_control(
/* flow */ SerialBase::RTSCTS, /* flow */ mbed::SerialBase::RTSCTS,
/* rts */ rts, /* rts */ rts,
/* cts */ cts /* cts */ cts
); );
uart.attach( uart.attach(
callback(this, &H4TransportDriver::on_controller_irq), mbed::callback(this, &H4TransportDriver::on_controller_irq),
SerialBase::RxIrq mbed::SerialBase::RxIrq
); );
} }

View File

@ -16,7 +16,6 @@
* limitations under the License. * limitations under the License.
*/ */
#include "mbed.h"
#include "platform/CriticalSectionLock.h" #include "platform/CriticalSectionLock.h"
#include "hal/us_ticker_api.h" #include "hal/us_ticker_api.h"
#include "platform/mbed_assert.h" #include "platform/mbed_assert.h"
@ -309,7 +308,7 @@ const ble::SecurityManager &BLEInstanceBase::getSecurityManager() const
void BLEInstanceBase::waitForEvent() void BLEInstanceBase::waitForEvent()
{ {
static Timeout nextTimeout; static mbed::Timeout nextTimeout;
timestamp_t nextTimestamp; timestamp_t nextTimestamp;
bool_t pTimerRunning; bool_t pTimerRunning;
@ -633,8 +632,8 @@ void BLEInstanceBase::callDispatcher()
wsfOsDispatcher(); wsfOsDispatcher();
static LowPowerTimeout nextTimeout; static mbed::LowPowerTimeout nextTimeout;
CriticalSectionLock critical_section; mbed::CriticalSectionLock critical_section;
if (wsfOsReadyToSleep()) { if (wsfOsReadyToSleep()) {
// setup an mbed timer for the next Cordio timeout // setup an mbed timer for the next Cordio timeout

View File

@ -14,12 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
#include "mbed.h"
#include "cordio_stack/platform/include/pal_types.h" #include "cordio_stack/platform/include/pal_types.h"
#include "cordio_stack/platform/include/pal_uart.h" #include "cordio_stack/platform/include/pal_uart.h"
#include "hal/ticker_api.h" #include "hal/ticker_api.h"
#include "mbed_critical.h" #include "platform/mbed_critical.h"
#include "pal_codec.h" #include "pal_codec.h"
#include "platform/mbed_error.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {