Skip to content

Commit

Permalink
Remove warnings (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting authored Apr 8, 2023
2 parents d35af3d + f8b96fe commit 4f89972
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions sw/lib/include/neorv32_rte.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ enum NEORV32_RTE_TRAP_enum {
**************************************************************************/
/**@{*/
void neorv32_rte_setup(void);
int neorv32_rte_handler_install(uint8_t id, void (*handler)(void));
int neorv32_rte_handler_uninstall(uint8_t id);
int neorv32_rte_handler_install(int id, void (*handler)(void));
int neorv32_rte_handler_uninstall(int id);

void neorv32_rte_print_hw_config(void);
void neorv32_rte_print_hw_version(void);
Expand Down
8 changes: 4 additions & 4 deletions sw/lib/source/neorv32_rte.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ void neorv32_rte_setup(void) {
* @param[in] handler The actual handler function for the specified trap (function MUST be of type "void function(void);").
* @return 0 if success, 1 if error (invalid id or targeted trap not supported).
**************************************************************************/
int neorv32_rte_handler_install(uint8_t id, void (*handler)(void)) {
int neorv32_rte_handler_install(int id, void (*handler)(void)) {

// id valid?
if ((id >= RTE_TRAP_I_MISALIGNED) && (id <= RTE_TRAP_FIRQ_15)) {
if ((id >= (int)RTE_TRAP_I_MISALIGNED) && (id <= (int)RTE_TRAP_FIRQ_15)) {
__neorv32_rte_vector_lut[id] = (uint32_t)handler; // install handler
return 0;
}
Expand All @@ -109,10 +109,10 @@ int neorv32_rte_handler_install(uint8_t id, void (*handler)(void)) {
* @param[in] id Identifier (type) of the targeted trap. See #NEORV32_RTE_TRAP_enum.
* @return 0 if success, 1 if error (invalid id or targeted trap not supported).
**************************************************************************/
int neorv32_rte_handler_uninstall(uint8_t id) {
int neorv32_rte_handler_uninstall(int id) {

// id valid?
if ((id >= RTE_TRAP_I_MISALIGNED) && (id <= RTE_TRAP_FIRQ_15)) {
if ((id >= (int)RTE_TRAP_I_MISALIGNED) && (id <= (int)RTE_TRAP_FIRQ_15)) {
__neorv32_rte_vector_lut[id] = (uint32_t)(&__neorv32_rte_debug_handler); // use dummy handler in case the trap is accidentally triggered
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions sw/lib/source/neorv32_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ int neorv32_uart_available (neorv32_uart_t *UARTx) {

int available = 0;

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

0 comments on commit 4f89972

Please sign in to comment.