Skip to content
Commit 7b340d26 authored by Dylan Hung's avatar Dylan Hung Committed by Carles Cufí
Browse files

include: fix the size of IRQn_Type



IRQn_Type is compiled to int8_t if __NVIC_PRIO_BITS is not set.  It
implies the maximum postive value of the peripheral irq is 127.  This
would lead to an irq number turns into a nagtive value if it is greater
than 127.

For example:
The input argument `irq` of arch_irq_enable is 130. But the input
argument of NVIC_EnableIRQ becomes (IRQn_Type)130 = -126 and results
error.

```
void arch_irq_enable(unsigned int irq)
{
	NVIC_EnableIRQ((IRQn_Type)irq);
}
```

By adding a maximum IRQ number, the bit width of IRQn_Type is guaranteed
to cover all IRQ numbers of the system.

Signed-off-by: default avatarDylan Hung <dylan_hung@aspeedtech.com>
parent 0f18c4c4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment