Skip to content

Commit

Permalink
Modified to fit the third prototype board
Browse files Browse the repository at this point in the history
  • Loading branch information
dnet committed Aug 8, 2010
1 parent 5957559 commit 7747457
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions firmware/main.c
Expand Up @@ -60,10 +60,10 @@ uchar usbFunctionRead(uchar *data, uchar len)
}

void procByte(const uchar b) {
PORTC = (PORTC & 0xF0) | (b & 0x03); // ....i0dd
PORTC |= 0x04; // .....1.. TCK
PORTC = (PORTC & 0xC3) | ((b & 0x03) << 4); // ..dd0i..
PORTC |= 0x08; // ....1... TCK
if ((b & 4) == 4) {
readValue = (PINC & 0x08) >> 3;
readValue = (PINC & 0x04) >> 2;
}
}

Expand Down Expand Up @@ -114,8 +114,8 @@ uchar i;
* That's the way we need D+ and D-. Therefore we don't need any
* additional hardware initialization.
*/
DDRC = (DDRC & 0xF0) | 0x07; // ....0111 - TDO-TCK-TDI-TMS
PORTC &= 0xF0; // TCK = TDI = TMS = 0, TDO pullup disabled
DDRC = (DDRC & 0xC3) | 0x38; // ..1110.. - TMS-TDI-TCK-TDO
PORTC &= 0xC3; // TCK = TDI = TMS = 0, TDO pullup disabled
usbInit();
usbDeviceDisconnect(); /* enforce re-enumeration, do this while interrupts are disabled! */
i = 0;
Expand Down
12 changes: 6 additions & 6 deletions ioparport.cpp
Expand Up @@ -82,8 +82,8 @@ bool IOParport::txrx(bool tms, bool tdi)
} else {
buffer[0] = 0;
buffer[1] = 4;
if (tdi) buffer[1] |= 2;
if (tms) buffer[1] |= 1;
if (tdi) buffer[1] |= 1;
if (tms) buffer[1] |= 2;
if((err = usbhidSetReport(dev, buffer, sizeof(buffer))) != 0) { /* add a dummy report ID */
fprintf(stderr, "error writing data: %s\n", usbErrorMessage(err));
error = true;
Expand All @@ -103,13 +103,13 @@ void IOParport::buftx(bool tms, bool tdi, char startval) {
if (TOB & 8) {
TOB <<= 4;
TOB |= startval;
if (tdi) TOB |= 2;
if (tms) TOB |= 1;
if (tdi) TOB |= 1;
if (tms) TOB |= 2;
if (++txonlybufpos == sizeof(txonlybuf)) flushtob();
} else {
TOB = startval | 8;
if (tdi) TOB |= 2;
if (tms) TOB |= 1;
if (tdi) TOB |= 1;
if (tms) TOB |= 2;
}
}

Expand Down

0 comments on commit 7747457

Please sign in to comment.