diff --git a/env/csl/stm32f042/Device/hardwareDescription.h b/env/csl/stm32f042/Device/hardwareDescription.h index 6cc9e6e..644cd38 100644 --- a/env/csl/stm32f042/Device/hardwareDescription.h +++ b/env/csl/stm32f042/Device/hardwareDescription.h @@ -312,7 +312,7 @@ typedef enum { TIM2_CAPTURECOMPARE_3, TIM2_CAPTURECOMAPRE_4, intTypeEND -}intType_t; +}intrType_t; uint32_t intHandlerList[intTypeEND]={ 0,0,0,0,0,0,0,0,0,0}; diff --git a/env/csl/stm32f042/Src/imp_interrupt.c b/env/csl/stm32f042/Src/imp_interrupt.c index 7c1d79c..4a381f2 100644 --- a/env/csl/stm32f042/Src/imp_interrupt.c +++ b/env/csl/stm32f042/Src/imp_interrupt.c @@ -1,10 +1,11 @@ #include "interrupt.h" + static void defaultHandler(){}; // pointers to dedicated interrupt handlers void intInit( - intType_t intType, + intrType_t intType, intHandler_t handler, uint8_t priority) { @@ -25,15 +26,15 @@ void intDissableAll() } void intEnable( - intType_t intType) + intrType_t intType) { NVIC_EnableIRQ(interruptTypeIndexList[intType]); } void intDissable( - intType_t intType) + intrType_t intType) { - + NVIC_DisableIRQ(interruptTypeIndexList[intType]); } // Interrupt service routines diff --git a/env/csl/stm32f042/config.cmake b/env/csl/stm32f042/config.cmake index 39401ce..d9cd195 100644 --- a/env/csl/stm32f042/config.cmake +++ b/env/csl/stm32f042/config.cmake @@ -75,3 +75,4 @@ list(APPEND EXTRA_LIBS sub::max7219) list(APPEND EXTRA_LIBS sub::spi) list(APPEND EXTRA_LIBS sub::i2c) list(APPEND EXTRA_LIBS sub::pin) +list(APPEND EXTRA LIBS sub::interrupt) diff --git a/env/periferals/interrupt.h b/env/periferals/interrupt.h index 38eb1b2..83905e8 100644 --- a/env/periferals/interrupt.h +++ b/env/periferals/interrupt.h @@ -27,7 +27,6 @@ extern "C" { /*! interrupt callback type for the handler */ typedef void (*intHandler_t)(void); -// TODO: showe this into hardware description /** * @brief Initialize Interrupt * @@ -47,7 +46,7 @@ typedef void (*intHandler_t)(void); * @param priority the interrupt priority */ void intInit( - intType_t intType, + intrType_t intType, intHandler_t handler, uint8_t priority); @@ -77,7 +76,7 @@ void intDisableAll(); * @param intType interrupt type */ void intEnable( - intType_t intType); + intrType_t intType); /** @@ -91,7 +90,7 @@ void intEnable( * @param intType interrupt type */ void intDisable( - intType_t intType); + intrType_t intType); #ifdef __cplusplus }