Skip to content

Commit

Permalink
[sw] UART: minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting committed Oct 24, 2023
1 parent 3aff4fd commit 721e04c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions sw/lib/source/neorv32_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ static void __neorv32_uart_touppercase(uint32_t len, char *ptr) __attribute__((u
* @param[in,out] Hardware handle to UART register struct, #neorv32_uart_t.
* @return 0 if UART0/1 was not synthesized, 1 if UART0/1 is available.
**************************************************************************/
int neorv32_uart_available (neorv32_uart_t *UARTx) {

int available = 0;
int neorv32_uart_available(neorv32_uart_t *UARTx) {

if ( ((uint32_t)UARTx == NEORV32_UART0_BASE) && (NEORV32_SYSINFO->SOC & (1 << SYSINFO_SOC_IO_UART0)) ) {
available = 1;
return 1;
}
else if ( ((uint32_t)UARTx == NEORV32_UART1_BASE) && (NEORV32_SYSINFO->SOC & (1 << SYSINFO_SOC_IO_UART1)) ) {
return 1;
}
if ( ((uint32_t)UARTx == NEORV32_UART1_BASE) && (NEORV32_SYSINFO->SOC & (1 << SYSINFO_SOC_IO_UART1)) ) {
available = 1;
else {
return 0;
}
return(available);
}


Expand Down Expand Up @@ -307,7 +307,7 @@ void neorv32_uart_puts(neorv32_uart_t *UARTx, const char *s) {


/**********************************************************************//**
* Custom version of 'vprintf'.
* Custom version of 'vprintf' printing to UART.
*
* @note This function is blocking.
*
Expand Down Expand Up @@ -390,7 +390,7 @@ void neorv32_uart_vprintf(neorv32_uart_t *UARTx, const char *format, va_list arg


/**********************************************************************//**
* Custom version of 'printf'.
* Custom version of 'printf' printing to UART.
*
* @note This function is blocking.
*
Expand All @@ -407,7 +407,7 @@ void neorv32_uart_printf(neorv32_uart_t *UARTx, const char *format, ...) {


/**********************************************************************//**
* Simplified custom version of 'scanf'.
* Simplified custom version of 'scanf' reading from UART.
*
* @note This function is blocking.
*
Expand Down

0 comments on commit 721e04c

Please sign in to comment.