Defined new todos, and re-aranged timer2 Interrupt

master
kerem yollu 2 years ago
parent e6b8b1184d
commit 406bb83fca

@ -14,8 +14,9 @@ set(EXECUTABLE ${PROJECT_NAME})
set(CMAKE_VERBOSE_MAKEFILE OFF) # Should CMake print everythign ? set(CMAKE_VERBOSE_MAKEFILE OFF) # Should CMake print everythign ?
set(OUTPUT_DOXYGEN TRUE) # Should CMake generate Doxygen output ? set(OUTPUT_DOXYGEN FALSE) # Should CMake generate Doxygen output ?
set(DOXYGEN_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/env/doc) set(DOXYGEN_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/env/doc)
# TODO: discuss on where doxygen should place the output # TODO: discuss on where doxygen should place the output
# -> in env/doc # -> in env/doc
# -> in ked_build outside of the ked environment (prefered, as it includes also the users # -> in ked_build outside of the ked environment (prefered, as it includes also the users

@ -1,5 +1,17 @@
# KED: Wellcome to Kerem and Edwin's Develeppoment platform. # KED: Wellcome to Kerem and Edwin's Develeppoment platform.
# Workflow
##TODO: (In Chronological Form)
+ Implementing interrupt
+ Timer Together
+ GPIO Together/Alone
+ SPI Edwin
+ I2C Kerem
+ PWM Inlcuding Interrupts (Edwin &| Kerem)
+ Test KED with Reflow Oven
+ DMA
## Introduction: ## Introduction:
### Why ? ### Why ?
This project is made to enable high portability between different Plaftorms an MCU's awailable on the market. This project is made to enable high portability between different Plaftorms an MCU's awailable on the market.

@ -38,70 +38,3 @@ void intDissable(
NVIC_DisableIRQ(interruptTypeIndexList[intType]); NVIC_DisableIRQ(interruptTypeIndexList[intType]);
} }
// Interrupt service routines
void TIM2_IRQHandler()
{
if(TIM2->SR & TIM_SR_UIF) {
// clear flag
TIM2-> SR &= ~TIM_SR_UIF;
//TODO: call handler here
((intHandler_t)(intHandlerList[TIM2_UPDATE]))();
}
if(TIM2->SR & TIM_SR_CC1IF) {
TIM2-> SR &= ~TIM_SR_CC1IF;
((intHandler_t)(intHandlerList[TIM2_COUNTERCOMPARE_1]))();
}
if(TIM2->SR & TIM_SR_CC2IF) {
TIM2-> SR &= ~TIM_SR_CC2IF;
((intHandler_t)(intHandlerList[TIM2_COUNTERCOMPARE_2]))();
}
if(TIM2->SR & TIM_SR_CC3IF) {
TIM2-> SR &= ~TIM_SR_CC3IF;
((intHandler_t)(intHandlerList[TIM2_COUNTERCOMPARE_3]))();
}
if(TIM2->SR & TIM_SR_CC4IF) {
TIM2-> SR &= ~TIM_SR_CC4IF;
((intHandler_t)(intHandlerList[TIM2_COUNTERCOMPARE_4]))();
}
if(TIM2->SR & TIM_SR_TIF) {
TIM2-> SR &= ~TIM_SR_TIF;
((intHandler_t)(intHandlerList[TIM2_TRIGGER]))();
}
if(TIM2->SR & TIM_SR_CC1OF) {
TIM2-> SR &= ~TIM_SR_CC1OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMPARE_1]))();
}
if(TIM2->SR & TIM_SR_CC2OF) {
TIM2-> SR &= ~TIM_SR_CC2OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMPARE_2]))();
}
if(TIM2->SR & TIM_SR_CC3OF) {
TIM2-> SR &= ~TIM_SR_CC3OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMPARE_3]))();
}
if(TIM2->SR & TIM_SR_CC4OF) {
TIM2-> SR &= ~TIM_SR_CC4OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMAPRE_4]))();
}
}

@ -1,5 +1,5 @@
#include "timer.h" #include "timer.h"
#include "interrupt.h"
#define BASE ((TIM_TypeDef *)timerBase_Addr_List[timer]) #define BASE ((TIM_TypeDef *)timerBase_Addr_List[timer])
@ -248,3 +248,68 @@ void timerThrowError(timerError_t error)
while(1); while(1);
} }
// Interrupt service routines
void TIM2_IRQHandler()
{
if(TIM2->SR & TIM_SR_UIF) {
// clear flag
TIM2-> SR &= ~TIM_SR_UIF;
//TODO: call handler here
((intHandler_t)(intHandlerList[TIM2_UPDATE]))();
}
if(TIM2->SR & TIM_SR_CC1IF) {
TIM2-> SR &= ~TIM_SR_CC1IF;
((intHandler_t)(intHandlerList[TIM2_COUNTERCOMPARE_1]))();
}
if(TIM2->SR & TIM_SR_CC2IF) {
TIM2-> SR &= ~TIM_SR_CC2IF;
((intHandler_t)(intHandlerList[TIM2_COUNTERCOMPARE_2]))();
}
if(TIM2->SR & TIM_SR_CC3IF) {
TIM2-> SR &= ~TIM_SR_CC3IF;
((intHandler_t)(intHandlerList[TIM2_COUNTERCOMPARE_3]))();
}
if(TIM2->SR & TIM_SR_CC4IF) {
TIM2-> SR &= ~TIM_SR_CC4IF;
((intHandler_t)(intHandlerList[TIM2_COUNTERCOMPARE_4]))();
}
if(TIM2->SR & TIM_SR_TIF) {
TIM2-> SR &= ~TIM_SR_TIF;
((intHandler_t)(intHandlerList[TIM2_TRIGGER]))();
}
if(TIM2->SR & TIM_SR_CC1OF) {
TIM2-> SR &= ~TIM_SR_CC1OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMPARE_1]))();
}
if(TIM2->SR & TIM_SR_CC2OF) {
TIM2-> SR &= ~TIM_SR_CC2OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMPARE_2]))();
}
if(TIM2->SR & TIM_SR_CC3OF) {
TIM2-> SR &= ~TIM_SR_CC3OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMPARE_3]))();
}
if(TIM2->SR & TIM_SR_CC4OF) {
TIM2-> SR &= ~TIM_SR_CC4OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMAPRE_4]))();
}
}

@ -71,7 +71,7 @@ endfunction()
function(makeSubmodules _directory _aliasList _submoduleList) function(makeSubmodules _directory _aliasList _submoduleList)
set(_newSubmoduleList) set(_newSubmoduleList)
set(_headerLoc) set(_headerLoc)
#For each alias of element present on the list that have been given as argument #For each alias of element present on the list that has been given as argument
foreach(alias IN LISTS _aliasList) foreach(alias IN LISTS _aliasList)
checkDirectory("${_directory}/${alias}") # Does the directory exists (If not fatal error) checkDirectory("${_directory}/${alias}") # Does the directory exists (If not fatal error)

Loading…
Cancel
Save