Skip to content

Commit 28e44ac

Browse files
committed
Fix compilation warnings by using the Chrono based time argument in EventQueue call_every() API call.
1 parent b1629b7 commit 28e44ac

File tree

7 files changed

+27
-14
lines changed

7 files changed

+27
-14
lines changed

features/netsocket/emac-drivers/TARGET_ARM_FM/COMPONENT_LAN91C111/fvp_emac.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "netsocket/nsapi_types.h"
2727
#include "mbed_shared_queues.h"
2828

29+
using namespace std::chrono;
2930

3031
/********************************************************************************
3132
* Internal data
@@ -40,7 +41,7 @@
4041
/** \brief Driver thread priority */
4142
#define THREAD_PRIORITY (osPriorityNormal)
4243

43-
#define PHY_TASK_PERIOD_MS 200
44+
#define PHY_TASK_PERIOD 200ms
4445

4546

4647
fvp_EMAC::fvp_EMAC() : _thread(THREAD_PRIORITY, THREAD_STACKSIZE, NULL, "fvp_emac_thread")
@@ -229,7 +230,7 @@ bool fvp_EMAC::power_up()
229230
/* Allow the PHY task to detect the initial link state and set up the proper flags */
230231
ThisThread::sleep_for(10);
231232

232-
_phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD_MS, mbed::callback(this, &fvp_EMAC::phy_task));
233+
_phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD, mbed::callback(this, &fvp_EMAC::phy_task));
233234

234235
return true;
235236
}

features/netsocket/emac-drivers/TARGET_Freescale_EMAC/kinetis_emac.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
#include "kinetis_emac.h"
4949
#include "mbed_power_mgmt.h"
5050

51+
using namespace std::chrono;
52+
5153
enet_handle_t g_handle;
5254
// TX Buffer descriptors
5355
uint8_t *tx_desc_start_addr;
@@ -75,7 +77,7 @@ extern "C" void kinetis_init_eth_hardware(void);
7577
/** \brief Driver thread priority */
7678
#define THREAD_PRIORITY (osPriorityNormal)
7779

78-
#define PHY_TASK_PERIOD_MS 200
80+
#define PHY_TASK_PERIOD 200ms
7981

8082
Kinetis_EMAC::Kinetis_EMAC() : xTXDCountSem(ENET_TX_RING_LEN, ENET_TX_RING_LEN), hwaddr()
8183
{
@@ -507,7 +509,7 @@ bool Kinetis_EMAC::power_up()
507509
/* Allow the PHY task to detect the initial link state and set up the proper flags */
508510
osDelay(10);
509511

510-
phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD_MS, mbed::callback(this, &Kinetis_EMAC::phy_task));
512+
phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD, mbed::callback(this, &Kinetis_EMAC::phy_task));
511513

512514
return true;
513515
}

features/netsocket/emac-drivers/TARGET_GD_EMAC/gd32xx_emac.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@
2727

2828
#include "gd32xx_emac.h"
2929

30+
using namespace std::chrono;
31+
3032
/* \brief Flags for worker thread */
3133
#define _ENET_FLAG_RX (1)
3234

3335
/** \brief Driver thread priority */
3436
#define _THREAD_STACKSIZE (512)
3537
#define _THREAD_PRIORITY (osPriorityHigh)
3638

37-
#define _PHY_TASK_PERIOD_MS (200)
39+
#define _PHY_TASK_PERIOD (200ms)
3840

3941
#define _ENET_HW_ADDR_SIZE (6)
4042
#define _ENET_MTU_SIZE (1500)
@@ -345,7 +347,7 @@ bool GD32_EMAC::power_up()
345347
/* Worker thread */
346348
rx_thread = create_new_thread("gd32_emac_thread", &GD32_EMAC::thread_function, this, _THREAD_STACKSIZE, _THREAD_PRIORITY, &rx_thread_cb);
347349

348-
phy_task_handle = mbed::mbed_event_queue()->call_every(_PHY_TASK_PERIOD_MS, mbed::callback(this, &GD32_EMAC::phy_task));
350+
phy_task_handle = mbed::mbed_event_queue()->call_every(_PHY_TASK_PERIOD, mbed::callback(this, &GD32_EMAC::phy_task));
349351

350352
/* Allow the PHY task to detect the initial link state and set up the proper flags */
351353
osDelay(10);

features/netsocket/emac-drivers/TARGET_NUVOTON_EMAC/numaker_emac.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#include "numaker_emac.h"
3737
#include "numaker_eth_hal.h"
3838

39+
using namespace std::chrono;
40+
3941
/********************************************************************************
4042
*
4143
********************************************************************************/
@@ -53,7 +55,7 @@ extern "C" void numaker_eth_rx_next(void);
5355
/** \brief Driver thread priority */
5456
#define THREAD_PRIORITY (osPriorityNormal)
5557

