Debugging tool for mbed enabled microcontrollers, especially for NUCLEO-F303RE and STM32F042F6P6.
Diff: debug_register.cpp
- Revision:
- 9:59344a584e18
- Parent:
- 6:1ee26b7b9c2f
- Child:
- 11:90164cad21ed
diff -r a5570452154e -r 59344a584e18 debug_register.cpp --- a/debug_register.cpp Thu May 09 20:51:31 2019 +0000 +++ b/debug_register.cpp Thu May 09 21:12:57 2019 +0000 @@ -91,6 +91,7 @@ address = modify_value(address, 46); pc.printf("\e[12;0H\r\e[K\e[32;40m use l or j to yyyyyyyx\e[97;40m"); pc.printf("\e[6;96H"); + reg = *((volatile unsigned int *)address); reg = modify_value(reg, 96); *((volatile unsigned int *)address) = reg; continue; @@ -150,15 +151,19 @@ int horizontal_min = horizontal; char sign; - +ONCE_AGAIN: + pc.printf("\e[6;%dH", horizontal); for (int i = 0; i < 8; i++){ if ((tmp >> (28 - 4*i)) > 9){ val_str[i] = ((tmp >> (28 - 4*i)) + 87); }else{ val_str[i] = ((tmp >> (28 - 4*i)) + 48); } + pc.putc(val_str[i]); tmp -= ((tmp >> (28 - 4*i)) << (28 - 4*i)) ; } + pc.printf("\e[6;%dH", horizontal); + @@ -189,6 +194,10 @@ horizontal++; } continue; + }else if(sign == 27){ + horizontal = horizontal_min; + tmp = value; + goto ONCE_AGAIN; } } return value;