Crossfire telemetry protocol start

This commit is contained in:
Bertrand Songis
2016-03-28 19:07:28 +02:00
parent 5a5f192451
commit a3c175f537
21 changed files with 396 additions and 73 deletions
@@ -18,7 +18,7 @@
* GNU General Public License for more details.
*/
#include "../../opentx.h"
#include "opentx.h"
#if defined(FRSKY)
@@ -33,9 +33,6 @@ void telemetryEnableRx(void)
UCSRB_N(TLM_USART) |= (1 << RXCIE_N(TLM_USART)); // enable Interrupt
}
void processFrskyTelemetryData(uint8_t data);
extern uint8_t frskyRxBufferCount; // TODO not driver, change name
ISR(USART_RX_vect_N(TLM_USART))
{
uint8_t stat;
@@ -79,7 +76,7 @@ ISR(USART_RX_vect_N(TLM_USART))
if (stat & ((1 << FE_N(TLM_USART)) | (1 << DOR_N(TLM_USART)) | (1 << UPE_N(TLM_USART)))) {
// discard buffer and start fresh on any comms error
frskyRxBufferCount = 0;
telemetryRxBufferCount = 0;
}
else {
processFrskyTelemetryData(data);