-
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from imi415/linux
POSIX: use libc heap, allow NULL thread_t, UART refactored.
- Loading branch information
Showing
5 changed files
with
118 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,6 @@ | |
|
||
#define LWESP_CFG_SNTP 1 | ||
|
||
#define LWESP_CFG_MEM_CUSTOM 1 | ||
|
||
#endif /* LWESP_HDR_OPTS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* \file lwesp_mem_lwmem.c | ||
* \brief Dynamic memory manager implemented with LwMEM | ||
*/ | ||
|
||
/* | ||
* Copyright (c) 2020 Tilen MAJERLE | ||
* | ||
* Permission is hereby granted, free of charge, to any person | ||
* obtaining a copy of this software and associated documentation | ||
* files (the "Software"), to deal in the Software without restriction, | ||
* including without limitation the rights to use, copy, modify, merge, | ||
* publish, distribute, sublicense, and/or sell copies of the Software, | ||
* and to permit persons to whom the Software is furnished to do so, | ||
* subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE | ||
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
* OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* This file is part of LwESP - Lightweight ESP-AT parser library. | ||
* | ||
* Author: Tilen MAJERLE <tilen@majerle.eu> | ||
* Author: imi415 <imi415.public@gmail.com> | ||
* Version: v1.1.1-dev | ||
*/ | ||
#include "lwesp/lwesp.h" | ||
|
||
/* See lwesp_mem.c file for function documentation on parameters and return values */ | ||
|
||
#if LWESP_CFG_MEM_CUSTOM && !__DOXYGEN__ | ||
|
||
/* | ||
* Before this driver can be used, user must: | ||
* | ||
* - Configure LwMEM for thread-safety mode by enabling operating system features | ||
* - Set memory regions during start of application | ||
*/ | ||
|
||
#include <stdlib.h> | ||
|
||
void* | ||
lwesp_mem_malloc(size_t size) { | ||
return malloc(size); | ||
} | ||
|
||
void* | ||
lwesp_mem_realloc(void* ptr, size_t size) { | ||
return realloc(ptr, size); | ||
} | ||
|
||
void* | ||
lwesp_mem_calloc(size_t num, size_t size) { | ||
return calloc(num, size); | ||
} | ||
|
||
void | ||
lwesp_mem_free(void* ptr) { | ||
free(ptr); | ||
} | ||
|
||
#endif /* LWESP_CFG_MEM_CUSTOM && !__DOXYGEN__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters