@@ -469,15 +469,15 @@ void NoteDelayMs(uint32_t ms)
469469 }
470470}
471471
472- #if NOTE_SHOW_MALLOC
472+ #if NOTE_SHOW_MALLOC || !defined( NOTE_LOWMEM )
473473//**************************************************************************/
474474/*!
475- @brief If set for low-memory platforms, show a malloc call.
476- @param len the number of bytes of memory allocated by the last call.
475+ @brief Convert number to a hex string
476+ @param the number
477+ @param the buffer to return it into
477478*/
478479/**************************************************************************/
479- void htoa32 (uint32_t n , char * p );
480- void htoa32 (uint32_t n , char * p )
480+ void n_htoa32 (uint32_t n , char * p )
481481{
482482 int i ;
483483 for (i = 0 ; i < 8 ; i ++ ) {
@@ -491,6 +491,15 @@ void htoa32(uint32_t n, char *p)
491491 }
492492 * p = '\0' ;
493493}
494+ #endif
495+
496+ #if NOTE_SHOW_MALLOC
497+ //**************************************************************************/
498+ /*!
499+ @brief If set for low-memory platforms, show a malloc call.
500+ @param len the number of bytes of memory allocated by the last call.
501+ */
502+ /**************************************************************************/
494503void * malloc_show (size_t len )
495504{
496505 char str [16 ];
@@ -501,7 +510,7 @@ void *malloc_show(size_t len)
501510 if (p == NULL ) {
502511 hookDebugOutput ("FAIL" );
503512 } else {
504- htoa32 ((uint32_t )p , str );
513+ n_htoa32 ((uint32_t )p , str );
505514 hookDebugOutput (str );
506515 }
507516 return p ;
@@ -537,7 +546,7 @@ void NoteFree(void *p)
537546 if (hookFree != NULL ) {
538547#if NOTE_SHOW_MALLOC
539548 char str [16 ];
540- htoa32 ((uint32_t )p , str );
549+ n_htoa32 ((uint32_t )p , str );
541550 hookDebugOutput ("free" );
542551 hookDebugOutput (str );
543552#endif
0 commit comments