Made some minor chnages to HANDLE_INT_FLAG macro, The fact that Interrups are not functioning correcly after a soft reset is known, chnages in the satrup and to the hardware may alter this behaviour
parent
68de79e685
commit
bbb2fefe71
@ -0,0 +1,42 @@
|
|||||||
|
#include "delay.h"
|
||||||
|
#include "pin.h"
|
||||||
|
#include "deviceSetup.h"
|
||||||
|
#include "interrupt.h"
|
||||||
|
#include "timer.h"
|
||||||
|
|
||||||
|
|
||||||
|
void blinkiTask()
|
||||||
|
{
|
||||||
|
pinToggle(pinB3);
|
||||||
|
}
|
||||||
|
|
||||||
|
void declareInterrupts()
|
||||||
|
{
|
||||||
|
intDisableGlobal();
|
||||||
|
|
||||||
|
timerInitCounter(timer_2,(8E6/16E3)-1, 5000-1, upCounting);
|
||||||
|
timerEnableInterrupt(timer_2,TIM2_UPDATE);
|
||||||
|
timerStart(timer_2);
|
||||||
|
|
||||||
|
intInit(TIM2_UPDATE, blinkiTask, 1);
|
||||||
|
intEnable(TIM2_UPDATE);
|
||||||
|
|
||||||
|
intEnableGlobal();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
uint8_t i = 0;
|
||||||
|
|
||||||
|
pinConfig(pinA0, input, def_stage, pullDown, def_speed);
|
||||||
|
pinConfig(pinB3, output, pushPull, def_res, def_speed);
|
||||||
|
|
||||||
|
pinWrite(pinB3, 0);
|
||||||
|
|
||||||
|
declareInterrupts();
|
||||||
|
|
||||||
|
while(1);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
#ifndef MAIN_H
|
||||||
|
#define MAIN_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MAIN_H */
|
@ -0,0 +1,21 @@
|
|||||||
|
#Declareing header directory for the project
|
||||||
|
#To add a new directory
|
||||||
|
# -> list(APPEND PROJECT_HEADERS_DIR ${PROJECT_DIR}/YOUR_DESIRED_DIRECTORY)
|
||||||
|
# list() = List declaration "DON'T CHANGE"
|
||||||
|
# PROJECT_HEADERS_DIR = Variable containing the listed direcotries "DON'T CHANCE
|
||||||
|
# ${PROJECT_DIR} = Direcotry of the main project this is per default the current direcotry it is defined in ked/CMakeLists.txt
|
||||||
|
#list(APPEND PROJECT_HEADERS_DIR ${PROJECT_DIR}/headers)
|
||||||
|
|
||||||
|
#Declaring sources directory for the project
|
||||||
|
#To add a new directory
|
||||||
|
# -> list(APPEND PROJECT_SOURCES_DIR ${PROJECT_DIR}/YOUR_DESIRED_DIRECTORY)
|
||||||
|
# list() = List declaration "DON'T CHANGE"
|
||||||
|
# PROJECT_SOURCES_DIR = Variable containing the listed direcotries "DON'T CHANCE
|
||||||
|
# ${PROJECT_DIR} = Direcotry of the main project this is per default the current direcotry it is defined in ked/CMakeLists.txt
|
||||||
|
#list(APPEND PROJECT_SOURCES_DIR ${PROJECT_DIR}/src)
|
||||||
|
#list(APPEND PROJECT_SOURCES_DIR ${PROJECT_DIR}/sensors)
|
||||||
|
|
||||||
|
#Declaring sources to be compiled for the project.
|
||||||
|
#CMake will look in each previsouly declarec sources directory until to find this files.
|
||||||
|
set(PROJECT_SOURCES_DIR_LIST)
|
||||||
|
|
Loading…
Reference in new issue