Target: Do not compile USART init code for unused USARTS

Signed-off-by: CTXz <ctx.xda@gmail.com>
This commit is contained in:
CTXz
2024-02-22 17:35:22 +01:00
parent 70675d2b21
commit b20b3d599c

View File

@@ -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";