Skip to content

Commit 99d268a

Browse files
duynguyenxaKhiemNguyenT
authored andcommitted
hal: renesas: ra: Disable irq priority configuration
IRQ priority on Zephyr have offset, disable the priority setting for IRQ in FSP HAL layer so that priority setting will not be override when Open() API is called Signed-off-by: Duy Nguyen <[email protected]>
1 parent 0379c60 commit 99d268a

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

drivers/ra/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,7 @@ Patch List:
119119
* Remove include <cmath> in bsp_tfu.h to avoid build error
120120
Impacted files:
121121
zephyr/ra/portable/bsp_tfu.h
122+
123+
* Disable the priority setting for IRQ in FSP HAL layer so that priority setting will not be override when Open() API is called.
124+
Impacted files:
125+
zephyr/ra/portable/bsp_irq.h

zephyr/ra/portable/bsp_irq.h

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,8 @@ __STATIC_INLINE void R_BSP_IrqClearPending (IRQn_Type irq)
119119
**********************************************************************************************************************/
120120
__STATIC_INLINE void R_BSP_IrqCfg (IRQn_Type const irq, uint32_t priority, void * p_context)
121121
{
122-
/* The following statement is used in place of NVIC_SetPriority to avoid including a branch for system exceptions
123-
* every time a priority is configured in the NVIC. */
124-
#if (4U == __CORTEX_M)
125-
NVIC->IPR[((uint32_t) irq)] = (uint8_t) ((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t) UINT8_MAX);
126-
#elif (33 == __CORTEX_M)
127-
NVIC->IPR[((uint32_t) irq)] = (uint8_t) ((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t) UINT8_MAX);
128-
#elif (23 == __CORTEX_M)
129-
NVIC->IPR[_IP_IDX(irq)] = ((uint32_t) (NVIC->IPR[_IP_IDX(irq)] & ~((uint32_t) UINT8_MAX << _BIT_SHIFT(irq))) |
130-
(((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t) UINT8_MAX) << _BIT_SHIFT(irq)));
131-
#else
132-
NVIC_SetPriority(irq, priority);
133-
#endif
134-
122+
/* Zephyr interrupt priority will have offset, remove priority config in FSP to prevent override seting on Zephyr */
123+
FSP_PARAMETER_NOT_USED(priority);
135124
/* Store the context. The context is recovered in the ISR. */
136125
R_FSP_IsrContextSet(irq, p_context);
137126
}

0 commit comments

Comments
 (0)