mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-17 19:30:36 +00:00
FreeRTOS: arch_ -> os_
This commit is contained in:
1 parent
87a0aa057d
commit
3f1ae66a3d
28 files changed
+122
-235
No files matched your search
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(MG_ENABLE_FREERTOS) && MG_ENABLE_FREERTOS
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <task.h>
|
||||
|
||||
#define MG_ENABLE_CUSTOM_CALLOC 1
|
||||
|
||||
static inline void mg_free(void *ptr) {
|
||||
vPortFree(ptr);
|
||||
}
|
||||
|
||||
// Re-route calloc/free to FreeRTOS functions, don't use stdlib
|
||||
static inline void *mg_calloc(size_t cnt, size_t size) {
|
||||
void *p = pvPortMalloc(cnt * size);
|
||||
if (p != NULL) memset(p, 0, size * cnt);
|
||||
return p;
|
||||
}
|
||||
|
||||
#endif // MG_ENABLE_FREERTOS
|
||||
Reference in new issue
Block a user