drivers/interrup_controller: stm32: stm32_exti_enable could be void

stm32_exti_enable was returning errors on line > 32 or line pointing
to non implemented line. Both conditions are hard-coded, hence there
is no use to detect them dynamically in the code.
Check them with assert. As a consequence, function could now be void.

Additionally, enable exti irq line only if both checks are passed.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2019-10-09 13:54:29 +02:00 committed by Carles Cufí
commit 78d7b2106a
3 changed files with 11 additions and 19 deletions

View file

@ -31,7 +31,7 @@
*
* @param line EXTI# line
*/
int stm32_exti_enable(int line);
void stm32_exti_enable(int line);
/**
* @brief disable EXTI interrupt for specific line