avr: remove hex encoding for ctrl messages

This commit is contained in:
Bart Van Der Meerssche 2010-12-26 19:31:59 +01:00
parent 6f377bdc53
commit 2e6336b0f8
1 changed files with 11 additions and 12 deletions

View File

@ -94,10 +94,8 @@ ISR(SPI_STC_vect)
} }
else { else {
if (ctrlGetFromTxBuffer(&tx)) { if (ctrlGetFromTxBuffer(&tx)) {
if (tx == SPI_END_OF_MESSAGE) { received_from_spi(tx);
received_from_spi(tx); return;
return;
}
} }
else { else {
received_from_spi(SPI_FORWARD_TO_UART_PORT); received_from_spi(SPI_FORWARD_TO_UART_PORT);
@ -134,16 +132,17 @@ ISR(SPI_STC_vect)
default: default:
if (spi_status & HIGH_HEX) { if (spi_status & HIGH_HEX) {
rx = htob(((uint16_t)high_hex << 8) + spi_rx); rx = htob(((uint16_t)high_hex << 8) + spi_rx);
uartAddToTxBuffer(rx);
if (spi_status & TO_FROM_UART) {
uartAddToTxBuffer(rx);
}
else {
ctrlAddToRxBuffer(rx);
}
} }
else { else {
high_hex = spi_rx; if (spi_status & TO_FROM_UART) {
high_hex = spi_rx;
}
else {
ctrlAddToRxBuffer(spi_rx);
return;
}
} }
// toggle the HEX bit in spi_status // toggle the HEX bit in spi_status
spi_status ^= HIGH_HEX; spi_status ^= HIGH_HEX;