SPORT polling

This commit is contained in:
Pascal Langer
2017-12-01 17:55:24 +01:00
parent dc9b84ea8b
commit 7debad6c67
6 changed files with 265 additions and 23 deletions

View File

@@ -194,6 +194,13 @@ uint8_t pkt[MAX_PKT];//telemetry receiving packets
uint8_t telemetry_link=0;
uint8_t telemetry_counter=0;
uint8_t telemetry_lost;
#ifdef SPORT_POLLING
#define MAX_SPORT_BUFFER 64
uint8_t SportData[MAX_SPORT_BUFFER];
bool ok_to_send = false;
uint8_t sport_idx = 0;
uint8_t sport_index = 0;
#endif
#endif // TELEMETRY
// Callback
@@ -670,7 +677,9 @@ inline void tx_resume()
{
#ifdef TELEMETRY
// Resume telemetry by enabling transmitter interrupt
#ifndef SPORT_POLLING
if(!IS_TX_PAUSE_on)
#endif
{
#ifdef ORANGE_TX
cli() ;
@@ -1195,8 +1204,9 @@ void modules_reset()
USART2_BASE->CR1 |= USART_CR1_PCE_BIT;
}
usart3_begin(100000,SERIAL_8E2);
USART3_BASE->CR1 &= ~ USART_CR1_RE; //disable
#ifndef SPORT_POLLING
USART3_BASE->CR1 &= ~ USART_CR1_RE; //disable
#endif
USART2_BASE->CR1 &= ~ USART_CR1_TE; //disable transmit
#else
//ATMEGA328p