Prusa MINI Firmware overview
|
◆ sys_mbox_new()
Create a new mbox of specified size
- Parameters
-
mbox | pointer to the mbox to create |
size | (minimum) number of messages in this mbox |
- Returns
- ERR_OK if successful, another err_t otherwise
57 ++lwip_stats.sys.mbox.used;
58 if (lwip_stats.sys.mbox.max < lwip_stats.sys.mbox.used) {
59 lwip_stats.sys.mbox.max = lwip_stats.sys.mbox.used;
◆ sys_mbox_post()
Post a message to an mbox - may not fail -> blocks if full, only used from tasks not from ISR
- Parameters
-
mbox | mbox to posts the message |
msg | message to post (ATTENTION: can be NULL) |
◆ sys_mbox_trypost()
Try to post a message to an mbox - may fail if full or ISR
- Parameters
-
mbox | mbox to posts the message |
msg | message to post (ATTENTION: can be NULL) |
117 lwip_stats.sys.mbox.err++;
◆ sys_arch_mbox_fetch()
Wait for a new message to arrive in the mbox
- Parameters
-
mbox | mbox to get a message from |
msg | pointer where the message is stored |
timeout | maximum time (in milliseconds) to wait for a message (0 = wait forever) |
- Returns
- time (in milliseconds) waited for a message, may be 0 if not waited or SYS_ARCH_TIMEOUT on timeout The returned time has to be accurate to prevent timer jitter!
152 *msg = (
void *)event.
value.
v;
163 *msg = (
void *)event.
value.
v;
◆ sys_arch_mbox_tryfetch()
Wait for a new message to arrive in the mbox
- Parameters
-
mbox | mbox to get a message from |
msg | pointer where the message is stored |
- Returns
- 0 (milliseconds) if a message has been received or SYS_MBOX_EMPTY if the mailbox is empty
181 *msg = (
void *)event.
value.
v;
◆ sys_mbox_free()
Delete an mbox
- Parameters
-
81 lwip_stats.sys.mbox.err++;
90 --lwip_stats.sys.mbox.used;
◆ sys_mbox_valid()
Check if an mbox is valid/allocated: return 1 for valid, 0 for invalid
◆ sys_mbox_set_invalid()
Set an mbox invalid so that sys_mbox_valid returns 0
uint32_t osKernelSysTick(void)
Get the value of the Kernel SysTick timer.
Definition: cmsis_os.c:227
static sys_mbox_t mbox
Definition: tcpip.c:61
uint8_t data[8]
Definition: masstorage.h:49
#define NULL
Definition: usbd_def.h:53
osStatus status
status code: event or error information
Definition: cmsis_os.h:396
osEvent osMessageGet(osMessageQId queue_id, uint32_t millisec)
Get a Message or Wait for a Message from a Queue.
Definition: cmsis_os.c:1145
Definition: cmsis_os.h:395
uint32_t osMessageWaiting(osMessageQId queue_id)
Get the number of messaged stored in a queue.
Definition: cmsis_os.c:1642
#define portNOP()
Definition: portmacro.h:203
function completed; no error or event occurred.
Definition: cmsis_os.h:235
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
Put a Message to a Queue.
Definition: cmsis_os.c:1113
function completed; message event occurred.
Definition: cmsis_os.h:237
#define osWaitForever
wait forever timeout value
Definition: cmsis_os.h:230
osStatus osMessageDelete(osMessageQId queue_id)
Delete a Message Queue.
Definition: cmsis_os.c:1668
s8_t err_t
Definition: err.h:57
#define SYS_MBOX_EMPTY
Definition: sys.h:92
osMessageQId osMessageCreate(const osMessageQDef_t *queue_def, osThreadId thread_id)
Create and Initialize a Message Queue.
Definition: cmsis_os.c:1086
#define osMessageQ(name)
Access a Message Queue Definition.
Definition: cmsis_os.h:829
union osEvent::@54 value
event value
#define SYS_MBOX_NULL
Definition: sys_arch.h:37
uint32_t v
message as 32-bit value
Definition: cmsis_os.h:398
#define SYS_ARCH_TIMEOUT
Definition: sys.h:87
static png_bytep size_t size
Definition: pngwrite.c:2170
#define osMessageQDef(name, queue_sz, type)
Create a Message Queue Definition.
Definition: cmsis_os.h:818