diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2011-10-11 21:56:36 +0200 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2011-10-11 21:56:36 +0200 |
commit | cbc941282074856fc6179761b70a0c9879b0b64d (patch) | |
tree | ed15c6d9e20ceaf1ff01a05aa63054410bb8ed54 /firmware/93c46.c | |
parent | 324c5ba9098c1010d0aa8c1e26b95509878ce9f2 (diff) | |
download | mini-octopus-cbc941282074856fc6179761b70a0c9879b0b64d.tar.gz mini-octopus-cbc941282074856fc6179761b70a0c9879b0b64d.zip |
update firmware to @319
Diffstat (limited to 'firmware/93c46.c')
-rw-r--r-- | firmware/93c46.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/firmware/93c46.c b/firmware/93c46.c index 4af0f45..9ec4e11 100644 --- a/firmware/93c46.c +++ b/firmware/93c46.c @@ -93,10 +93,10 @@ int flash_93c46_init(void) //SETPIN(DIN0) = D4 = low //SETPIN(DIN1) = D4 = low - octopus.ports[19]=PIN_OUT; - octopus.ports[18]=PIN_OUT; - octopus.ports[17]=PIN_OUT; octopus.ports[16]=PIN_IN; + octopus.ports[17]=PIN_OUT; + octopus.ports[18]=PIN_OUT; + octopus.ports[19]=PIN_OUT; return RSP_OK; } @@ -111,9 +111,10 @@ void flash_93c46_deinit_usb(void) int flash_93c46_deinit(void) { - octopus.ports[5]=PIN_OUT; // this is wrong! - octopus.ports[6]=PIN_OUT; // this is wrong! - octopus.ports[7]=PIN_OUT; // this is wrong! + octopus.ports[16]=PIN_NONE; + octopus.ports[17]=PIN_NONE; + octopus.ports[18]=PIN_NONE; + octopus.ports[19]=PIN_NONE; return RSP_OK; } @@ -122,7 +123,8 @@ void flash_93c46_read_usb(unsigned char address, unsigned int length, char * buf { answer[0]=CMD_93C46_READ; answer[1]=(unsigned char)flash_93c46_read(address,length,(char*)&answer[2]); - CommandAnswer(length+2); + answer[2+length] = 0; + CommandAnswer(3+length); } int flash_93c46_read(unsigned char address, unsigned int length, char * buf) @@ -142,7 +144,7 @@ void flash_93c46_write_usb(unsigned char address, unsigned int length, char * bu { answer[0]=CMD_93C46_WRITE; answer[1]=(unsigned char)flash_93c46_write(address,length, buf); - answer[2]=0x00; + answer[2]=0; CommandAnswer(3); } |