optimize plc motor test and fix the lwip mutex and sem error
This commit is contained in:
@@ -184,7 +184,7 @@ sys_sem_free(sys_sem_t *sem)
|
||||
|
||||
int sys_sem_valid(sys_sem_t *sem)
|
||||
{
|
||||
return (*sem >= SYS_SEM_NULL);
|
||||
return (*sem > SYS_SEM_NULL);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -212,7 +212,7 @@ u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout)
|
||||
|
||||
|
||||
if(KSemaphoreObtain(*sem, wait_time) == EOK)
|
||||
return ((CurrentTicksGain()-start_tick)*MS_PER_SYSTICK_F407);
|
||||
return ((CurrentTicksGain()-start_tick)*MS_PER_SYSTICK);
|
||||
else
|
||||
return SYS_ARCH_TIMEOUT;
|
||||
}
|
||||
@@ -226,7 +226,7 @@ void sys_sem_signal(sys_sem_t *sem)
|
||||
err_t sys_mutex_new(sys_mutex_t *mutex)
|
||||
{
|
||||
*mutex = KMutexCreate();
|
||||
if(*mutex >= 0)
|
||||
if(*mutex > SYS_MRTEX_NULL)
|
||||
return ERR_OK;
|
||||
else
|
||||
{
|
||||
@@ -344,7 +344,7 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *q, void **msg, u32_t timeout)
|
||||
wait_time = timeout;
|
||||
|
||||
if(KMsgQueueRecv(*q, &(*msg), sizeof(void *), wait_time) == EOK)
|
||||
return ((CurrentTicksGain()-start_tick)*MS_PER_SYSTICK_F407);
|
||||
return ((CurrentTicksGain()-start_tick)*MS_PER_SYSTICK);
|
||||
else{
|
||||
*msg = NULL;
|
||||
return SYS_ARCH_TIMEOUT;
|
||||
@@ -446,7 +446,6 @@ void lwip_input_thread(void *param)
|
||||
/* Poll the driver, get any outstanding frames */
|
||||
ethernetif_input(net);
|
||||
sys_check_timeouts(); /* Handle all system timeouts for all core protocols */
|
||||
KPrintf("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
/* USER CODE END 0 */
|
||||
#define SYS_MBOX_NULL -1
|
||||
#define SYS_SEM_NULL 0
|
||||
#define SYS_SEM_NULL -1
|
||||
#define SYS_MRTEX_NULL SYS_SEM_NULL
|
||||
|
||||
typedef int32 sys_sem_t;
|
||||
@@ -71,7 +71,7 @@ typedef int32 sys_mbox_t;
|
||||
typedef int32 sys_thread_t;
|
||||
typedef x_base sys_prot_t;
|
||||
|
||||
#define MS_PER_SYSTICK_F407 (1000 / TICK_PER_SECOND)
|
||||
#define MS_PER_SYSTICK (1000 / TICK_PER_SECOND)
|
||||
|
||||
//debug rtos with IRQ
|
||||
//#define FSL_RTOS_XIUOS
|
||||
|
||||
@@ -1652,7 +1652,6 @@ void shellTask(void *param)
|
||||
shellHandler(shell, data[i]);
|
||||
}
|
||||
}
|
||||
KPrintf("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user