honor the channel argument
This commit is contained in:
parent
fb43524d34
commit
fe3814f7d1
|
@ -78,6 +78,18 @@ unsigned char gcn64_transaction(unsigned char chn, const unsigned char *tx, int
|
||||||
int count;
|
int count;
|
||||||
unsigned char sreg = SREG;
|
unsigned char sreg = SREG;
|
||||||
|
|
||||||
|
void (*sendBytes)(const unsigned char *data, unsigned char n_bytes);
|
||||||
|
unsigned char (*receiveBytes)(unsigned char *dstbuf, unsigned char max_bytes);
|
||||||
|
|
||||||
|
switch(chn)
|
||||||
|
{
|
||||||
|
case 0: sendBytes = gcn64_sendBytes0; receiveBytes = gcn64_receiveBytes0; break;
|
||||||
|
case 1: sendBytes = gcn64_sendBytes1; receiveBytes = gcn64_receiveBytes1; break;
|
||||||
|
case 2: sendBytes = gcn64_sendBytes2; receiveBytes = gcn64_receiveBytes2; break;
|
||||||
|
case 3: sendBytes = gcn64_sendBytes3; receiveBytes = gcn64_receiveBytes3; break;
|
||||||
|
default: return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef TRACE_GCN64
|
#ifdef TRACE_GCN64
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -91,8 +103,8 @@ unsigned char gcn64_transaction(unsigned char chn, const unsigned char *tx, int
|
||||||
#ifdef DISABLE_INTS_DURING_COMM
|
#ifdef DISABLE_INTS_DURING_COMM
|
||||||
cli();
|
cli();
|
||||||
#endif
|
#endif
|
||||||
gcn64_sendBytes0(tx, tx_len);
|
sendBytes(tx, tx_len);
|
||||||
count = gcn64_receiveBytes0(rx, rx_max);
|
count = receiveBytes(rx, rx_max);
|
||||||
SREG = sreg;
|
SREG = sreg;
|
||||||
|
|
||||||
if (count == 0xff) {
|
if (count == 0xff) {
|
||||||
|
|
Loading…
Reference in New Issue