Skip to content

Commit 54f7591

Browse files
author
Cruz Monrreal
authored
Merge pull request #9210 from AnttiKauppila/mbed_h_fix
mbed.h includes removed
2 parents a857e95 + 9c38ad7 commit 54f7591

File tree

25 files changed

+75
-40
lines changed

25 files changed

+75
-40
lines changed

components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
#include "nanostack/platform/arm_hal_phy.h"
2727
#include "mbed_trace.h"
2828
#include "mbed_toolchain.h"
29+
#include "DigitalIn.h"
30+
#include "DigitalOut.h"
31+
#include "InterruptIn.h"
32+
#include "SPI.h"
33+
#include "inttypes.h"
34+
#include "Timeout.h"
2935

3036
#define TRACE_GROUP "AtRF"
3137

@@ -219,8 +225,9 @@ static inline rf_trx_states_t rf_if_trx_status_from_full(uint8_t full_trx_status
219225
}
220226

221227
#ifdef MBED_CONF_RTOS_PRESENT
222-
#include "mbed.h"
228+
223229
#include "rtos.h"
230+
224231
using namespace mbed;
225232
using namespace rtos;
226233

components/802.15.4_RF/mcr20a-rf-driver/mcr20a-rf-driver/NanostackRfPhyMcr20a.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@
1818
#define NANOSTACK_PHY_MCR20A_H_
1919

2020
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && defined(MBED_CONF_RTOS_PRESENT)
21-
#include "mbed.h"
21+
#include "inttypes.h"
2222
#include "NanostackRfPhy.h"
23+
#include "DigitalIn.h"
24+
#include "DigitalOut.h"
25+
#include "InterruptIn.h"
26+
#include "SPI.h"
27+
#include "rtos.h"
2328

2429
// Arduino pin defaults for convenience
2530
#if !defined(MCR20A_SPI_MOSI)

components/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "nanostack/platform/arm_hal_phy.h"
2323
#include <string.h>
2424
#include "rtos.h"
25+
#include "mbed_interface.h"
2526

2627
using namespace mbed;
2728
using namespace rtos;

components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
#include "mbed_toolchain.h"
2727
#include "common_functions.h"
2828
#include <Timer.h>
29+
#include "Timeout.h"
30+
#include "Thread.h"
31+
#include "mbed_wait_api.h"
32+
33+
using namespace mbed;
34+
using namespace rtos;
2935

3036
#define TRACE_GROUP "s2lp"
3137

@@ -216,7 +222,7 @@ static const phy_device_channel_page_s phy_channel_pages[] = {
216222
};
217223

218224
#ifdef MBED_CONF_RTOS_PRESENT
219-
#include "mbed.h"
225+
220226
#include "rtos.h"
221227

222228
static void rf_irq_task_process_irq();

components/802.15.4_RF/stm-s2lp-rf-driver/stm-s2lp-rf-driver/NanostackRfPhys2lp.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
#define NANOSTACK_PHY_S2LP_H_
1919

2020
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && defined(MBED_CONF_RTOS_PRESENT)
21-
#include "mbed.h"
21+
#include "inttypes.h"
2222
#include "NanostackRfPhy.h"
23+
#include "DigitalIn.h"
24+
#include "DigitalOut.h"
25+
#include "InterruptIn.h"
26+
#include "SPI.h"
2327

2428
// Uncomment to use testing gpios attached to TX/RX processes
2529
//#define TEST_GPIOS_ENABLED

components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "FlashIAPBlockDevice.h"
2020
#include "mbed_critical.h"
2121

22-
#include "mbed.h"
2322
using namespace mbed;
2423
#include <inttypes.h>
2524

features/FEATURE_BLE/ble/services/EddystoneConfigService.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919

2020
#warning ble/services/EddystoneConfigService.h is deprecated. Please use the example in 'github.com/ARMmbed/ble-examples/tree/master/BLE_EddystoneService'.
2121

22-
#include "mbed.h"
2322
#include "ble/BLE.h"
2423
#include "ble/services/EddystoneService.h"
24+
#include "Timer.h"
25+
#include "Ticker.h"
2526

2627
#define UUID_URI_BEACON(FIRST, SECOND) { \
2728
0xee, 0x0c, FIRST, SECOND, 0x87, 0x86, 0x40, 0xba, \
@@ -497,8 +498,8 @@ class EddystoneConfigService
497498

498499
BLEDevice &ble;
499500
Params_t &params;
500-
Ticker timeSinceBootTick;
501-
Timeout switchFrame;
501+
mbed::Ticker timeSinceBootTick;
502+
mbed::Timeout switchFrame;
502503
// Default value that is restored on reset.
503504
PowerLevels_t &defaultAdvPowerLevels; // This goes into the advertising frames (radio power measured at 1m from device).
504505
PowerLevels_t &radioPowerLevels; // This configures the power levels of the radio.

features/FEATURE_BLE/ble/services/EddystoneService.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
#warning ble/services/EddystoneService.h is deprecated. Please use the example in 'github.com/ARMmbed/ble-examples/tree/master/BLE_EddystoneService'.
2121

