[Taranis] DEBUG Tx now in its interrupt at 115200bauds
This commit is contained in:
@@ -109,13 +109,6 @@ uint8_t usbPlugged(void)
|
||||
return usbState == USB_CONNECTED;
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
void debugPutc(const char c)
|
||||
{
|
||||
uartPutc(c);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" {
|
||||
USB_OTG_CORE_HANDLE USB_OTG_dev;
|
||||
@@ -175,10 +168,6 @@ void interrupt5ms()
|
||||
pre_scale = 0 ;
|
||||
per10ms();
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
debugTx();
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" void TIM8_TRG_COM_TIM14_IRQHandler()
|
||||
|
||||
@@ -84,7 +84,7 @@ uint8_t usbPlugged(void);
|
||||
|
||||
void delaysInit();
|
||||
|
||||
#define DEBUG_UART_BAUDRATE 9600
|
||||
#define DEBUG_UART_BAUDRATE 115200
|
||||
#define SPORT_BAUDRATE 57600
|
||||
|
||||
void uartInit(uint32_t baudrate);
|
||||
|
||||
@@ -69,7 +69,7 @@ void sportInit(void)
|
||||
USART_InitStructure.USART_StopBits = USART_StopBits_1;
|
||||
USART_InitStructure.USART_Parity = USART_Parity_No;
|
||||
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
|
||||
USART_InitStructure.USART_Mode = USART_Mode_Tx|USART_Mode_Rx;
|
||||
USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
|
||||
|
||||
USART_Init(SPORT, &USART_InitStructure);
|
||||
USART_Cmd(SPORT, ENABLE);
|
||||
|
||||
@@ -64,9 +64,33 @@ void uartInit(uint32_t baudrate)
|
||||
|
||||
USART_Init(UART3, &USART_InitStructure);
|
||||
USART_Cmd(UART3, ENABLE);
|
||||
|
||||
USART_ITConfig(UART3, USART_IT_RXNE, DISABLE);
|
||||
USART_ITConfig(UART3, USART_IT_TXE, DISABLE);
|
||||
|
||||
NVIC_EnableIRQ(USART3_IRQn);
|
||||
}
|
||||
|
||||
void uartPutc(const char c)
|
||||
#if defined(DEBUG)
|
||||
#include "../../fifo.h"
|
||||
Fifo<512> debugTxFifo;
|
||||
void debugPutc(const char c)
|
||||
{
|
||||
USART_SendData(UART3, c);
|
||||
debugTxFifo.push(c);
|
||||
USART_ITConfig(UART3, USART_IT_TXE, ENABLE);
|
||||
}
|
||||
|
||||
extern "C" void USART3_IRQHandler(void)
|
||||
{
|
||||
if (USART_GetITStatus(UART3, USART_IT_TXE) != RESET) {
|
||||
uint8_t txchar;
|
||||
if (debugTxFifo.pop(txchar)) {
|
||||
/* Write one byte to the transmit data register */
|
||||
USART_SendData(UART3, txchar);
|
||||
}
|
||||
else {
|
||||
USART_ITConfig(UART3, USART_IT_TXE, DISABLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user