Prusa MINI Firmware overview
Collaboration diagram for Misc:

Functions

void sys_msleep (u32_t ms)
 
sys_thread_t sys_thread_new (const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio)
 

Detailed Description

Function Documentation

◆ sys_msleep()

void sys_msleep ( u32_t  ms)

Sleep for specified number of ms

Sleep for some ms. Timeouts are NOT processed while sleeping.

Parameters
msnumber of milliseconds to sleep
94 {
95  if (ms > 0) {
96  sys_sem_t delaysem;
97  err_t err = sys_sem_new(&delaysem, 0);
98  if (err == ERR_OK) {
99  sys_arch_sem_wait(&delaysem, ms);
100  sys_sem_free(&delaysem);
101  }
102  }
103 }
Here is the call graph for this function:

◆ sys_thread_new()

sys_thread_t sys_thread_new ( const char *  name,
lwip_thread_fn  thread,
void arg,
int  stacksize,
int  prio 
)

The only thread function: Creates a new thread ATTENTION: although this function returns a value, it MUST NOT FAIL (ports have to assert this!)

Parameters
namehuman-readable name for the thread (used for debugging purposes)
threadthread-function
argparameter passed to 'thread'
stacksizestack size in bytes for the new thread (may be ignored by ports)
priopriority of the new thread (may be ignored by ports)
377 {
378  const osThreadDef_t os_thread_def = { (char *)name, (os_pthread)thread, (osPriority)prio, 0, stacksize};
379  return osThreadCreate(&os_thread_def, arg);
380 }
Here is the call graph for this function:
Here is the caller graph for this function:
sys_arch_sem_wait
u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout)
Definition: sys_arch.c:251
sys_sem_t
osSemaphoreId sys_sem_t
Definition: sys_arch.h:41
os_thread_def
Definition: cmsis_os.h:325
sys_sem_new
err_t sys_sem_new(sys_sem_t *sem, u8_t count)
Definition: sys_arch.c:206
ERR_OK
Definition: err.h:63
os_pthread
void(* os_pthread)(void const *argument)
Definition: cmsis_os.h:273
err_t
s8_t err_t
Definition: err.h:57
osPriority
osPriority
Definition: cmsis_os.h:217
osThreadCreate
osThreadId osThreadCreate(const osThreadDef_t *thread_def, void *argument)
Create a thread and add it to Active Threads and set it to state READY.
Definition: cmsis_os.c:245
sys_sem_free
void sys_sem_free(sys_sem_t *sem)
Definition: sys_arch.c:282