Skip to content

Commit

Permalink
use uart API in place of instance calls
Browse files Browse the repository at this point in the history
  • Loading branch information
renesas-adam-benson committed Feb 6, 2024
1 parent 79b71e2 commit 2153584
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
20 changes: 5 additions & 15 deletions src/ewf_interface_ra_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,8 @@ ewf_result ewf_interface_ra_uart_hardware_start(ewf_interface* interface_ptr)
g_interface_ptr = interface_ptr;

/* Initialize UART channel */
#if (BSP_FEATURE_SCI_VERSION == 2U)
status = R_SCI_B_UART_Open (&g_uart0_ctrl, &g_uart0_cfg);
#else
status = R_SCI_UART_Open (&g_uart0_ctrl, &g_uart0_cfg);
#endif
status = g_uart0.p_api->open(g_uart0.p_ctrl, g_uart0.p_cfg);

if (FSP_SUCCESS != status)
return EWF_RESULT_INTERFACE_INITIALIZATION_FAILED;

Expand All @@ -98,11 +95,7 @@ ewf_result ewf_interface_ra_uart_hardware_stop(ewf_interface* interface_ptr)
#endif

/* Close module */
#if (BSP_FEATURE_SCI_VERSION == 2U)
R_SCI_B_UART_Close (&g_uart0_ctrl);
#else
R_SCI_UART_Close (&g_uart0_ctrl);
#endif
g_uart0.p_api->close(g_uart0.p_ctrl);

return EWF_RESULT_OK;
}
Expand All @@ -122,11 +115,8 @@ ewf_result ewf_interface_ra_uart_hardware_send(ewf_interface* interface_ptr, con
g_uart_event = 0;

/* Writing to terminal */
#if (BSP_FEATURE_SCI_VERSION == 2U)
err = R_SCI_B_UART_Write (&g_uart0_ctrl, (uint8_t *) buffer, length);
#else
err = R_SCI_UART_Write (&g_uart0_ctrl, (uint8_t *) buffer, length);
#endif
g_uart0.p_api->write(g_uart0.p_ctrl, (uint8_t *) buffer, length);

if (FSP_SUCCESS != err)
{
return EWF_RESULT_ADAPTER_TRANSMIT_FAILED;
Expand Down
6 changes: 0 additions & 6 deletions src/ewf_interface_ra_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@

#include "ewf_interface.h"

#if (BSP_FEATURE_SCI_VERSION == 2U)
#include "r_sci_b_uart.h"
#else
#include "r_sci_uart.h"
#endif

#include "r_uart_api.h"
#include "hal_data.h"

Expand Down

0 comments on commit 2153584

Please sign in to comment.