From 71b8b23e629575377164e0002a8e8c93c31c3c08 Mon Sep 17 00:00:00 2001 From: Raph Date: Fri, 14 Apr 2023 17:34:45 +0200 Subject: [PATCH] callback son --- soft/PjtKEIL_StepSon/Src/GestionSon.s | 23 ++++++++++++++--------- soft/PjtKEIL_StepSon/StepSon.uvoptx | 14 +++++++------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/soft/PjtKEIL_StepSon/Src/GestionSon.s b/soft/PjtKEIL_StepSon/Src/GestionSon.s index 17ae42e..13ab48b 100644 --- a/soft/PjtKEIL_StepSon/Src/GestionSon.s +++ b/soft/PjtKEIL_StepSon/Src/GestionSon.s @@ -28,7 +28,7 @@ index dcd 0 ; écrire le code ici CallbackSon proc - push {r4,lr,r5,r6,r7} + push {lr,r4-r7} ldr r4,=LongueurSon ldr r4,[r4] ldr r2,=index @@ -44,22 +44,27 @@ alors ldr r3,=SortieSon ldr r1,=Son - ldrsh r0,[r1,r2,lsl#1] ; R0 = *(R1+2*R2 ) R0 = R1[R2] + ldrsh r0,[r1,r7,lsl#1] ; R0 = *(R1+2*R7 ) R0 = R1[R7] - mov r5,#719 - mul r3,r5 - asr r3,#16 + mov r5,#32768 + add r0,r5 + + mov r6,#719 + mul r0,r6 + ;ldr r6,=23560192 ;719*32768 + asr r0,#16 + ;add r0,r6 - ldr r6,=23560192 ;719*32768 - add r3,r6 - asr r3,#16 + ; mise à jour de SortieSon + strh r0,[r3] + ;ldr r3,[r0] add r7,#1 ;index=index+1 str r7,[r2] ; *R2 = R7 finsi - pop {r4,lr,r5,r6,r7} + pop {lr,r4-r7} bx lr endp diff --git a/soft/PjtKEIL_StepSon/StepSon.uvoptx b/soft/PjtKEIL_StepSon/StepSon.uvoptx index 247b209..5128606 100644 --- a/soft/PjtKEIL_StepSon/StepSon.uvoptx +++ b/soft/PjtKEIL_StepSon/StepSon.uvoptx @@ -157,9 +157,9 @@ 0 0 - 31 + 47 1 -
134219960
+
134219980
0 0 0 @@ -168,14 +168,14 @@ 1 .\Src\GestionSon.s - \\StepSon\Src/GestionSon.s\31 + \\StepSon\Src/GestionSon.s\47
1 - 0 - R2 + 266 + R5 0 @@ -225,12 +225,12 @@ 0 ((portb & 0x00000002) >> 1 & 0x2) >> 1 - FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F100000000000000000000000000000000000000096020008 + FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F130000000000000000000000000000000000000096020008 1 `SortieSon - 0080000000000000000000000000E0FFFFFFEF4100000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000E03F100000000000000000000000000000000000000094080008 + 0080000000000000000000000000E0FFFFFFEF4100000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000E03F130000000000000000000000000000000000000094080008