[X9D] UART driver renamed, work on debug output
This commit is contained in:
@@ -103,6 +103,13 @@ void configure_pins( uint32_t pins, uint16_t config )
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG)
|
||||
void debugPutc(const char c)
|
||||
{
|
||||
uartPutc(c);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t getTemperature()
|
||||
{
|
||||
return temperature + g_eeGeneral.temperatureCalib;
|
||||
@@ -181,7 +188,7 @@ void boardInit()
|
||||
delaysInit();
|
||||
audioInit();
|
||||
#if defined(DEBUG)
|
||||
debugInit();
|
||||
uartInit(DEBUG_UART_BAUDRATE);
|
||||
#endif
|
||||
|
||||
// TODO init_ppm() ;
|
||||
|
||||
+2
-3
@@ -79,12 +79,11 @@ extern uint16_t sessionTimer;
|
||||
#define SLAVE_MODE() (0/*pwrCheck() == e_power_trainer*/)
|
||||
|
||||
void delaysInit();
|
||||
void debugInit();
|
||||
|
||||
#define DEBUG_UART_BAUDRATE 115200
|
||||
|
||||
void uartInit(void);
|
||||
void uartSendChar(uint8_t c);
|
||||
void uartInit(uint32_t baudrate);
|
||||
void uartPutc(const char c);
|
||||
|
||||
void delaysInit(void);
|
||||
void delay_01us(uint16_t nb);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#include "../open9x.h"
|
||||
|
||||
void debugInit(void)
|
||||
void uartInit(uint32_t baudrate)
|
||||
{
|
||||
USART_InitTypeDef USART_InitStructure;
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
@@ -54,7 +54,7 @@ void debugInit(void)
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_Init(GPIO_UART, &GPIO_InitStructure);
|
||||
|
||||
USART_InitStructure.USART_BaudRate = DEBUG_UART_BAUDRATE;
|
||||
USART_InitStructure.USART_BaudRate = baudrate;
|
||||
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
|
||||
USART_InitStructure.USART_StopBits = USART_StopBits_1;
|
||||
USART_InitStructure.USART_Parity = USART_Parity_No;
|
||||
@@ -65,7 +65,7 @@ void debugInit(void)
|
||||
USART_Cmd(UART_DEBUG, ENABLE);
|
||||
}
|
||||
|
||||
void debugPutc(const char c)
|
||||
void uartPutc(const char c)
|
||||
{
|
||||
USART_SendData(UART_DEBUG, c);
|
||||
|
||||
Reference in New Issue
Block a user