28 #include "rtos/Queue.h" 29 #include "rtos/MemoryPool.h" 30 #include "rtos/mbed_rtos_types.h" 31 #include "rtos/mbed_rtos_storage.h" 32 #include "rtos/mbed_rtos1_types.h" 34 #include "platform/mbed_toolchain.h" 35 #include "platform/NonCopyable.h" 37 #ifndef MBED_NO_GLOBAL_USING_DIRECTIVE 41 #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) 62 template<
typename T, u
int32_t queue_sz>
81 return _queue.empty();
108 return _pool.
alloc();
195 return _queue.put(mptr);
210 osEvent get(uint32_t millisec = osWaitForever)
212 osEvent evt = _queue.get(millisec);
213 if (evt.
status == osEventMessage) {
229 return _pool.
free(mptr);
osStatus put(T *mptr)
Put a mail in the queue.
T * calloc_until(uint64_t millisec)
Allocate a memory block from a memory pool, blocking, and set memory block to zero.
bool empty() const
Check if the mail queue is empty.
The Queue class represents a collection of objects that are stored first by order of priority...
T * alloc_until(uint64_t millisec)
Allocate a memory block from a memory pool, blocking.
T * calloc_for(uint32_t millisec)
Allocate a memory block of type T, optionally blocking, and set memory block to zero.
T * alloc_for(uint32_t millisec)
Allocate a memory block from a memory pool, optionally blocking.
T * calloc_until(uint64_t millisec)
Allocate a memory block of type T, blocking, and set memory block to zero.
T * alloc(MBED_UNUSED uint32_t millisec=0)
Allocate a memory block of type T, without blocking.
Prevents generation of copy constructor and copy assignment operator in derived classes.
Mail()
Create and initialize Mail queue.
T * alloc_until(uint64_t millisec)
Allocate a memory block of type T, blocking.
osStatus status
status code: event or error information
Event structure contains detailed information about an event.
The Mail class allows you to control, send, receive or wait for mail.
osStatus free(T *block)
Free a memory block.
T * calloc(void)
Allocate a memory block from a memory pool, without blocking, and set memory block to zero...
osStatus free(T *mptr)
Free a memory block from a mail.
T * calloc(MBED_UNUSED uint32_t millisec=0)
Allocate a memory block of type T, and set memory block to zero.
T * alloc_for(uint32_t millisec)
Allocate a memory block of type T, optionally blocking.
bool full() const
Check if the mail queue is full.
T * calloc_for(uint32_t millisec)
Allocate a memory block from a memory pool, optionally blocking, and set memory block to zero...
T * alloc(void)
Allocate a memory block from a memory pool, without blocking.