2 \author Travis Goodspeed
4 This is an implementation of the SPI protocol
5 for the GoodFET project.
12 //! Handles a monitor command.
13 void monitorhandle(unsigned char app,
18 cmddata[0]=memorybyte[cmddataword[0]];
22 //Todo, make word or byte.
23 memorybyte[cmddataword[0]]=cmddata[2];
24 cmddata[0]=memorybyte[cmddataword[0]];
27 case MONITOR_CHANGE_BAUD:
28 //This command, and ONLY this command, does not reply.
32 case MONITOR_RAM_PATTERN:
33 monitor_ram_pattern();//reboots, will never return
35 case MONITOR_RAM_DEPTH:
36 cmddataword[0]=monitor_ram_depth();
54 //! Overwrite all of RAM with 0xBEEF, then reboot.
55 void monitor_ram_pattern(){
59 for(a=(int*)0x1100;a<(int*)0x2500;a++){//TODO get these from the linker.
68 //! Return the number of contiguous bytes 0xBEEF, to measure RAM usage.
69 unsigned int monitor_ram_depth(){
72 for(a=0x1100;a<0x2500;a+=2)
73 if(*((int*)a)==0xBEEF) count+=2;