Skip to content

Commit 34a83cd

Browse files
khoa-nguyen-18KhiemNguyenT
authored andcommitted
hal: renesas: ra: copy BSP_ASSIGN_EVENT_TO_CURRENT_CORE to bsp_irq.h
CPU1 requires setting the interrupt direction, which should be configured in the Zephyr driver layer. To support this, move BSP_ASSIGN_EVENT_TO_CURRENT_CORE definition from bsp_irq.c to bsp_irq.h. Signed-off-by: Khoa Nguyen <[email protected]>
1 parent f728bb5 commit 34a83cd

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

drivers/ra/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,7 @@ Patch List:
167167
* Modify to use ".noinit" instead of ".ram_noinit" for `BSP_SECTION_NOINIT` and `__NO_INIT`
168168
Impacted files:
169169
drivers/ra/fsp/src/bsp/mcu/all/bsp_compiler_support.h
170+
171+
* Copy `BSP_ASSIGN_EVENT_TO_CURRENT_CORE` from bsp_irq.c to bsp_irq.h to let it can be used in Zephyr driver
172+
Impacted files:
173+
zephyr/ra/portable/bsp_irq.h

zephyr/ra/portable/bsp_irq.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ FSP_HEADER
1717
**********************************************************************************************************************/
1818
#define BSP_ICU_VECTOR_MAX_ENTRIES (BSP_VECTOR_TABLE_MAX_ENTRIES - BSP_CORTEX_VECTOR_TABLE_ENTRIES)
1919

20+
#if (BSP_CFG_CPU_CORE == 1)
21+
#define BSP_EVENT_NUM_TO_INTSELR(x) (x >> 5) // Convert event number to INTSELR register number
22+
#define BSP_EVENT_NUM_TO_INTSELR_MASK(x) (1 << (x % 32)) // Convert event number to INTSELR bit mask
23+
#define BSP_ASSIGN_EVENT_TO_CURRENT_CORE(event) \
24+
{ \
25+
R_ICU->INTSELR[BSP_EVENT_NUM_TO_INTSELR(event)] |= \
26+
BSP_EVENT_NUM_TO_INTSELR_MASK(event); \
27+
}
28+
#else
29+
#define BSP_ASSIGN_EVENT_TO_CURRENT_CORE(event)
30+
#endif /* BSP_CFG_CPU_CORE == 1 */
31+
2032
/***********************************************************************************************************************
2133
* Typedef definitions
2234
**********************************************************************************************************************/

0 commit comments

Comments
 (0)