diff --git a/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp b/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp index 5220221a10..7124fce635 100644 --- a/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp +++ b/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp @@ -127,6 +127,7 @@ void fpga_pwm_period_fill_test(PinName pin, uint32_t period_ms, uint32_t fill_pr break; } + // wait_us is safe to call as this test disable the IRQs on execution. wait_us(PERIOD_US(period_ms)); tester.io_metrics_start(); diff --git a/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/drivers/smsc9220_eth_drv.c b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/drivers/smsc9220_eth_drv.c index 5c929a740c..3ef7501f18 100644 --- a/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/drivers/smsc9220_eth_drv.c +++ b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/drivers/smsc9220_eth_drv.c @@ -859,7 +859,7 @@ uint32_t smsc9220_get_tx_data_fifo_size( enum smsc9220_error_t smsc9220_init( const struct smsc9220_eth_dev_t* dev, - void(* wait_ms_function)(int)) + void(* wait_ms_function)(uint32_t)) { uint32_t phyreset = 0; enum smsc9220_error_t error = SMSC9220_ERROR_NONE; diff --git a/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/drivers/smsc9220_eth_drv.h b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/drivers/smsc9220_eth_drv.h index 3c60f45bbb..296bb59745 100644 --- a/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/drivers/smsc9220_eth_drv.h +++ b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/drivers/smsc9220_eth_drv.h @@ -38,7 +38,7 @@ struct smsc9220_eth_dev_cfg_t { struct smsc9220_eth_dev_data_t { uint32_t state; /*!< Indicates if the SMSC9220 driver is initialized and enabled */ - void (*wait_ms) (int);/*!< function pointer to system's millisec delay + void (*wait_ms) (uint32_t);/*!< function pointer to system's millisec delay function, will be used for delays */ uint32_t ongoing_packet_length;/*!< size in bytes of the packet is being sent */ @@ -195,7 +195,7 @@ enum smsc9220_fifo_level_irq_pos_t{ * \return error code /ref smsc9220_error_t */ enum smsc9220_error_t smsc9220_init(const struct smsc9220_eth_dev_t* dev, - void(* wait_ms_function)(int)); + void(* wait_ms_function)(uint32_t)); /** * \brief Reads the MAC register. diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/trng_api_esp32.cpp b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/trng_api_esp32.cpp index d2f1b17c8f..d99a1e1cbd 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/trng_api_esp32.cpp +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/trng_api_esp32.cpp @@ -17,6 +17,7 @@ #if DEVICE_TRNG #include "drivers/I2C.h" #include "platform/mbed_wait_api.h" +#include "rtos/ThisThread.h" #define ESP32_I2C_ADDR (0x28<<1) #define RETRY_CNT_MAX (20) @@ -47,7 +48,9 @@ extern "C" void trng_init_esp32(void) GPIOPM3 &= ~0x4000; /* Output mode */ GPIOP3 |= 0x4000; /* Outputs hi level */ - ThisThread::sleep_for(5); + + rtos::ThisThread::sleep_for(5); + GPIOP5 |= 0x0008; /* Outputs hi level */ } } @@ -84,7 +87,7 @@ extern "C" int trng_get_bytes_esp32(uint8_t *output, size_t length, size_t *outp } if (ret != 0) { retry_cnt++; - ThisThread::sleep_for(100); + rtos::ThisThread::sleep_for(100); } } if (retry_cnt >= RETRY_CNT_MAX) { diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.cpp b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.cpp index d5307b6382..cc6d08bb06 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.cpp +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.cpp @@ -49,7 +49,7 @@ nsapi_error_t ONBOARD_TELIT_HE910::soft_power_on() /* keep the power line low for 200 milisecond */ press_power_button(200); /* give modem a little time to respond */ - ThisThread::sleep_for(100); + rtos::ThisThread::sleep_for(100); // From Telit_xE910 Global form factor App note: It is mandatory to avoid sending data to the serial ports during the first 200ms of the module start-up. rtos::ThisThread::sleep_for(200); return NSAPI_ERROR_OK; @@ -64,7 +64,7 @@ nsapi_error_t ONBOARD_TELIT_HE910::soft_power_off() * If 3G_ON_OFF pin is kept low for more than a second, a controlled disconnect and shutdown takes * place, Due to the network disconnect, shut-off can take up to 30 seconds. However, we wait for 10 * seconds only */ - ThisThread::sleep_for(10 * 1000); + rtos::ThisThread::sleep_for(10 * 1000); return NSAPI_ERROR_OK; } @@ -74,7 +74,7 @@ void ONBOARD_TELIT_HE910::press_power_button(int time_ms) gpio_init_out_ex(&gpio, MDMPWRON, 1); gpio_write(&gpio, 0); - ThisThread::sleep_for(time_ms); + rtos::ThisThread::sleep_for(time_ms); gpio_write(&gpio, 1); }