work on interrupt setup. Trying to recreateinterrupt blinki according to the exmles

interrupts
polymurph 3 years ago
parent 323ee541ad
commit 856f0278ea

@ -49,47 +49,47 @@ void TIM2_IRQHandler()
(intHandler_t)(intHandlerList[TIM2_UPDATE])(); (intHandler_t)(intHandlerList[TIM2_UPDATE])();
} }
if(TIM->SR & TIM_SR_CC1IF) { if(TIM2->SR & TIM_SR_CC1IF) {
TIM2-> SR &= ~TIM_SR_CC12IF; TIM2-> SR &= ~TIM_SR_CC12IF;
} }
if(TIM->SR & TIM_SR_CC12IF) { if(TIM2->SR & TIM_SR_CC12IF) {
TIM2-> SR &= ~TIM_SR_CC12IF; TIM2-> SR &= ~TIM_SR_CC12IF;
} }
if(TIM->SR & TIM_SR_CC3IF) { if(TIM2->SR & TIM_SR_CC3IF) {
TIM2-> SR &= ~TIM_SR_CC3IF; TIM2-> SR &= ~TIM_SR_CC3IF;
} }
if(TIM->SR & TIM_SR_CC4IF) { if(TIM2->SR & TIM_SR_CC4IF) {
TIM2-> SR &= ~TIM_SR_CC4IF; TIM2-> SR &= ~TIM_SR_CC4IF;
} }
if(TIM->SR & TIM_SR_TIF) { if(TIM2->SR & TIM_SR_TIF) {
TIM2-> SR &= ~TIM_SR_TIF; TIM2-> SR &= ~TIM_SR_TIF;
} }
if(TIM->SR & TIM_SR_CC1OF) { if(TIM2->SR & TIM_SR_CC1OF) {
TIM2-> SR &= ~TIM_SR_CC1OF; TIM2-> SR &= ~TIM_SR_CC1OF;
} }
if(TIM->SR & TIM_SR_CC2OF) { if(TIM2->SR & TIM_SR_CC2OF) {
TIM2-> SR &= ~TIM_SR_CC2OF; TIM2-> SR &= ~TIM_SR_CC2OF;
} }
if(TIM->SR & TIM_SR_CC3OF) { if(TIM2->SR & TIM_SR_CC3OF) {
TIM2-> SR &= ~TIM_SR_CC3OF; TIM2-> SR &= ~TIM_SR_CC3OF;
} }
if(TIM->SR & TIM_SR_CC4OF) { if(TIM2->SR & TIM_SR_CC4OF) {
TIM2-> SR &= ~TIM_SR_CC4OF; TIM2-> SR &= ~TIM_SR_CC4OF;
} }

@ -41,5 +41,12 @@ target_compile_definitions(TIMER PRIVATE ${C_DEFS})
target_include_directories(TIMER PUBLIC ${PERIFERALS_DIR} ${CSL_INCLUDES}) target_include_directories(TIMER PUBLIC ${PERIFERALS_DIR} ${CSL_INCLUDES})
add_library(sub::timer ALIAS TIMER) add_library(sub::timer ALIAS TIMER)
add_library(INTERRUPT ${CSL_SOURCES}/imp_interrupt.c)
target_compile_options(INTERRUPT PRIVATE ${C_FLAGS})
target_compile_definitions(INTERRUPT PRIVATE ${C_DEFS})
target_include_directories(INTERRUPT PUBLIC ${PERIFERALS_DIR} ${CSL_INCLUDES})
add_library(sub::interrupt ALIAS INTERRUPT)

@ -47,7 +47,7 @@ typedef void (*intHandler_t)(void);
* @param priority the interrupt priority * @param priority the interrupt priority
*/ */
void intInit( void intInit(
intType_t intType intType_t intType,
intHandler_t handler, intHandler_t handler,
uint8_t priority); uint8_t priority);

@ -3,6 +3,8 @@
#include "deviceSetup.h" #include "deviceSetup.h"
#include "usart.h" #include "usart.h"
#include "ascii.h" #include "ascii.h"
#include "interrupt.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {

Loading…
Cancel
Save