Target: Do not compile USART init code for unused USARTS
Signed-off-by: CTXz <ctx.xda@gmail.com>
This commit is contained in:
@@ -77,6 +77,8 @@ typedef struct __attribute__((packed))
|
||||
|
||||
volatile USART *usart;
|
||||
|
||||
#if defined(USE_USART1)
|
||||
|
||||
/* Intializes USART1
|
||||
* Returns the USART1 control register */
|
||||
USART *init_usart1()
|
||||
@@ -98,6 +100,8 @@ USART *init_usart1()
|
||||
return USART1;
|
||||
}
|
||||
|
||||
#elif defined(USE_USART2)
|
||||
|
||||
/* Intializes USART2
|
||||
* Returns the USART2 control register */
|
||||
USART *init_usart2()
|
||||
@@ -119,6 +123,8 @@ USART *init_usart2()
|
||||
return USART2;
|
||||
}
|
||||
|
||||
#elif defined(USE_USART3)
|
||||
|
||||
/* Intializes USART3
|
||||
* Returns the USART3 control register */
|
||||
USART *init_usart3()
|
||||
@@ -138,6 +144,8 @@ USART *init_usart3()
|
||||
return USART3;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//// Printing
|
||||
|
||||
const uint8_t txtMap[] = "0123456789ABCDEF";
|
||||
|
||||
Reference in New Issue
Block a user