From 877253db148d3ea516d686808ab6a9a46fa1552f Mon Sep 17 00:00:00 2001 From: Boyu Fu Date: Mon, 27 Mar 2023 08:47:01 +0200 Subject: [PATCH] TP2fini --- soft/PjtKEIL_StepDeb_2/BacASable.uvoptx | 22 +++++++++++++++++--- soft/PjtKEIL_StepDeb_2/Src/Cligno.s | 27 +++++++++++++++---------- soft/PjtKEIL_StepDeb_2/Src/principal.c | 4 ++-- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx b/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx index 397712b..fa5a172 100644 --- a/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx +++ b/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx @@ -173,9 +173,9 @@ 1 0 - 56 + 51 1 -
134220362
+
134220352
0 0 0 @@ -184,7 +184,23 @@ 1 .\Src\Cligno.s - \\BacASable\Src/Cligno.s\56 + \\BacASable\Src/Cligno.s\51 +
+ + 2 + 0 + 59 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + .\Src\Cligno.s + +
diff --git a/soft/PjtKEIL_StepDeb_2/Src/Cligno.s b/soft/PjtKEIL_StepDeb_2/Src/Cligno.s index ae499f7..7ec99b1 100644 --- a/soft/PjtKEIL_StepDeb_2/Src/Cligno.s +++ b/soft/PjtKEIL_StepDeb_2/Src/Cligno.s @@ -48,23 +48,28 @@ FlagCligno dcb 0 timer_callback proc + push {lr} ldr r1,=FlagCligno ; - cmp r1,#0x1 ; si r1(FlagCligno) == 1, on continue. - bne L0 ; sinon break to L0 - mov r2, #0x0 ; copie valeur "0" dans r2 + cmp r1,#0 ; si r1(FlagCligno) == 0, on continue. + beq L0 ; + cmp r1,#0 ; si r1(FlagCligno) == 0, on continue. + bne L1 ; sinon break to L1 + +L0 + mov r2, #1 + str r2, [r1] + mov r0, #1 ; GPIOB_Clear("1") + bl GPIOB_Clear + pop {pc} + +L1 + mov r2, #0 ; copie valeur "0" dans r2 str r2, [r1] ; la valeur 32bits contenue dans r2 est copiée en RAM à l'adresse spécifiée dans r1 mov r0, #1 ; GPIOB_Set(r0 = "1") bl GPIOB_Set - bx lr - -L0 - mov r2, #0x1 - str r2, [r1] - mov r0, #1 ; GPIOB_Clear("1") - bl GPIOB_Clear + pop {pc} - bx lr endp diff --git a/soft/PjtKEIL_StepDeb_2/Src/principal.c b/soft/PjtKEIL_StepDeb_2/Src/principal.c index 1794570..1cb26f6 100644 --- a/soft/PjtKEIL_StepDeb_2/Src/principal.c +++ b/soft/PjtKEIL_StepDeb_2/Src/principal.c @@ -20,14 +20,14 @@ CLOCK_Configure(); //** Placez votre code là ** // Timer_1234_Init_ff(TIM4, 7200000); -Active_IT_Debordement_Timer(TIM4, 2, timer_callback); + // 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à ** // - +Active_IT_Debordement_Timer(TIM4, 2, timer_callback); // configuration de PortB.1 (PB1) en sortie push-pull