2 \author Travis Goodspeed
3 \brief Local debug monitor.
10 //! Handles a monitor command.
11 void monitorhandle(unsigned char app,
16 cmddata[0]=memorybyte[cmddataword[0]];
20 //Todo, make word or byte.
21 memorybyte[cmddataword[0]]=cmddata[2];
22 cmddata[0]=memorybyte[cmddataword[0]];
26 //TODO make the data length target-specific, varying by ram.
30 case MONITOR_CHANGE_BAUD:
31 //This command, and ONLY this command, does not reply.
35 case MONITOR_RAM_PATTERN:
36 monitor_ram_pattern();//reboots, will never return
38 case MONITOR_RAM_DEPTH:
39 cmddataword[0]=monitor_ram_depth();
61 //! Overwrite all of RAM with 0xBEEF, then reboot.
62 void monitor_ram_pattern(){
66 for(a=(int*)0x1100;a<(int*)0x2500;a++){//TODO get these from the linker.
75 //! Return the number of contiguous bytes 0xBEEF, to measure RAM usage.
76 unsigned int monitor_ram_depth(){
79 for(a=0x1100;a<0x2500;a+=2)
80 if(*((int*)a)==0xBEEF) count+=2;