return ERR_MEM;
}
/* locks a mutex */
-void inline sys_mutex_lock(sys_mutex_t *mutex)
+void sys_mutex_lock(sys_mutex_t *mutex)
{
xSemaphoreTake(*mutex,portMAX_DELAY); /* block time changed from 0 to portMAX_DELAY -- it might break timers! - just testing stability */
}
/* unlocks a mutex */
-void inline sys_mutex_unlock(sys_mutex_t *mutex)
+void sys_mutex_unlock(sys_mutex_t *mutex)
{
xSemaphoreGive(*mutex);
}
/* frees memory space formerly taken by mutex */
-void inline sys_mutex_free(sys_mutex_t *mutex)
+void sys_mutex_free(sys_mutex_t *mutex)
{
vSemaphoreDelete(*mutex);
}
return ERR_MEM;
}
/* signals a semaphore */
-void inline sys_sem_signal(sys_sem_t *sem)
+void sys_sem_signal(sys_sem_t *sem)
{
xSemaphoreGive(*sem);
}
return ( (xTaskGetTickCount() - ticksBeforeSemphr) / portTICK_RATE_MS ); /* return time spent waiting for the semaphore - u can use xTaskGetTickCount() */
}
/* deletes a semaphore */
-void inline sys_sem_free(sys_sem_t *sem)
+void sys_sem_free(sys_sem_t *sem)
{
vSemaphoreDelete(*sem);
}
return ERR_OK;
}
/* posts the "msg" to the mailbox, blocks if mbox full */
-void inline sys_mbox_post(sys_mbox_t *mbox, void *msg)
+void sys_mbox_post(sys_mbox_t *mbox, void *msg)
{
while(xQueueSendToBack(*mbox, &msg, portMAX_DELAY) == errQUEUE_FULL);
}
return 0; /* we waited 0ms */
}
/* deletes a mbox */
-void inline sys_mbox_free(sys_mbox_t *mbox)
+void sys_mbox_free(sys_mbox_t *mbox)
{
vQueueDelete(*mbox);
}