[Taranis] Telemetry serial interrupt fix

[Taranis] CRC check on telemetry data
[all] Mixer bug on recursive channels
This commit is contained in:
bsongis@gmail.com
2013-07-17 12:34:00 +00:00
parent 7db61e7385
commit 19d1238ab6
9 changed files with 101 additions and 50 deletions
-1
View File
@@ -35,7 +35,6 @@
*/
#include "../opentx.h"
#include "../fifo.h"
void btSetBaudrate(uint32_t index)
{
+2 -3
View File
@@ -466,7 +466,7 @@ static void init_pa7_dsm2()
TIM8->CR1 &= ~TIM_CR1_CEN ;
TIM8->ARR = 44000 ; // 22mS
TIM8->CCR2 = 30000 ; // Update time
TIM8->CCR2 = 40000 ; // Update time
TIM8->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
#if defined(REV3)
TIM8->CCER = TIM_CCER_CC1E | TIM_CCER_CC1P ;
@@ -608,8 +608,7 @@ extern "C" void TIM8_UP_TIM13_IRQHandler()
TIM8->SR &= ~TIM_SR_UIF ; // Clear flag
TIM8->ARR = *ppmStreamPtr[EXTERNAL_MODULE]++ ;
if (*ppmStreamPtr[EXTERNAL_MODULE] == 0)
{
if (*ppmStreamPtr[EXTERNAL_MODULE] == 0) {
TIM8->SR &= ~TIM_SR_CC2IF ; // Clear this flag
TIM8->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
}
+18 -7
View File
@@ -36,6 +36,8 @@
#include "../opentx.h"
extern Fifo<512> telemetryFifo;
void sportInit(void)
{
USART_InitTypeDef USART_InitStructure;
@@ -85,16 +87,25 @@ void sportPutc(const char c)
GPIO_ResetBits(GPIO_PIN_SPORT_ON, PIN_SPORT_ON);
}
void processSerialData(uint8_t data);
#if !defined(SIMU)
#define USART_FLAG_ERRORS (USART_FLAG_ORE | USART_FLAG_NE | USART_FLAG_FE | USART_FLAG_PE)
extern "C" void USART2_IRQHandler()
{
uint16_t data;
uint32_t status;
uint8_t data;
if (USART_GetFlagStatus(SPORT, USART_FLAG_RXNE) || USART_GetFlagStatus(SPORT, USART_FLAG_ORE)) {
data = USART_ReceiveData(SPORT);
processSerialData((uint8_t) data);
status = SPORT->SR;
while (status & (USART_FLAG_RXNE | USART_FLAG_ERRORS)) {
data = SPORT->DR;
if (!(status & USART_FLAG_ERRORS))
telemetryFifo.push(data);
status = SPORT->SR;
}
}
}
#endif
-1
View File
@@ -72,7 +72,6 @@ void uartInit(uint32_t baudrate)
}
#if defined(DEBUG)
#include "../../fifo.h"
Fifo<512> debugTxFifo;
void debugPutc(const char c)
{