diff --git a/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp b/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp index 95893fc8c0..a9fe49c183 100644 --- a/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp +++ b/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp @@ -186,8 +186,7 @@ nsapi_error_t RTWInterface::scan(WiFiAccessPoint *res, unsigned count) } rtw_free_sema(&scan_sema); return ApNum; - - }else if(count > 0 && res != NULL){ + }else if(count > 0 && res != NULL){ count = count < maxApNum ? count : maxApNum; for(int i = 0; i < count; i++){ memcpy(&res[i], SCANED_AP[i], sizeof(WiFiAccessPoint)); diff --git a/targets/TARGET_Realtek/TARGET_AMEBA/sdk/lib_wlan_mbed.ar b/targets/TARGET_Realtek/TARGET_AMEBA/sdk/lib_wlan_mbed.ar index 3d0c6d8ee5..a58f77aa63 100644 Binary files a/targets/TARGET_Realtek/TARGET_AMEBA/sdk/lib_wlan_mbed.ar and b/targets/TARGET_Realtek/TARGET_AMEBA/sdk/lib_wlan_mbed.ar differ diff --git a/targets/TARGET_Realtek/TARGET_AMEBA/sdk/os/rtx/rtx_service.c b/targets/TARGET_Realtek/TARGET_AMEBA/sdk/os/rtx/rtx_service.c index e23ddab694..dbe0a5b1f5 100644 --- a/targets/TARGET_Realtek/TARGET_AMEBA/sdk/os/rtx/rtx_service.c +++ b/targets/TARGET_Realtek/TARGET_AMEBA/sdk/os/rtx/rtx_service.c @@ -39,14 +39,22 @@ int osdep_print = 0; void save_and_cli() { _func_enter_; +#if defined(__CC_ARM) + rtw_enter_critical(NULL, NULL); +#else __disable_irq(); +#endif _func_exit_; } void restore_flags() { _func_enter_; +#if defined(__CC_ARM) + rtw_exit_critical(NULL, NULL); +#else __enable_irq(); +#endif _func_exit_; } @@ -966,13 +974,15 @@ u32 _rtx_timerStop( _timerHandle xTimer, { _func_enter_; rtx_tmr_t *tmr = (rtx_tmr_t *) xTimer; - osStatus status = osTimerStop(tmr->id); + if(_rtx_timerIsTimerActive(xTimer) == _TRUE){ + osStatus status = osTimerStop(tmr->id); _func_exit_; - if(status == osOK) - return _SUCCESS; - - DBG_ERR("error %d\n", status); - return _FAIL; + if(status != osOK){ + DBG_ERR("error %d\n", status); + return _FAIL; + } + } + return _SUCCESS; } u32 _rtx_timerChangePeriod( _timerHandle xTimer,