StartSon fonctionnelle

This commit is contained in:
Remi Pitault 2023-04-12 13:02:13 +02:00
parent 2304e386e9
commit 7bbad209c5
3 changed files with 17 additions and 7 deletions

View file

@ -13,7 +13,7 @@
;Section RAM (read write):
area maram,data,readwrite
IndexSon DCW 0
IndexSon DCW 5512
SortieSon DCW 0
EXPORT SortieSon
@ -21,11 +21,21 @@ SortieSon DCW 0
; ===============================================================================================
EXPORT CallbackSon
EXPORT StartSon
;Section ROM code (read only) :
area moncode,code,readonly
; écrire le code ici
StartSon proc
push {lr}
ldr r0, =IndexSon
mov r1, #0
str r1, [r0]
pop {lr}
bx lr
ENDP
CallbackSon proc
push {lr}
ldr r0, =IndexSon ; r0 = &IndexSon
@ -35,9 +45,7 @@ CallbackSon proc
ldr r3, [r2] ; r3 = LongueurSon
cmp r1, r3
blt NoReset
mov r1, #0 ; si IndexSon >= LongueurSon alors IndexSon = 0
NoReset
bge DoNothing
ldr r3, =Son ; r3 = &Son
ldrsh r2, [r3, r1, LSL#1] ; r2 = Son[IndexSon]
add r2, #0x8000 ; translater de [-32768;32767] à [0;65535]
@ -50,6 +58,7 @@ NoReset
strh r2, [r0] ; SortieSon = ce qu'on veut
mov r0, r2
bl PWM_Set_Value_TIM3_Ch3
DoNothing
pop {lr}
bx lr

View file

@ -1,6 +1,7 @@
#include "DriverJeuLaser.h"
extern void CallbackSon(void);
extern void StartSon(void);
int main(void)
{
@ -17,9 +18,9 @@ Timer_1234_Init_ff(TIM4, 6552); // periode_son/f_CPU = (91*10^-6)*(72*10^6) = 65
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
//============================================================================
while (1)
{
StartSon();
}
}

View file

@ -215,7 +215,7 @@
<Wi>
<IntNumber>0</IntNumber>
<FirstString>`SortieSon</FirstString>
<SecondString>008000000000000000000000000000905D78864100000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004100000001000000000000000000E03F170000000000000000000000000000000000000094080008</SecondString>
<SecondString>0080000000000010572172410000005058E17A4100000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004100000001000000000000000000E03F170000000000000000000000000000000000000094080008</SecondString>
</Wi>
<Wi>
<IntNumber>1</IntNumber>