Skip to content

Commit e77e040

Browse files
committed
fix wifi example fail issue
1 parent 633888d commit e77e040

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

features/FEATURE_LWIP/lwip-interface/lwipopts.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@
8383
#ifdef LWIP_DEBUG
8484
#define TCPIP_THREAD_STACKSIZE 1200*2
8585
#else
86-
#define TCPIP_THREAD_STACKSIZE 1200
86+
#define TCPIP_THREAD_STACKSIZE 1600
8787
#endif
8888

8989
#define TCPIP_THREAD_PRIO (osPriorityNormal)
9090

9191
#ifdef LWIP_DEBUG
92-
#define DEFAULT_THREAD_STACKSIZE 512*2
92+
#define DEFAULT_THREAD_STACKSIZE 1024*2
9393
#else
9494
#define DEFAULT_THREAD_STACKSIZE 512
9595
#endif

targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ nsapi_error_t RTWInterface::scan(WiFiAccessPoint *res, unsigned count)
186186
}
187187
rtw_free_sema(&scan_sema);
188188
return ApNum;
189-
190-
}else if(count > 0 && res != NULL){
189+
}else if(count > 0 && res != NULL){
191190
count = count < maxApNum ? count : maxApNum;
192191
for(int i = 0; i < count; i++){
193192
memcpy(&res[i], SCANED_AP[i], sizeof(WiFiAccessPoint));
Binary file not shown.

targets/TARGET_Realtek/TARGET_AMEBA/sdk/os/rtx/rtx_service.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,22 @@ int osdep_print = 0;
3939
void save_and_cli()
4040
{
4141
_func_enter_;
42+
#if defined(__CC_ARM)
43+
rtw_enter_critical(NULL, NULL);
44+
#else
4245
__disable_irq();
46+
#endif
4347
_func_exit_;
4448
}
4549

4650
void restore_flags()
4751
{
4852
_func_enter_;
53+
#if defined(__CC_ARM)
54+
rtw_exit_critical(NULL, NULL);
55+
#else
4956
__enable_irq();
57+
#endif
5058
_func_exit_;
5159
}
5260

@@ -966,13 +974,15 @@ u32 _rtx_timerStop( _timerHandle xTimer,
966974
{
967975
_func_enter_;
968976
rtx_tmr_t *tmr = (rtx_tmr_t *) xTimer;
969-
osStatus status = osTimerStop(tmr->id);
977+
if(_rtx_timerIsTimerActive(xTimer) == _TRUE){
978+
osStatus status = osTimerStop(tmr->id);
970979
_func_exit_;
971-
if(status == osOK)
972-
return _SUCCESS;
973-
974-
DBG_ERR("error %d\n", status);
975-
return _FAIL;
980+
if(status != osOK){
981+
DBG_ERR("error %d\n", status);
982+
return _FAIL;
983+
}
984+
}
985+
return _SUCCESS;
976986
}
977987

978988
u32 _rtx_timerChangePeriod( _timerHandle xTimer,

0 commit comments

Comments
 (0)