2222
#include "ble/BLE.h"
23-
#include "mbed.h"
2423
#include "CircularBuffer.h"
24+
#include "Timer.h"
25+
#include "Ticker.h"
26+
#include "Timeout.h"
27+
2528
static const uint8_t BEACON_EDDYSTONE[] = {0xAA, 0xFE};
2629

2730
//Debug is disabled by default
@@ -76,7 +79,7 @@ class EddystoneService
7679
void (*frames[EDDYSTONE_MAX_FRAMETYPE])(uint8_t *, uint32_t);
7780
static const int URI_DATA_MAX = 18;
7881
typedef uint8_t UriData_t[URI_DATA_MAX];
79-
CircularBuffer<FrameTypes, EDDYSTONE_MAX_FRAMETYPE> overflow;
82+
mbed::CircularBuffer<FrameTypes, EDDYSTONE_MAX_FRAMETYPE> overflow;
8083

8184
// UID Frame Type subfields
8285
static const int UID_NAMESPACEID_SIZE = 10;
@@ -543,11 +546,11 @@ class EddystoneService
543546
BLEDevice &ble;
544547
uint16_t advPeriodus;
545548
uint8_t txPower;
546-
Timer timeSinceBootTimer;
549+
mbed::Timer timeSinceBootTimer;
547550
volatile uint32_t lastBootTimerRead;
548551
volatile bool advLock;
549552
volatile FrameTypes frameIndex;
550-
Timeout stopAdv;
553+
mbed::Timeout stopAdv;
551554

552555

553556
// URI Frame Variables
@@ -556,7 +559,7 @@ class EddystoneService
556559
int8_t defaultUrlPower;
557560
bool urlIsSet; // flag that enables / disable URI Frames
558561
float urlAdvPeriod; // how long the url frame will be advertised for
559-
Ticker urlTicker;
562+
mbed::Ticker urlTicker;
560563

561564
// UID Frame Variables
562565
UIDNamespaceID_t defaultUidNamespaceID;
@@ -565,7 +568,7 @@ class EddystoneService
565568
uint16_t uidRFU;
566569
bool uidIsSet; // flag that enables / disable UID Frames
567570
float uidAdvPeriod; // how long the uid frame will be advertised for
568-
Ticker uidTicker;
571+
mbed::Ticker uidTicker;
569572

570573
// TLM Frame Variables
571574
uint8_t TlmVersion;
@@ -575,7 +578,7 @@ class EddystoneService
575578
volatile uint32_t TlmTimeSinceBoot;
576579
bool tlmIsSet; // flag that enables / disables TLM frames
577580
float TlmAdvPeriod; // number of minutes between adv frames
578-
Ticker tlmTicker;
581+
mbed::Ticker tlmTicker;
579582

