From 672b04586bdc852835548de9e382efcd51ee39dd Mon Sep 17 00:00:00 2001 From: Clement Mauperon <47110246+tensaiji@users.noreply.github.com> Date: Tue, 21 Mar 2023 17:19:14 +0100 Subject: [PATCH] KEIL Step 2 --- soft/PjtKEIL_StepDeb_1/BacASable.uvoptx | 44 +++++++++++------------ soft/PjtKEIL_StepDeb_2/BacASable.uvoptx | 21 ++++++++--- soft/PjtKEIL_StepDeb_2/BacASable.uvprojx | 9 ++--- soft/PjtKEIL_StepDeb_2/Src/Cligno.s | 46 +++++++++++++++++++----- soft/PjtKEIL_StepDeb_2/Src/principal.c | 32 ++++------------- 5 files changed, 85 insertions(+), 67 deletions(-) diff --git a/soft/PjtKEIL_StepDeb_1/BacASable.uvoptx b/soft/PjtKEIL_StepDeb_1/BacASable.uvoptx index 6031a0f..3261e20 100644 --- a/soft/PjtKEIL_StepDeb_1/BacASable.uvoptx +++ b/soft/PjtKEIL_StepDeb_1/BacASable.uvoptx @@ -75,7 +75,7 @@ 1 0 - 0 + 1 18 @@ -153,7 +153,24 @@ -U066CFF574857847167074929 -O2254 -S0 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM) - + + + 0 + 0 + 28 + 1 +
134218682
+ 0 + 0 + 0 + 0 + 0 + 1 + .\Src\principal.c + + \\BacASable\Src/principal.c\28 +
+
0 @@ -194,7 +211,7 @@ 0 0 0 - 1 + 0 0 0 0 @@ -292,7 +309,7 @@ 1 0 - 1 + 0 18 @@ -370,24 +387,7 @@ -U066CFF574857847167074929 -O2254 -S0 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM) - - - 0 - 0 - 44 - 1 -
134218704
- 0 - 0 - 0 - 0 - 0 - 1 - .\Src\Delay.s - - \\BacASable\Src/Delay.s\44 -
-
+ 0 diff --git a/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx b/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx index f1315bb..fe3e2b0 100644 --- a/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx +++ b/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx @@ -10,7 +10,7 @@ *.s*; *.src; *.a* *.obj; *.o *.lib - *.txt; *.h; *.inc + *.txt; *.h; *.inc; *.md *.plm *.cpp 0 @@ -154,6 +154,14 @@ + + + 1 + 0 + 0x200000A0 + 0 + + 0 @@ -174,7 +182,7 @@ 0 0 0 - 0 + 1 0 0 0 @@ -200,7 +208,12 @@ 0 ((portb & 0x00000002) >> 1 & 0x2) >> 1 - FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F160000000000000000000000000000000000000096020008 + FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F160000000000000000000000000000000000000096020008 + + + 1 + `FlagCligno + 008000000000000000000000000000000000F03F01000000000000000000000000000000466C6167436C69676E6F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000E03F1600000000000000000000000000000000000000080A0008 @@ -628,7 +641,7 @@ 1 2 2 - 0 + 1 0 0 .\Src\Cligno.s diff --git a/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx b/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx index d99d0f0..2c5376a 100644 --- a/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx +++ b/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx @@ -10,7 +10,7 @@ Simu 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 @@ -357,7 +357,7 @@ - + .\Driver @@ -1338,11 +1338,6 @@ <Project Info> - - - - - 0 1 diff --git a/soft/PjtKEIL_StepDeb_2/Src/Cligno.s b/soft/PjtKEIL_StepDeb_2/Src/Cligno.s index 8a75b7a..22e4bf2 100644 --- a/soft/PjtKEIL_StepDeb_2/Src/Cligno.s +++ b/soft/PjtKEIL_StepDeb_2/Src/Cligno.s @@ -10,21 +10,49 @@ ;Section RAM (read write): area maram,data,readwrite - +FlagCligno dcd 0 ; =============================================================================================== + INCLUDE DriverJeuLaser.inc - - + EXPORT FlagCligno + EXPORT timer_callback ;Section ROM code (read only) : area moncode,code,readonly -; écrire le code ici +;void timer_callback(void) +;{ +; if (FlagCligno==1) +; { +; FlagCligno=0; +; GPIOB_Set(1); +; } +; else +; { +; FlagCligno=1; +; GPIOB_Clear(1); +; } +;} - - - - - +timer_callback proc + push {lr} + mov r0,#1 ; Argument pour les fonction GPIOB + ldr r4,=FlagCligno ; Ecriture de l'adresse de FlagCligno dans R4 + ldrb r5,[r4] ; Ecriture de la valeur de FlagCligno dans R5 + cmp r5,#1 + bne ClignoUp + ; if (FlagCligno == 1) + bl GPIOB_Set + mov r5,#0 + b TimerCallbackEnd +ClignoUp + ; else if (FlagCligno == 0) + bl GPIOB_Clear + mov r5,#1 +TimerCallbackEnd + strb r5,[r4] ; FlagCligno = R5 + pop {pc} + endp + END \ No newline at end of file diff --git a/soft/PjtKEIL_StepDeb_2/Src/principal.c b/soft/PjtKEIL_StepDeb_2/Src/principal.c index 4d726a1..338d209 100644 --- a/soft/PjtKEIL_StepDeb_2/Src/principal.c +++ b/soft/PjtKEIL_StepDeb_2/Src/principal.c @@ -2,7 +2,9 @@ #include "DriverJeuLaser.h" -void timer_callback(void); +extern void timer_callback(void); + +#define CLOCK_FREQ 72000 // kHz int main(void) { @@ -16,22 +18,20 @@ CLOCK_Configure(); // configuration du Timer 4 en débordement 100ms -//** Placez votre code là ** // - - +Timer_1234_Init_ff(TIM4, 100 * CLOCK_FREQ); // Activation des interruptions issues du Timer 4 // Association de la fonction à exécuter lors de l'interruption : timer_callback // cette fonction (si écrite en ASM) doit être conforme à l'AAPCS -//** Placez votre code là ** // - // configuration de PortB.1 (PB1) en sortie push-pull GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL); - + +//** Placez votre code là ** // +Active_IT_Debordement_Timer(TIM4, 2, timer_callback); //============================================================================ @@ -41,21 +41,3 @@ while (1) { } } - -char FlagCligno; - -void timer_callback(void) -{ - if (FlagCligno==1) - { - FlagCligno=0; - GPIOB_Set(1); - } - else - { - FlagCligno=1; - GPIOB_Clear(1); - } - -} -