-
Notifications
You must be signed in to change notification settings - Fork 13.3k
available RAM check? #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
you can use extern "C" {
#include "user_interface.h"
}
uint32_t free = system_get_free_heap_size(); |
Perhaps we should add this heap() method to the ESP class. On Sat, Apr 18, 2015 at 9:31 PM, Markus [email protected] wrote:
|
Thanks! Got it to work. Nice to see that we have a lot more mem than with the old Atmega2560... |
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On atmega based boards, we were used to retrieve available memory like this:
uint8_t *heapptr, *stackptr;
unsigned long FreeMem(void)
{
stackptr = (uint8_t *)malloc(4); // use stackptr temporarily
heapptr = stackptr; // save value of heap pointer
free(stackptr); // free up the memory again (sets stackptr to 0)
stackptr = (uint8_t *)(SP); // save value of stack pointer
return (stackptr-heapptr);
}
It does not compile for ESP. Anyone that knows how to do it?
On NodeMCU there is Node.Heap()
The text was updated successfully, but these errors were encountered: