Send H4PE_SYSWARN
event ("Heap,[1|0],N") when H4P's free heap drops below a safe level (determined as a percentage of its starting value).
Where 1=limit exceeded, 0=return below limit and N=current value
It is intended purely for debugging and is not normally required. It could typically be used to light/extinguish a warning LED to show a fault status.
H4P_HeapWarn h4hw(...
This plugin is a "singleton" - there may be only one single instance of it in the app. It may be instantiated as any name the user chooses, prefix all API calls below with than name.
N/A
h4/hwrn/pcent/N
// payload N = some sensible percentage
stop
has no effect
start
has no effect
N/A
// constructor:
// onHeapWarning callback function
// limit = "safe" percentage
H4P_HeapWarn(H4P_FN_VB onHeapWarning,uint32_t _limit=50);
void pcent(uint32_t pc); // Set new "safe" percentage
(c) 2021 Phil Bowles [email protected]