From 35c3561ad9acc6c3e4f4519cda1a36ab30b6d117 Mon Sep 17 00:00:00 2001 From: Neluji <38362829+Neluji@users.noreply.github.com> Date: Tue, 24 Nov 2020 11:06:42 +0100 Subject: [PATCH] Basic fonct --- MDK-ARM/Project.uvoptx | 58 +++++++++++++++++++++++++++++++++-------- MDK-ARM/Project.uvprojx | 30 +++++++++++++++++++++ Services/MySequencer.c | 16 ++++++++++++ Services/MySequencer.h | 10 +++++++ Src/main.c | 16 ++---------- 5 files changed, 105 insertions(+), 25 deletions(-) create mode 100644 Services/MySequencer.c create mode 100644 Services/MySequencer.h diff --git a/MDK-ARM/Project.uvoptx b/MDK-ARM/Project.uvoptx index 481799b..bd0dccb 100644 --- a/MDK-ARM/Project.uvoptx +++ b/MDK-ARM/Project.uvoptx @@ -463,6 +463,30 @@ 0 0 + + 2 + 3 + 1 + 0 + 0 + 0 + ..\Services\Moteur.c + Moteur.c + 0 + 0 + + + 2 + 4 + 1 + 1 + 0 + 0 + ..\Services\MySequencer.c + MySequencer.c + 0 + 0 + @@ -473,7 +497,7 @@ 0 3 - 3 + 5 1 0 0 @@ -485,7 +509,7 @@ 3 - 4 + 6 1 0 0 @@ -497,7 +521,7 @@ 3 - 5 + 7 1 0 0 @@ -507,6 +531,18 @@ 0 0 + + 3 + 8 + 1 + 0 + 0 + 0 + ..\MyDrivers\MySysTick.c + MySysTick.c + 0 + 0 + @@ -517,7 +553,7 @@ 0 4 - 6 + 9 1 0 0 @@ -529,7 +565,7 @@ 4 - 7 + 10 1 0 0 @@ -541,7 +577,7 @@ 4 - 8 + 11 1 0 0 @@ -553,7 +589,7 @@ 4 - 9 + 12 1 0 0 @@ -565,7 +601,7 @@ 4 - 10 + 13 1 0 0 @@ -585,7 +621,7 @@ 0 5 - 11 + 14 5 0 0 @@ -605,7 +641,7 @@ 0 6 - 12 + 15 1 0 0 @@ -625,7 +661,7 @@ 0 7 - 13 + 16 2 0 0 diff --git a/MDK-ARM/Project.uvprojx b/MDK-ARM/Project.uvprojx index ba1fe3c..2c1aea2 100644 --- a/MDK-ARM/Project.uvprojx +++ b/MDK-ARM/Project.uvprojx @@ -397,6 +397,16 @@ 1 ..\Services\MyRF.c + + Moteur.c + 1 + ..\Services\Moteur.c + + + MySequencer.c + 1 + ..\Services\MySequencer.c + @@ -417,6 +427,11 @@ 1 ..\MyDrivers\MyUSART.c + + MySysTick.c + 1 + ..\MyDrivers\MySysTick.c + @@ -875,6 +890,16 @@ 1 ..\Services\MyRF.c + + Moteur.c + 1 + ..\Services\Moteur.c + + + MySequencer.c + 1 + ..\Services\MySequencer.c + @@ -895,6 +920,11 @@ 1 ..\MyDrivers\MyUSART.c + + MySysTick.c + 1 + ..\MyDrivers\MySysTick.c + diff --git a/Services/MySequencer.c b/Services/MySequencer.c new file mode 100644 index 0000000..5025e9c --- /dev/null +++ b/Services/MySequencer.c @@ -0,0 +1,16 @@ +#include "MySequencer.h" +#include "MySysTick.h" + + + +void MySequencer_Conf(void) { + + MySysTick_Conf(0xAFC80); + MySysTick_IT_Conf(MySequencer_Task_10ms,3); + MySysTick_IT_Enable(); + +} + +void MySequencer_Task_10ms (void) { + __nop(); +} diff --git a/Services/MySequencer.h b/Services/MySequencer.h new file mode 100644 index 0000000..fd85424 --- /dev/null +++ b/Services/MySequencer.h @@ -0,0 +1,10 @@ +#ifndef MY_SEQ_H +#define MY_SEQ_H + +#include "stm32f103xb.h" + +void MySequencer_Conf(void); + +void MySequencer_Task_10ms (void); + +#endif diff --git a/Src/main.c b/Src/main.c index ad2191e..8ac31fa 100644 --- a/Src/main.c +++ b/Src/main.c @@ -25,7 +25,7 @@ #include "MyRF.h" #include "Moteur.h" #include "MySysTick.h" -#include +#include "MySequencer.h" void SystemClock_Config(void); @@ -38,25 +38,13 @@ void SystemClock_Config(void); */ - -void test (void) { - printf("ok"); -} - int main(void) { /* Configure the system clock to 72 MHz */ SystemClock_Config(); - MySysTick_Conf(0xAFC80); - MySysTick_IT_Conf(test,3); - MySysTick_IT_Enable(); MyRF_Conf(); - - for(int i=0; i<0xCFFF; i++) { - } - - MyRF_Transmit_3s(); + MySequencer_Conf(); /* Infinite loop */ while (1)