From 268d40e686150a71cb6509618437533ebeed97b8 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 31 Aug 2020 23:03:01 +0200 Subject: [PATCH] test hw dbg --- armsrc/appmain.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index ebb58a23f..6955a55d3 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -46,6 +46,8 @@ #include "util.h" #include "ticks.h" #include "commonutil.h" +#include "umm_malloc.h" +#include "umm_malloc_cfg.h" #ifdef WITH_LCD #include "LCD.h" @@ -67,14 +69,24 @@ extern uint32_t _stack_start, _stack_end; struct common_area common_area __attribute__((section(".commonarea"))); static int button_status = BUTTON_NO_CLICK; -static bool allow_send_wtx = false; +static bool allow_send_wtx = false; void send_wtx(uint16_t wtx) { if (allow_send_wtx) { reply_ng(CMD_WTX, PM3_SUCCESS, (uint8_t *)&wtx, sizeof(wtx)); } } + +static void umm_test(void) { + + uint8_t* dest = (uint8_t*)umm_malloc(2000); + umm_free(dest); + dest = (uint8_t*)umm_malloc(12000); + umm_info(dest, false); + umm_free(dest); +} + //----------------------------------------------------------------------------- // Read an ADC channel and block till it completes, then return the result // in ADC units (0 to 1023). Also a routine to sum up a number of samples and @@ -721,8 +733,11 @@ static void PacketReceived(PacketCommandNG *packet) { g_reply_via_usb = false; break; } - // emulator + // device side debug mode case CMD_SET_DBGMODE: { + + umm_test(); + DBGLEVEL = packet->data.asBytes[0]; print_debug_level(); reply_ng(CMD_SET_DBGMODE, PM3_SUCCESS, NULL, 0); @@ -2206,7 +2221,6 @@ void __attribute__((noreturn)) AppMain(void) { // fall under the 2 contigous free blocks availables rdv40_spiffs_check(); #endif - for (;;) { WDT_HIT();