Skip to content

Commit 7f5e028

Browse files
ghnotgoodxiaoxiang781216
authored andcommitted
kinetis/pinmux: Do not redefine PIN_UART2_RTS
When a developer working on BSP wants UART1 with RTS, the following needs to be added in the BSP's include/board.h file: #define PIN_UART1_RTS PIN_UART1_RTS_1 which says that PIN_UART1_RTS_1 -- the first alternative pin with UART1 RTS function -- should be used for the UART1's RTS. There are no alternative pins for PIN_UART2_RTS, therefore a similar definition is not used for PIN_UART2_RTS. However, that is a complication when we want PIN_UART2_RTS to be defined as GPIO, for example: #define PIN_UART2_RTS (GPIO_OUTPUT | PIN_PORTB | PIN2) In such a case, PIN_UART2_RTS is later redefined to the only alternative function from hardware/kinetis_???pinmux.h file. This patch avoids the redefinition of already defined names. We considered renaming PIN_UART2_RTS to PIN_UART2_RTS_1 in the hardware/kinetis_???pinmux.h file, but that is breaking change. We try to avoid breaking change. Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
1 parent b2349ae commit 7f5e028

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

arch/arm/src/kinetis/hardware/kinetis_k40pinmux.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@
351351

352352
#define PIN_LCD_P40 (PIN_ANALOG | PIN_PORTD | PIN0)
353353
#define PIN_SPI0_PCS0_3 (PIN_ALT2 | PIN_PORTD | PIN0)
354-
#define PIN_UART2_RTS (PIN_ALT3 | PIN_PORTD | PIN0)
354+
#if !defined(PIN_UART2_RTS)
355+
# define PIN_UART2_RTS (PIN_ALT3 | PIN_PORTD | PIN0)
356+
#endif
355357
#define PIN_LCD_P40F (PIN_ALT7 | PIN_PORTD | PIN0)
356358
#define PIN_LCD_P41 (PIN_ANALOG | PIN_PORTD | PIN1)
357359
#define PIN_ADC0_SE5B (PIN_ANALOG | PIN_PORTD | PIN1)

arch/arm/src/kinetis/hardware/kinetis_k60pinmux.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@
346346
#define PIN_FB_TA (PIN_ALT6 | PIN_PORTC | PIN19)
347347

348348
#define PIN_SPI0_PCS0_3 (PIN_ALT2 | PIN_PORTD | PIN0)
349-
#define PIN_UART2_RTS (PIN_ALT3 | PIN_PORTD | PIN0)
349+
#if !defined(PIN_UART2_RTS)
350+
# define PIN_UART2_RTS (PIN_ALT3 | PIN_PORTD | PIN0)
351+
#endif
350352
#define PIN_FTM3_CH0_2 (PIN_ALT4 | PIN_PORTD | PIN0)
351353
#define PIN_FB_ALE (PIN_ALT5 | PIN_PORTD | PIN0)
352354
#define PIN_FB_CS1 (PIN_ALT5 | PIN_PORTD | PIN0)

arch/arm/src/kinetis/hardware/kinetis_k64pinmux.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,9 @@
563563
#define PIN_UART1_TX_2 (PIN_ALT3 | PIN_PORTE | PIN0)
564564

565565
#define PIN_UART2_CTS (PIN_ALT3 | PIN_PORTD | PIN1)
566-
#define PIN_UART2_RTS (PIN_ALT3 | PIN_PORTD | PIN0)
566+
#if !defined(PIN_UART2_RTS)
567+
# define PIN_UART2_RTS (PIN_ALT3 | PIN_PORTD | PIN0)
568+
#endif
567569
#define PIN_UART2_RX (PIN_ALT3 | PIN_PORTD | PIN2)
568570
#define PIN_UART2_TX (PIN_ALT3 | PIN_PORTD | PIN3)
569571

arch/arm/src/kinetis/hardware/kinetis_k66pinmux.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,9 @@
678678
#define PIN_UART1_TX_2 (PIN_ALT3 | PIN_PORTE | PIN0)
679679

680680
#define PIN_UART2_CTS (PIN_ALT3 | PIN_PORTD | PIN1)
681-
#define PIN_UART2_RTS (PIN_ALT3 | PIN_PORTD | PIN0)
681+
#if !defined(PIN_UART2_RTS)
682+
# define PIN_UART2_RTS (PIN_ALT3 | PIN_PORTD | PIN0)
683+
#endif
682684
#define PIN_UART2_RX (PIN_ALT3 | PIN_PORTD | PIN2)
683685
#define PIN_UART2_TX (PIN_ALT3 | PIN_PORTD | PIN3)
684686

0 commit comments

Comments
 (0)