projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Beginning support for the second UART.
[goodfet]
/
firmware
/
apps
/
chipcon
/
chipcon.c
diff --git
a/firmware/apps/chipcon/chipcon.c
b/firmware/apps/chipcon/chipcon.c
index
45a27e7
..
ad701be
100644
(file)
--- a/
firmware/apps/chipcon/chipcon.c
+++ b/
firmware/apps/chipcon/chipcon.c
@@
-1,7
+1,7
@@
//GoodFET ChipCon Debugging Application
//GoodFET ChipCon Debugging Application
-//Handles basic I/O for the Chipcon 8051 debugging protocol.
+//by Travis Goodspeed
+//<travis at radiantmachines.com>
-//Higher level left to client application.
//This is like SPI, except that you read or write, not both.
//This is like SPI, except that you read or write, not both.
@@
-10,8
+10,6
@@
only writes.
*/
only writes.
*/
-//This is REALLY untested.
-
#include "platform.h"
#include "command.h"
#include "chipcon.h"
#include "platform.h"
#include "command.h"
#include "chipcon.h"
@@
-127,7
+125,7
@@
void cchandle(unsigned char app,
unsigned char verb,
unsigned char len){
switch(verb){
unsigned char verb,
unsigned char len){
switch(verb){
- //
PEEK and
POKE will come later.
+ //
CC_PEEK and CC_
POKE will come later.
case READ: //Write a command and return 1-byte reply.
cccmd(len);
ccread(1);
case READ: //Write a command and return 1-byte reply.
cccmd(len);
ccread(1);
@@
-205,15
+203,15
@@
void cchandle(unsigned char app,
//Macro commands
case CC_READ_CODE_MEMORY:
//Macro commands
case CC_READ_CODE_MEMORY:
- cmddata[0]=peekcodebyte(cmddataword[0]);
+ cmddata[0]=
cc_
peekcodebyte(cmddataword[0]);
txdata(app,verb,1);
break;
case CC_READ_XDATA_MEMORY:
txdata(app,verb,1);
break;
case CC_READ_XDATA_MEMORY:
- cmddata[0]=peekdatabyte(cmddataword[0]);
+ cmddata[0]=
cc_
peekdatabyte(cmddataword[0]);
txdata(app,verb,1);
break;
case CC_WRITE_XDATA_MEMORY:
txdata(app,verb,1);
break;
case CC_WRITE_XDATA_MEMORY:
- cmddata[0]=pokedatabyte(cmddataword[0], cmddata[2]);
+ cmddata[0]=
cc_
pokedatabyte(cmddataword[0], cmddata[2]);
txdata(app,verb,1);
break;
case CC_SET_PC:
txdata(app,verb,1);
break;
case CC_SET_PC:
@@
-281,7
+279,6
@@
unsigned short cc_get_pc(){
return cmddataword[0];
}
return cmddataword[0];
}
-
//! Set a hardware breakpoint.
void cc_set_hw_brkpnt(unsigned short adr){
cmddataword[0]=adr;
//! Set a hardware breakpoint.
void cc_set_hw_brkpnt(unsigned short adr){
cmddataword[0]=adr;
@@
-345,7
+342,7
@@
unsigned char cc_debug(unsigned char len,
}
//! Fetch a byte of code memory.
}
//! Fetch a byte of code memory.
-unsigned char peekcodebyte(unsigned long adr){
+unsigned char
cc_
peekcodebyte(unsigned long adr){
/** See page 9 of SWRA124 */
unsigned char bank=adr>>15,
lb=adr&0xFF,
/** See page 9 of SWRA124 */
unsigned char bank=adr>>15,
lb=adr&0xFF,
@@
-362,7
+359,7
@@
unsigned char peekcodebyte(unsigned long adr){
//CLR A
cc_debug(2, 0xE4, 0, 0);
//MOVC A, @A+DPTR;
//CLR A
cc_debug(2, 0xE4, 0, 0);
//MOVC A, @A+DPTR;
- toret=cc_debug(
1
, 0x93, 0, 0);
+ toret=cc_debug(
3
, 0x93, 0, 0);
//INC DPTR
//cc_debug(1, 0xA3, 0, 0);
//INC DPTR
//cc_debug(1, 0xA3, 0, 0);
@@
-371,7
+368,7
@@
unsigned char peekcodebyte(unsigned long adr){
//! Set a byte of data memory.
//! Set a byte of data memory.
-unsigned char pokedatabyte(unsigned int adr,
+unsigned char
cc_
pokedatabyte(unsigned int adr,
unsigned char val){
unsigned char
hb=(adr&0xFF00)>>8,
unsigned char val){
unsigned char
hb=(adr&0xFF00)>>8,
@@
-396,7
+393,7
@@
for (n = 0; n < count; n++) {
}
//! Fetch a byte of data memory.
}
//! Fetch a byte of data memory.
-unsigned char peekdatabyte(unsigned int adr){
+unsigned char
cc_
peekdatabyte(unsigned int adr){
unsigned char
hb=(adr&0xFF00)>>8,
lb=adr&0xFF,
unsigned char
hb=(adr&0xFF00)>>8,
lb=adr&0xFF,