avr: remove hex encoding for ctrl messages
This commit is contained in:
parent
6f377bdc53
commit
2e6336b0f8
|
@ -94,11 +94,9 @@ 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);
|
||||||
spi_status |= TO_FROM_UART;
|
spi_status |= TO_FROM_UART;
|
||||||
|
@ -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);
|
||||||
|
|
||||||
if (spi_status & TO_FROM_UART) {
|
|
||||||
uartAddToTxBuffer(rx);
|
uartAddToTxBuffer(rx);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ctrlAddToRxBuffer(rx);
|
if (spi_status & TO_FROM_UART) {
|
||||||
}
|
high_hex = spi_rx;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
high_hex = spi_rx;
|
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;
|
||||||
|
|
Loading…
Reference in New Issue