5 //! Handles a monitor command.
6 void monitorhandle(unsigned char app,
11 cmddata[0]=memorybyte[cmddataword[0]];
15 //Todo, make word or byte.
16 memorybyte[cmddataword[0]]=cmddata[2];
17 cmddata[0]=memorybyte[cmddataword[0]];
20 case MONITOR_CHANGE_BAUD:
21 //This command, and ONLY this command, does not reply.
25 case MONITOR_RAM_PATTERN:
26 monitor_ram_pattern();//reboots, will never return
28 case MONITOR_RAM_DEPTH:
29 cmddataword[0]=monitor_ram_depth();
35 //! Overwrite all of RAM with 0xBEEF, then reboot.
36 void monitor_ram_pattern(){
40 for(a=(int*)0x1100;a<(int*)0x2500;a++){//TODO get these from the linker.
49 //! Return the number of contiguous bytes 0xBEEF, to measure RAM usage.
50 unsigned int monitor_ram_depth(){
53 for(a=0x1100;a<0x2500;a+=2)
54 if(*((int*)a)==0xBEEF) count+=2;