Skip to content

Commit

Permalink
Added hal_led_on/hal_led_off API's enabled with ENABLE_LED for test…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
dgarske authored and danielinux committed Jul 25, 2024
1 parent 6078d58 commit 53530c4
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions hal/renesas-rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,33 @@ static void hal_panic(void)
;
}

#ifdef ENABLE_LED
void hal_led_on(void)
{
#if defined(TARGET_rx65n)
/* RX65N RSK+ LED0 P73 */
PORT_PDR(7) |= (1 << 3); /* output */
PORT_PODR(7) &= ~(1 << 3); /* low */
#elif defined(TARGET_rx72n)
/* RX72N Envision USR LED P40 */
PORT_PDR(4) |= (1 << 0); /* output */
PORT_PODR(4) &= ~(1 << 0); /* low */
#endif
}
void hal_led_off(void)
{
#ifdef TARGET_rx65n
/* RX65N RSK+ LED0 P73 */
PORT_PDR(7) |= (1 << 3); /* output */
PORT_PODR(7) |= (1 << 3); /* high */
#else
/* RX72N Envision USR LED P40 */
PORT_PDR(4) |= (1 << 0); /* output */
PORT_PODR(4) |= (1 << 0); /* high */
#endif
}
#endif

void hal_delay_us(uint32_t us)
{
uint32_t delay;
Expand Down Expand Up @@ -352,6 +379,10 @@ void hal_init(void)

hal_clk_init();

#ifdef ENABLE_LED
hal_led_off();
#endif

#ifdef DEBUG_UART
uart_init();
uart_write("wolfBoot HAL Init\n", 18);
Expand Down

0 comments on commit 53530c4

Please sign in to comment.