mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-09-29 02:57:33 +00:00
Merge pull request 'Weak definition of UARThandle getter' (#20) from uart-init into main
Reviewed-on: https://git.intern.spaceteamaachen.de/ALPAKA/TACOS/pulls/20 Reviewed-by: dario <dario@noreply.git.intern.spaceteamaachen.de>
This commit is contained in:
@@ -48,6 +48,21 @@ namespace sta
|
|||||||
|
|
||||||
namespace tacos
|
namespace tacos
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @brief Function that returns the UART handle used for debugging. Override it in userspace to adjust.
|
||||||
|
*
|
||||||
|
* @ingroup tacos_startup
|
||||||
|
*/
|
||||||
|
STA_WEAK
|
||||||
|
UART_HandleTypeDef * getUARThandle(){
|
||||||
|
return &STA_STM32_USART_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Function that initializes the printable object given by getUARThandle().
|
||||||
|
*
|
||||||
|
* @ingroup tacos_startup
|
||||||
|
*/
|
||||||
void initPrintable()
|
void initPrintable()
|
||||||
{
|
{
|
||||||
// Initialize the mutex for UART communication.
|
// Initialize the mutex for UART communication.
|
||||||
@@ -55,7 +70,7 @@ namespace sta
|
|||||||
|
|
||||||
// Initialize the UART interface and printable object.
|
// Initialize the UART interface and printable object.
|
||||||
UARTSettings settings = { .mode = UARTMode::RX_TX };
|
UARTSettings settings = { .mode = UARTMode::RX_TX };
|
||||||
STM32UART * intf_ptr = new STM32UART(&huart2, settings, mutex);
|
STM32UART * intf_ptr = new STM32UART(getUARThandle(), settings, mutex);
|
||||||
Debug = new PrintableUART(intf_ptr);
|
Debug = new PrintableUART(intf_ptr);
|
||||||
|
|
||||||
STA_DEBUG_PRINTLN("UART SUCCESSFULLY INITIALIZED");
|
STA_DEBUG_PRINTLN("UART SUCCESSFULLY INITIALIZED");
|
||||||
|
Reference in New Issue
Block a user