Rename USART4/5 to UART4/5

This commit avoids compilation errors when INVERTER_PIN_USART4/5 is set.
This commit is contained in:
Maxim Strinzha 2017-02-27 17:10:05 +03:00
parent b64832f05b
commit 499e74efa4
7 changed files with 26 additions and 26 deletions

View File

@ -55,12 +55,12 @@ void initInverters(void)
initInverter(IO_TAG(INVERTER_PIN_USART3));
#endif
#ifdef INVERTER_PIN_USART4
initInverter(IO_TAG(INVERTER_PIN_USART4));
#ifdef INVERTER_PIN_UART4
initInverter(IO_TAG(INVERTER_PIN_UART4));
#endif
#ifdef INVERTER_PIN_USART5
initInverter(IO_TAG(INVERTER_PIN_USART5));
#ifdef INVERTER_PIN_UART5
initInverter(IO_TAG(INVERTER_PIN_UART5));
#endif
#ifdef INVERTER_PIN_USART6
@ -91,15 +91,15 @@ void enableInverter(USART_TypeDef *USARTx, bool on)
}
#endif
#ifdef INVERTER_PIN_USART4
if (USARTx == USART4) {
pin = IOGetByTag(IO_TAG(INVERTER_PIN_USART4));
#ifdef INVERTER_PIN_UART4
if (USARTx == UART4) {
pin = IOGetByTag(IO_TAG(INVERTER_PIN_UART4));
}
#endif
#ifdef INVERTER_PIN_USART5
if (USARTx == USART5) {
pin = IOGetByTag(IO_TAG(INVERTER_PIN_USART5));
#ifdef INVERTER_PIN_UART5
if (USARTx == UART5) {
pin = IOGetByTag(IO_TAG(INVERTER_PIN_UART5));
}
#endif

View File

@ -17,7 +17,7 @@
#pragma once
#if defined(INVERTER_PIN_USART1) || defined(INVERTER_PIN_USART2) || defined(INVERTER_PIN_USART3) || defined(INVERTER_PIN_USART4) || defined(INVERTER_PIN_USART5) || defined(INVERTER_PIN_USART6)
#if defined(INVERTER_PIN_USART1) || defined(INVERTER_PIN_USART2) || defined(INVERTER_PIN_USART3) || defined(INVERTER_PIN_UART4) || defined(INVERTER_PIN_UART5) || defined(INVERTER_PIN_USART6)
#define USE_INVERTER
#endif

View File

@ -395,7 +395,7 @@ void USART3_IRQHandler(void)
#endif
#ifdef USE_UART4
// USART4
// UART4
uartPort_t *serialUART4(uint32_t baudRate, portMode_t mode, portOptions_t options)
{
return serialUART(UARTDEV_4, baudRate, mode, options);
@ -409,7 +409,7 @@ void UART4_IRQHandler(void)
#endif
#ifdef USE_UART5
// USART5
// UART5
uartPort_t *serialUART5(uint32_t baudRate, portMode_t mode, portOptions_t options)
{
return serialUART(UARTDEV_5, baudRate, mode, options);

View File

@ -638,16 +638,16 @@ void resetSerialPinConfig(serialPinConfig_t *serialPinConfig)
serialPinConfig->ioTagTx[SERIAL_PORT_IDENTIFIER_TO_RESOURCE_INDEX(SERIAL_PORT_USART3)] = IO_TAG(UART3_TX_PIN);
#endif
break;
case SERIAL_PORT_USART4:
case SERIAL_PORT_UART4:
#ifdef USE_UART4
serialPinConfig->ioTagRx[SERIAL_PORT_IDENTIFIER_TO_RESOURCE_INDEX(SERIAL_PORT_USART4)] = IO_TAG(UART4_RX_PIN);
serialPinConfig->ioTagTx[SERIAL_PORT_IDENTIFIER_TO_RESOURCE_INDEX(SERIAL_PORT_USART4)] = IO_TAG(UART4_TX_PIN);
serialPinConfig->ioTagRx[SERIAL_PORT_IDENTIFIER_TO_RESOURCE_INDEX(SERIAL_PORT_UART4)] = IO_TAG(UART4_RX_PIN);
serialPinConfig->ioTagTx[SERIAL_PORT_IDENTIFIER_TO_RESOURCE_INDEX(SERIAL_PORT_UART4)] = IO_TAG(UART4_TX_PIN);
#endif
break;
case SERIAL_PORT_USART5:
case SERIAL_PORT_UART5:
#ifdef USE_UART5
serialPinConfig->ioTagRx[SERIAL_PORT_IDENTIFIER_TO_RESOURCE_INDEX(SERIAL_PORT_USART5)] = IO_TAG(UART5_RX_PIN);
serialPinConfig->ioTagTx[SERIAL_PORT_IDENTIFIER_TO_RESOURCE_INDEX(SERIAL_PORT_USART5)] = IO_TAG(UART5_TX_PIN);
serialPinConfig->ioTagRx[SERIAL_PORT_IDENTIFIER_TO_RESOURCE_INDEX(SERIAL_PORT_UART5)] = IO_TAG(UART5_RX_PIN);
serialPinConfig->ioTagTx[SERIAL_PORT_IDENTIFIER_TO_RESOURCE_INDEX(SERIAL_PORT_UART5)] = IO_TAG(UART5_TX_PIN);
#endif
break;
case SERIAL_PORT_USART6:

View File

@ -70,10 +70,10 @@ const serialPortIdentifier_e serialPortIdentifiers[SERIAL_PORT_COUNT] = {
SERIAL_PORT_USART3,
#endif
#ifdef USE_UART4
SERIAL_PORT_USART4,
SERIAL_PORT_UART4,
#endif
#ifdef USE_UART5
SERIAL_PORT_USART5,
SERIAL_PORT_UART5,
#endif
#ifdef USE_UART6
SERIAL_PORT_USART6,
@ -355,12 +355,12 @@ serialPort_t *openSerialPort(
break;
#endif
#ifdef USE_UART4
case SERIAL_PORT_USART4:
case SERIAL_PORT_UART4:
serialPort = uartOpen(UART4, rxCallback, baudRate, mode, options);
break;
#endif
#ifdef USE_UART5
case SERIAL_PORT_USART5:
case SERIAL_PORT_UART5:
serialPort = uartOpen(UART5, rxCallback, baudRate, mode, options);
break;
#endif

View File

@ -73,8 +73,8 @@ typedef enum {
SERIAL_PORT_USART1 = 0,
SERIAL_PORT_USART2,
SERIAL_PORT_USART3,
SERIAL_PORT_USART4,
SERIAL_PORT_USART5,
SERIAL_PORT_UART4,
SERIAL_PORT_UART5,
SERIAL_PORT_USART6,
SERIAL_PORT_USART7,
SERIAL_PORT_USART8,

View File

@ -25,7 +25,7 @@
#include "drivers/timer_def.h"
// DSHOT will work for motor 1-8.
// If SDCard or USART4 DMA is used motor 6 will not work.
// If SDCard or UART4 DMA is used motor 6 will not work.
// If the ADC is used motor 7 will not work.
// If UART1 DMA is used motor 8 will not work.