diff --git a/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp b/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp index 2c06a77753..640179aa05 100644 --- a/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp +++ b/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp @@ -26,6 +26,12 @@ #include "nanostack/platform/arm_hal_phy.h" #include "mbed_trace.h" #include "mbed_toolchain.h" +#include "DigitalIn.h" +#include "DigitalOut.h" +#include "InterruptIn.h" +#include "SPI.h" +#include "inttypes.h" +#include "Timeout.h" #define TRACE_GROUP "AtRF" @@ -219,8 +225,9 @@ static inline rf_trx_states_t rf_if_trx_status_from_full(uint8_t full_trx_status } #ifdef MBED_CONF_RTOS_PRESENT -#include "mbed.h" + #include "rtos.h" + using namespace mbed; using namespace rtos; diff --git a/components/802.15.4_RF/mcr20a-rf-driver/mcr20a-rf-driver/NanostackRfPhyMcr20a.h b/components/802.15.4_RF/mcr20a-rf-driver/mcr20a-rf-driver/NanostackRfPhyMcr20a.h index 3d17ef2579..0f94b68bd6 100644 --- a/components/802.15.4_RF/mcr20a-rf-driver/mcr20a-rf-driver/NanostackRfPhyMcr20a.h +++ b/components/802.15.4_RF/mcr20a-rf-driver/mcr20a-rf-driver/NanostackRfPhyMcr20a.h @@ -18,8 +18,13 @@ #define NANOSTACK_PHY_MCR20A_H_ #if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && defined(MBED_CONF_RTOS_PRESENT) -#include "mbed.h" +#include "inttypes.h" #include "NanostackRfPhy.h" +#include "DigitalIn.h" +#include "DigitalOut.h" +#include "InterruptIn.h" +#include "SPI.h" +#include "rtos.h" // Arduino pin defaults for convenience #if !defined(MCR20A_SPI_MOSI) diff --git a/components/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp b/components/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp index 3039a0b6f8..2b6df834aa 100644 --- a/components/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp +++ b/components/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp @@ -22,6 +22,7 @@ #include "nanostack/platform/arm_hal_phy.h" #include #include "rtos.h" +#include "mbed_interface.h" using namespace mbed; using namespace rtos; diff --git a/components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp b/components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp index 87f865a87c..e056c1420c 100644 --- a/components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp +++ b/components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp @@ -26,6 +26,12 @@ #include "mbed_toolchain.h" #include "common_functions.h" #include +#include "Timeout.h" +#include "Thread.h" +#include "mbed_wait_api.h" + +using namespace mbed; +using namespace rtos; #define TRACE_GROUP "s2lp" @@ -216,7 +222,7 @@ static const phy_device_channel_page_s phy_channel_pages[] = { }; #ifdef MBED_CONF_RTOS_PRESENT -#include "mbed.h" + #include "rtos.h" static void rf_irq_task_process_irq(); diff --git a/components/802.15.4_RF/stm-s2lp-rf-driver/stm-s2lp-rf-driver/NanostackRfPhys2lp.h b/components/802.15.4_RF/stm-s2lp-rf-driver/stm-s2lp-rf-driver/NanostackRfPhys2lp.h index b24b855216..8cdb99a628 100644 --- a/components/802.15.4_RF/stm-s2lp-rf-driver/stm-s2lp-rf-driver/NanostackRfPhys2lp.h +++ b/components/802.15.4_RF/stm-s2lp-rf-driver/stm-s2lp-rf-driver/NanostackRfPhys2lp.h @@ -18,8 +18,12 @@ #define NANOSTACK_PHY_S2LP_H_ #if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && defined(MBED_CONF_RTOS_PRESENT) -#include "mbed.h" +#include "inttypes.h" #include "NanostackRfPhy.h" +#include "DigitalIn.h" +#include "DigitalOut.h" +#include "InterruptIn.h" +#include "SPI.h" // Uncomment to use testing gpios attached to TX/RX processes //#define TEST_GPIOS_ENABLED diff --git a/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp b/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp index 7fd590fc2f..147ef816a6 100644 --- a/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp +++ b/components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp @@ -19,7 +19,6 @@ #include "FlashIAPBlockDevice.h" #include "mbed_critical.h" -#include "mbed.h" using namespace mbed; #include diff --git a/features/FEATURE_BLE/ble/services/EddystoneConfigService.h b/features/FEATURE_BLE/ble/services/EddystoneConfigService.h index f21bd13a50..99bed208b1 100644 --- a/features/FEATURE_BLE/ble/services/EddystoneConfigService.h +++ b/features/FEATURE_BLE/ble/services/EddystoneConfigService.h @@ -19,9 +19,10 @@ #warning ble/services/EddystoneConfigService.h is deprecated. Please use the example in 'github.com/ARMmbed/ble-examples/tree/master/BLE_EddystoneService'. -#include "mbed.h" #include "ble/BLE.h" #include "ble/services/EddystoneService.h" +#include "Timer.h" +#include "Ticker.h" #define UUID_URI_BEACON(FIRST, SECOND) { \ 0xee, 0x0c, FIRST, SECOND, 0x87, 0x86, 0x40, 0xba, \ @@ -497,8 +498,8 @@ private: BLEDevice &ble; Params_t ¶ms; - Ticker timeSinceBootTick; - Timeout switchFrame; + mbed::Ticker timeSinceBootTick; + mbed::Timeout switchFrame; // Default value that is restored on reset. PowerLevels_t &defaultAdvPowerLevels; // This goes into the advertising frames (radio power measured at 1m from device). PowerLevels_t &radioPowerLevels; // This configures the power levels of the radio. diff --git a/features/FEATURE_BLE/ble/services/EddystoneService.h b/features/FEATURE_BLE/ble/services/EddystoneService.h index 014288fe18..4a42a98548 100644 --- a/features/FEATURE_BLE/ble/services/EddystoneService.h +++ b/features/FEATURE_BLE/ble/services/EddystoneService.h @@ -20,8 +20,11 @@ #warning ble/services/EddystoneService.h is deprecated. Please use the example in 'github.com/ARMmbed/ble-examples/tree/master/BLE_EddystoneService'. #include "ble/BLE.h" -#include "mbed.h" #include "CircularBuffer.h" +#include "Timer.h" +#include "Ticker.h" +#include "Timeout.h" + static const uint8_t BEACON_EDDYSTONE[] = {0xAA, 0xFE}; //Debug is disabled by default @@ -76,7 +79,7 @@ public: void (*frames[EDDYSTONE_MAX_FRAMETYPE])(uint8_t *, uint32_t); static const int URI_DATA_MAX = 18; typedef uint8_t UriData_t[URI_DATA_MAX]; - CircularBuffer overflow; + mbed::CircularBuffer overflow; // UID Frame Type subfields static const int UID_NAMESPACEID_SIZE = 10; @@ -543,11 +546,11 @@ private: BLEDevice &ble; uint16_t advPeriodus; uint8_t txPower; - Timer timeSinceBootTimer; + mbed::Timer timeSinceBootTimer; volatile uint32_t lastBootTimerRead; volatile bool advLock; volatile FrameTypes frameIndex; - Timeout stopAdv; + mbed::Timeout stopAdv; // URI Frame Variables @@ -556,7 +559,7 @@ private: int8_t defaultUrlPower; bool urlIsSet; // flag that enables / disable URI Frames float urlAdvPeriod; // how long the url frame will be advertised for - Ticker urlTicker; + mbed::Ticker urlTicker; // UID Frame Variables UIDNamespaceID_t defaultUidNamespaceID; @@ -565,7 +568,7 @@ private: uint16_t uidRFU; bool uidIsSet; // flag that enables / disable UID Frames float uidAdvPeriod; // how long the uid frame will be advertised for - Ticker uidTicker; + mbed::Ticker uidTicker; // TLM Frame Variables uint8_t TlmVersion; @@ -575,7 +578,7 @@ private: volatile uint32_t TlmTimeSinceBoot; bool tlmIsSet; // flag that enables / disables TLM frames float TlmAdvPeriod; // number of minutes between adv frames - Ticker tlmTicker; + mbed::Ticker tlmTicker; public: /* diff --git a/features/FEATURE_BLE/ble/services/UARTService.h b/features/FEATURE_BLE/ble/services/UARTService.h index 43da23c6f9..241db763b4 100644 --- a/features/FEATURE_BLE/ble/services/UARTService.h +++ b/features/FEATURE_BLE/ble/services/UARTService.h @@ -21,7 +21,6 @@ #include "mbed-drivers/mbed.h" #include "mbed-drivers/Stream.h" #else -#include "mbed.h" #include "Stream.h" #endif diff --git a/features/FEATURE_BLE/ble/services/URIBeaconConfigService.h b/features/FEATURE_BLE/ble/services/URIBeaconConfigService.h index ba27c4b434..6a6a583431 100644 --- a/features/FEATURE_BLE/ble/services/URIBeaconConfigService.h +++ b/features/FEATURE_BLE/ble/services/URIBeaconConfigService.h @@ -22,7 +22,7 @@ #ifdef YOTTA_CFG_MBED_OS #include "mbed-drivers/mbed.h" #else -#include "mbed.h" + #endif extern const uint8_t UUID_URI_BEACON_SERVICE[UUID::LENGTH_OF_LONG_UUID]; diff --git a/features/nanostack/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h b/features/nanostack/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h index f6c3c8a53d..f157a598fc 100644 --- a/features/nanostack/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h +++ b/features/nanostack/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h @@ -16,7 +16,6 @@ #ifndef MESHINTERFACENANOSTACK_H #define MESHINTERFACENANOSTACK_H -#include "mbed.h" #include "MeshInterface.h" #include "NanostackRfPhy.h" diff --git a/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp b/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp index 44df5ce324..c2df8c5567 100644 --- a/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp +++ b/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp @@ -21,6 +21,7 @@ #include "nanostack/net_interface.h" #include "thread_management_if.h" #include "ip6string.h" +#include "mbed_error.h" char *Nanostack::Interface::get_ip_address(char *buf, nsapi_size_t buflen) { diff --git a/features/nanostack/mbed-mesh-api/source/NanostackEMACInterface.cpp b/features/nanostack/mbed-mesh-api/source/NanostackEMACInterface.cpp index a62acd69ff..cecb39cabc 100644 --- a/features/nanostack/mbed-mesh-api/source/NanostackEMACInterface.cpp +++ b/features/nanostack/mbed-mesh-api/source/NanostackEMACInterface.cpp @@ -8,6 +8,7 @@ #include "arm_hal_phy.h" #include "EMAC.h" #include "enet_tasklet.h" +#include "mbed_interface.h" class EMACPhy : public NanostackEthernetPhy { public: diff --git a/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp b/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp index 9952bdc6ea..83fdedc1be 100644 --- a/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp +++ b/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp @@ -50,7 +50,7 @@ Nanostack::WisunInterface *WisunInterface::get_interface() const nsapi_error_t WisunInterface::do_initialize() { if (!_interface) { - _interface = new (nothrow) Nanostack::WisunInterface(*_phy); + _interface = new (std::nothrow) Nanostack::WisunInterface(*_phy); if (!_interface) { return NSAPI_ERROR_NO_MEMORY; } diff --git a/features/nanostack/mbed-mesh-api/source/include/callback_handler.h b/features/nanostack/mbed-mesh-api/source/include/callback_handler.h index 24ba727585..3056eb4a09 100644 --- a/features/nanostack/mbed-mesh-api/source/include/callback_handler.h +++ b/features/nanostack/mbed-mesh-api/source/include/callback_handler.h @@ -17,7 +17,6 @@ #ifndef __INCLUDE_CALLBACK_HANDLER_H__ #define __INCLUDE_CALLBACK_HANDLER_H__ -#include "mbed.h" #include "mesh_interface_types.h" #ifdef __cplusplus diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_fhss_timer.cpp b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_fhss_timer.cpp index 56b8a57dec..0c19a7cf74 100644 --- a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_fhss_timer.cpp +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_fhss_timer.cpp @@ -16,10 +16,13 @@ #include "ns_types.h" #include "fhss_api.h" #include "fhss_config.h" -#include "mbed.h" #include "mbed_trace.h" #include "platform/arm_hal_interrupt.h" #include +#include "equeue.h" +#include "EventQueue.h" +#include "mbed_shared_queues.h" +#include "Timeout.h" #define TRACE_GROUP "fhdr" #ifndef NUMBER_OF_SIMULTANEOUS_TIMEOUTS diff --git a/features/nanostack/nanostack-interface/NanostackInterface.h b/features/nanostack/nanostack-interface/NanostackInterface.h index 2e41253a8e..c8ac3f1fa8 100644 --- a/features/nanostack/nanostack-interface/NanostackInterface.h +++ b/features/nanostack/nanostack-interface/NanostackInterface.h @@ -18,7 +18,6 @@ #ifndef NANOSTACK_INTERFACE_H_ #define NANOSTACK_INTERFACE_H_ -#include "mbed.h" #include "MeshInterface.h" // Include here for backward compatibility #include "LoWPANNDInterface.h" diff --git a/features/nanostack/targets/TARGET_NCS36510/NanostackRfPhyNcs36510.cpp b/features/nanostack/targets/TARGET_NCS36510/NanostackRfPhyNcs36510.cpp index f88b2ca2db..061f11ba04 100644 --- a/features/nanostack/targets/TARGET_NCS36510/NanostackRfPhyNcs36510.cpp +++ b/features/nanostack/targets/TARGET_NCS36510/NanostackRfPhyNcs36510.cpp @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "mbed.h" + #include "ns_types.h" #include #include "common_functions.h" @@ -33,6 +33,10 @@ extern "C" { #define SIGNAL_COUNT_RADIO 1 +#include "Thread.h" +#include "ThisThread.h" +#include "mbed_error.h" +using namespace rtos; static void rf_thread_loop(); Thread rf_thread(osPriorityRealtime, RF_THREAD_STACK_SIZE); diff --git a/features/nanostack/targets/TARGET_NCS36510/NanostackRfPhyNcs36510.h b/features/nanostack/targets/TARGET_NCS36510/NanostackRfPhyNcs36510.h index af4172c95a..32caedf741 100644 --- a/features/nanostack/targets/TARGET_NCS36510/NanostackRfPhyNcs36510.h +++ b/features/nanostack/targets/TARGET_NCS36510/NanostackRfPhyNcs36510.h @@ -17,7 +17,6 @@ #ifndef NANOSTACK_PHY_NCS36510_H_ #define NANOSTACK_PHY_NCS36510_H_ -#include "mbed.h" #include "NanostackRfPhy.h" class NanostackRfPhyNcs36510 : public NanostackRfPhy { diff --git a/features/netsocket/NetworkStack.cpp b/features/netsocket/NetworkStack.cpp index 72b012d4eb..8d671da51b 100644 --- a/features/netsocket/NetworkStack.cpp +++ b/features/netsocket/NetworkStack.cpp @@ -16,9 +16,10 @@ #include "NetworkStack.h" #include "nsapi_dns.h" -#include "mbed.h" #include "stddef.h" #include +#include "EventQueue.h" +#include "mbed_shared_queues.h" // Default NetworkStack operations const char *NetworkStack::get_ip_address() diff --git a/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp b/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp index 6fb7d46669..c0ebe799a9 100644 --- a/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp +++ b/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp @@ -24,6 +24,10 @@ #include "mbed_trace.h" #define TRACE_GROUP "UCID" +#include "mbed_wait_api.h" + +using namespace mbed; + /** * PDP (packet data profile) Context */ diff --git a/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.h b/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.h index 525c7c9f9c..4f98293f3c 100644 --- a/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.h +++ b/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.h @@ -18,7 +18,9 @@ #include "CellularBase.h" #include "platform/ATCmdParser.h" -#include "mbed.h" +#include "ATCmdParser.h" +#include "FileHandle.h" +#include "Callback.h" #if NSAPI_PPP_AVAILABLE @@ -114,7 +116,7 @@ public: * use - this permits a derived class to pass a pointer to a not-yet-constructed member object. */ MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.") - PPPCellularInterface(FileHandle *fh, bool debug = false); + PPPCellularInterface(mbed::FileHandle *fh, bool debug = false); /** Destructor * @@ -286,7 +288,7 @@ public: * @param status_cb The callback for status changes */ MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.") - virtual void attach(Callback status_cb); + virtual void attach(mbed::Callback status_cb); /** Get the connection status * @@ -308,8 +310,8 @@ public: virtual nsapi_error_t set_blocking(bool blocking); private: - FileHandle *_fh; - ATCmdParser *_at; + mbed::FileHandle *_fh; + mbed::ATCmdParser *_at; const char *_new_pin; const char *_pin; const char *_apn; @@ -317,7 +319,7 @@ private: const char *_pwd; bool _debug_trace_on; nsapi_ip_stack_t _stack; - Callback _connection_status_cb; + mbed::Callback _connection_status_cb; nsapi_connection_status_t _connect_status; bool _connect_is_blocking; void base_initialization(); diff --git a/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.h b/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.h index b35bfa0a84..e1d2745902 100644 --- a/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.h +++ b/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.h @@ -54,7 +54,7 @@ public: virtual ~UARTCellularInterface(); private: - UARTSerial _serial; + mbed::UARTSerial _serial; PinName _dcd_pin; bool _active_high; diff --git a/rtos/rtos.h b/rtos/rtos.h index 22d5302421..c2d4ad5a98 100644 --- a/rtos/rtos.h +++ b/rtos/rtos.h @@ -42,10 +42,7 @@ using namespace rtos; #endif -/* Get mbed lib version number, as RTOS depends on mbed lib features - like mbed_error, Callback and others. -*/ -#include "mbed.h" +#include "platform/mbed_version.h" #endif diff --git a/targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp b/targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp index 6580b83e2a..2ec69ccdbe 100644 --- a/targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp +++ b/targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp @@ -19,6 +19,7 @@ #include #include "mbed_assert.h" #include "mbed_events.h" +#include "mbed_wait_api.h" #include "rtw_emac.h" #include "EMACMemoryManager.h" @@ -33,7 +34,7 @@ #define RTW_EMAC_MTU_SIZE (1500U) -RTW_EMAC::RTW_EMAC() +RTW_EMAC::RTW_EMAC() { set_callback_func((emac_callback)(&RTW_EMAC::wlan_emac_recv), this); } @@ -66,7 +67,7 @@ bool RTW_EMAC::get_hwaddr(uint8_t *addr) const int i; if (RTW_SUCCESS == wifi_get_mac_address(mac)) { - if (sscanf(mac, "%x:%x:%x:%x:%x:%x", + if (sscanf(mac, "%x:%x:%x:%x:%x:%x", &val[0], &val[1], &val[2], &val[3], &val[4], &val[5]) != 6) { printf("Get HW address failed\r\n"); } @@ -177,7 +178,7 @@ void RTW_EMAC::wlan_emac_recv(void *param, struct netif *netif, uint32_t len) buf = enet->memory_manager->alloc_heap(len, 0); if (buf == NULL) { return; - } + } enet->memory_manager->set_len(buf, len); p = buf; @@ -206,7 +207,7 @@ void mbed_default_mac_address(char *mac) { void mbed_mac_address(char *mac) { - char hwaddr[20]; + char hwaddr[20]; int val[6]; int i; if (RTW_SUCCESS == wifi_get_mac_address(hwaddr)) {