580583
public:
581584
/*

features/FEATURE_BLE/ble/services/UARTService.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "mbed-drivers/mbed.h"
2222
#include "mbed-drivers/Stream.h"
2323
#else
24-
#include "mbed.h"
2524
#include "Stream.h"
2625
#endif
2726

features/FEATURE_BLE/ble/services/URIBeaconConfigService.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifdef YOTTA_CFG_MBED_OS
2323
#include "mbed-drivers/mbed.h"
2424
#else
25-
#include "mbed.h"
25+
2626
#endif
2727

2828
extern const uint8_t UUID_URI_BEACON_SERVICE[UUID::LENGTH_OF_LONG_UUID];

features/nanostack/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#ifndef MESHINTERFACENANOSTACK_H
1818
#define MESHINTERFACENANOSTACK_H
19-
#include "mbed.h"
2019

2120
#include "MeshInterface.h"
2221
#include "NanostackRfPhy.h"

features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "nanostack/net_interface.h"
2222
#include "thread_management_if.h"
2323
#include "ip6string.h"
24+
#include "mbed_error.h"
2425

2526
char *Nanostack::Interface::get_ip_address(char *buf, nsapi_size_t buflen)
2627
{

features/nanostack/mbed-mesh-api/source/NanostackEMACInterface.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "arm_hal_phy.h"
99
#include "EMAC.h"
1010
#include "enet_tasklet.h"
11+
#include "mbed_interface.h"
1112

1213
class EMACPhy : public NanostackEthernetPhy {
1314
public:

features/nanostack/mbed-mesh-api/source/WisunInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Nanostack::WisunInterface *WisunInterface::get_interface() const
5050
nsapi_error_t WisunInterface::do_initialize()
5151
{
5252
if (!_interface) {
53-
_interface = new (nothrow) Nanostack::WisunInterface(*_phy);
53+
_interface = new (std::nothrow) Nanostack::WisunInterface(*_phy);
5454
if (!_interface) {
5555
return NSAPI_ERROR_NO_MEMORY;
5656
}

features/nanostack/mbed-mesh-api/source/include/callback_handler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#ifndef __INCLUDE_CALLBACK_HANDLER_H__
1818
#define __INCLUDE_CALLBACK_HANDLER_H__
1919

20-
#include "mbed.h"
2120
#include "mesh_interface_types.h"
2221

2322
#ifdef __cplusplus

features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_fhss_timer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616
#include "ns_types.h"
1717
#include "fhss_api.h"
1818
#include "fhss_config.h"
19-
#include "mbed.h"
2019
#include "mbed_trace.h"
2120
#include "platform/arm_hal_interrupt.h"
2221
#include <Timer.h>
22+
#include "equeue.h"
23+
#include "EventQueue.h"
24+
#include "mbed_shared_queues.h"
25+
#include "Timeout.h"
2326

2427
#define TRACE_GROUP "fhdr"
2528
#ifndef NUMBER_OF_SIMULTANEOUS_TIMEOUTS

features/nanostack/nanostack-interface/NanostackInterface.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#ifndef NANOSTACK_INTERFACE_H_
1919
#define NANOSTACK_INTERFACE_H_
2020

21-
#include "mbed.h"
2221
#include "MeshInterface.h"
2322
// Include here for backward compatibility
2423
#include "LoWPANNDInterface.h"

features/nanostack/targets/TARGET_NCS36510/NanostackRfPhyNcs36510.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
#include "mbed.h"
16+
1717
#include "ns_types.h"
1818
#include <string.h>
1919
#include "common_functions.h"
@@ -33,6 +33,10 @@ extern "C" {
3333

3434
#define SIGNAL_COUNT_RADIO 1
3535

36+
#include "Thread.h"
37+
#include "ThisThread.h"
38+
#include "mbed_error.h"
39+
using namespace rtos;
3640
static void rf_thread_loop();
3741
Thread rf_thread(osPriorityRealtime, RF_THREAD_STACK_SIZE);
3842

features/nanostack/targets/TARGET_NCS36510/NanostackRfPhyNcs36510.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#ifndef NANOSTACK_PHY_NCS36510_H_
1818
#define NANOSTACK_PHY_NCS36510_H_
1919

20-
#include "mbed.h"
2120
#include "NanostackRfPhy.h"
2221

2322
class NanostackRfPhyNcs36510 : public NanostackRfPhy {

features/netsocket/NetworkStack.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616

1717
#include "NetworkStack.h"
1818
#include "nsapi_dns.h"
19-
#include "mbed.h"
2019
#include "stddef.h"
2120
#include <new>
21+
#include "EventQueue.h"
22+
#include "mbed_shared_queues.h"
2223

2324
// Default NetworkStack operations
2425
const char *NetworkStack::get_ip_address()

features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
#include "mbed_trace.h"
2525
#define TRACE_GROUP "UCID"
2626

27+
#include "mbed_wait_api.h"
28+
29+
using namespace mbed;
30+
2731
/**
2832
* PDP (packet data profile) Context
2933
*/

features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
#include "CellularBase.h"
2020
#include "platform/ATCmdParser.h"
21-
#include "mbed.h"
21+
#include "ATCmdParser.h"
22+
#include "FileHandle.h"
23+
#include "Callback.h"
2224

2325
#if NSAPI_PPP_AVAILABLE
2426

@@ -114,7 +116,7 @@ class PPPCellularInterface : public CellularBase {
114116
* use - this permits a derived class to pass a pointer to a not-yet-constructed member object.
115117
*/
116118
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
117-
PPPCellularInterface(FileHandle *fh, bool debug = false);
119+
PPPCellularInterface(mbed::FileHandle *fh, bool debug = false);
118120

119121
/** Destructor
120122
*
@@ -286,7 +288,7 @@ class PPPCellularInterface : public CellularBase {
286288
* @param status_cb The callback for status changes
287289
*/
288290
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
289-
virtual void attach(Callback<void(nsapi_event_t, intptr_t)> status_cb);
291+
virtual void attach(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb);
290292

291293
/** Get the connection status
292294
*
@@ -308,16 +310,16 @@ class PPPCellularInterface : public CellularBase {
308310
virtual nsapi_error_t set_blocking(bool blocking);
309311

310312
private:
311-
FileHandle *_fh;
312-
ATCmdParser *_at;
313+
mbed::FileHandle *_fh;
314+
mbed::ATCmdParser *_at;
313315
const char *_new_pin;
314316
const char *_pin;
315317
const char *_apn;
316318
const char *_uname;
317319
const char *_pwd;
318320
bool _debug_trace_on;
319321
nsapi_ip_stack_t _stack;
320-
Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
322+
mbed::Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
321323
nsapi_connection_status_t _connect_status;
322324
bool _connect_is_blocking;
323325
void base_initialization();

features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class UARTCellularInterface : public PPPCellularInterface {
5454
virtual ~UARTCellularInterface();
5555

5656
private:
57-
UARTSerial _serial;
57+
mbed::UARTSerial _serial;
5858
PinName _dcd_pin;
5959
bool _active_high;
6060

rtos/rtos.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@
4242
using namespace rtos;
4343
#endif
4444

45-
/* Get mbed lib version number, as RTOS depends on mbed lib features
46-
like mbed_error, Callback and others.
47-
*/
48-
#include "mbed.h"
45+
#include "platform/mbed_version.h"
4946

5047
#endif
5148

0 commit comments

Comments
 (0)