tried to patch the sound not stopping
This commit is contained in:
parent
2f5665052a
commit
7c6c96b88f
1 changed files with 19 additions and 3 deletions
|
@ -3,10 +3,11 @@
|
|||
include ./Driver/DriverJeuLaser.inc
|
||||
|
||||
|
||||
; ====================== zone de réservation de données, ======================================
|
||||
; ====================== zone de r<EFBFBD>servation de donn<6E>es, ======================================
|
||||
;Section RAM (read only) :
|
||||
area mesdata,data,readonly
|
||||
extern Son
|
||||
extern LongueurSon
|
||||
|
||||
;Section RAM (read write):
|
||||
area maram,data,readwrite
|
||||
|
@ -24,14 +25,25 @@ index dcd 0
|
|||
|
||||
;Section ROM code (read only) :
|
||||
area moncode,code,readonly
|
||||
; écrire le code ici
|
||||
; <EFBFBD>crire le code ici
|
||||
|
||||
export CallbackSon
|
||||
CallbackSon proc
|
||||
|
||||
push {lr}
|
||||
push {r5}
|
||||
|
||||
ldr r0, =Son ;r0=&Son
|
||||
ldr r2, =index ; r2=&index
|
||||
ldr r1, [r2] ; r1 = index
|
||||
|
||||
ldr r5, = LongueurSon ; r5 = &LongueurSon
|
||||
ldr r5, [r5] ; r5 = LongueurSon ; r5 = LongueurSon
|
||||
asl r5, #1; r5 = 2 x LongueurSon
|
||||
|
||||
cmp r1, r5 ; compare index et length
|
||||
bgt done
|
||||
|
||||
ldrsh r3, [r0, r1] ;r3=son[index]
|
||||
; on aurait pu faire ldrsh r3, [r0, r1, lsl #1] et incrementer de 1
|
||||
add r1, #2 ; index +=2
|
||||
|
@ -46,7 +58,7 @@ CallbackSon proc
|
|||
asr r3, #16 ;r3/=65536
|
||||
pop {r4}
|
||||
|
||||
;On met la valeur modifiée dans SortieSon
|
||||
;On met la valeur modifiee dans SortieSon
|
||||
ldr r0, =SortieSon ;r0=&SortieSon
|
||||
str r3, [r0]
|
||||
|
||||
|
@ -55,6 +67,9 @@ CallbackSon proc
|
|||
bl PWM_Set_Value_TIM3_Ch3
|
||||
pop {r0-r3}
|
||||
|
||||
done
|
||||
|
||||
pop {r5}
|
||||
pop {pc}
|
||||
endp
|
||||
|
||||
|
@ -63,6 +78,7 @@ CallbackSon proc
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
END
|
Loading…
Reference in a new issue