56-
#define PHY_TASK_PERIOD_MS 200
58+
#define PHY_TASK_PERIOD 200ms
5759

5860
NUMAKER_EMAC::NUMAKER_EMAC() : thread(0), hwaddr()
5961
{
@@ -331,7 +333,7 @@ bool NUMAKER_EMAC::power_up()
331333
/* PHY monitoring task */
332334
phy_state = PHY_UNLINKED_STATE;
333335

334-
phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD_MS, mbed::callback(this, &NUMAKER_EMAC::phy_task));
336+
phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD, mbed::callback(this, &NUMAKER_EMAC::phy_task));
335337

336338
/* Allow the PHY task to detect the initial link state and set up the proper flags */
337339
osDelay(10);

features/netsocket/emac-drivers/TARGET_NXP_EMAC/TARGET_IMX/imx_emac.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
#include "imx_emac.h"
4949
#include "mbed_power_mgmt.h"
5050

51+
using namespace std::chrono;
52+
5153
enet_handle_t g_handle;
5254
// RX packet buffer pointers
5355
emac_mem_buf_t *rx_buff[ENET_RX_RING_LEN];
@@ -71,7 +73,7 @@ extern "C" void kinetis_init_eth_hardware(void);
7173
/** \brief Driver thread priority */
7274
#define THREAD_PRIORITY (osPriorityNormal)
7375

74-
#define PHY_TASK_PERIOD_MS 200
76+
#define PHY_TASK_PERIOD 200ms
7577

7678
Kinetis_EMAC::Kinetis_EMAC() : xTXDCountSem(ENET_TX_RING_LEN, ENET_TX_RING_LEN), hwaddr()
7779
{
@@ -511,7 +513,7 @@ bool Kinetis_EMAC::power_up()
511513
/* Allow the PHY task to detect the initial link state and set up the proper flags */
512514
osDelay(10);
513515

514-
phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD_MS, mbed::callback(this, &Kinetis_EMAC::phy_task));
516+
phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD, mbed::callback(this, &Kinetis_EMAC::phy_task));
515517

516518
return true;
517519
}

features/netsocket/emac-drivers/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/lpc546xx_emac.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include "lpc546xx_emac_config.h"
3232
#include "lpc546xx_emac.h"
3333

34+
using namespace std::chrono;
35+
3436
enet_handle_t g_handle;
3537
// RX packet buffer pointers
3638
emac_mem_buf_t *rx_buff[ENET_RX_RING_LEN];
@@ -54,7 +56,7 @@ extern "C" void lpc546xx_init_eth_hardware(void);
5456
/** \brief Driver thread priority */
5557
#define THREAD_PRIORITY (osPriorityNormal)
5658

57-
#define PHY_TASK_PERIOD_MS 200
59+
#define PHY_TASK_PERIOD 200ms
5860

5961
LPC546XX_EMAC::LPC546XX_EMAC() : xTXDCountSem(ENET_TX_RING_LEN, ENET_TX_RING_LEN), hwaddr()
6062
{
@@ -497,7 +499,7 @@ bool LPC546XX_EMAC::power_up()
497499
prev_state.speed = (phy_speed_t)STATE_UNKNOWN;
498500
prev_state.duplex = (phy_duplex_t)STATE_UNKNOWN;
499501

500-
phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD_MS, mbed::callback(this, &LPC546XX_EMAC::phy_task));
502+
phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD, mbed::callback(this, &LPC546XX_EMAC::phy_task));
501503

502504
/* Allow the PHY task to detect the initial link state and set up the proper flags */
503505
osDelay(10);

features/netsocket/emac-drivers/TARGET_STM/stm32xx_emac.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,15 @@
5252
#include "lwip/api.h"
5353
#endif
5454

55+
using namespace std::chrono;
56+
5557
/* \brief Flags for worker thread */
5658
#define FLAG_RX 1
5759

5860
/** \brief Driver thread priority */
5961
#define THREAD_PRIORITY (osPriorityHigh)
6062

61-
#define PHY_TASK_PERIOD_MS 200
63+
#define PHY_TASK_PERIOD 200ms
6264

6365
#define STM_HWADDR_SIZE (6)
6466
#define STM_ETH_MTU_SIZE 1500
@@ -890,7 +892,7 @@ bool STM32_EMAC::power_up()
890892
#endif
891893

892894

893-
phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD_MS, mbed::callback(this, &STM32_EMAC::phy_task));
895+
phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD, mbed::callback(this, &STM32_EMAC::phy_task));
894896

895897
#if defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx)\
896898
|| defined (STM32F779xx)

0 commit comments

Comments
 (0)