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
|
include ./Driver/DriverJeuLaser.inc
|
||||||
|
|
||||||
|
|
||||||
; ====================== zone de réservation de données, ======================================
|
; ====================== zone de r<EFBFBD>servation de donn<6E>es, ======================================
|
||||||
;Section RAM (read only) :
|
;Section RAM (read only) :
|
||||||
area mesdata,data,readonly
|
area mesdata,data,readonly
|
||||||
extern Son
|
extern Son
|
||||||
|
extern LongueurSon
|
||||||
|
|
||||||
;Section RAM (read write):
|
;Section RAM (read write):
|
||||||
area maram,data,readwrite
|
area maram,data,readwrite
|
||||||
|
@ -24,14 +25,25 @@ index dcd 0
|
||||||
|
|
||||||
;Section ROM code (read only) :
|
;Section ROM code (read only) :
|
||||||
area moncode,code,readonly
|
area moncode,code,readonly
|
||||||
; écrire le code ici
|
; <EFBFBD>crire le code ici
|
||||||
|
|
||||||
export CallbackSon
|
export CallbackSon
|
||||||
CallbackSon proc
|
CallbackSon proc
|
||||||
|
|
||||||
push {lr}
|
push {lr}
|
||||||
|
push {r5}
|
||||||
|
|
||||||
ldr r0, =Son ;r0=&Son
|
ldr r0, =Son ;r0=&Son
|
||||||
ldr r2, =index ; r2=&index
|
ldr r2, =index ; r2=&index
|
||||||
ldr r1, [r2] ; r1 = 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]
|
ldrsh r3, [r0, r1] ;r3=son[index]
|
||||||
; on aurait pu faire ldrsh r3, [r0, r1, lsl #1] et incrementer de 1
|
; on aurait pu faire ldrsh r3, [r0, r1, lsl #1] et incrementer de 1
|
||||||
add r1, #2 ; index +=2
|
add r1, #2 ; index +=2
|
||||||
|
@ -46,7 +58,7 @@ CallbackSon proc
|
||||||
asr r3, #16 ;r3/=65536
|
asr r3, #16 ;r3/=65536
|
||||||
pop {r4}
|
pop {r4}
|
||||||
|
|
||||||
;On met la valeur modifiée dans SortieSon
|
;On met la valeur modifiee dans SortieSon
|
||||||
ldr r0, =SortieSon ;r0=&SortieSon
|
ldr r0, =SortieSon ;r0=&SortieSon
|
||||||
str r3, [r0]
|
str r3, [r0]
|
||||||
|
|
||||||
|
@ -55,6 +67,9 @@ CallbackSon proc
|
||||||
bl PWM_Set_Value_TIM3_Ch3
|
bl PWM_Set_Value_TIM3_Ch3
|
||||||
pop {r0-r3}
|
pop {r0-r3}
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
pop {r5}
|
||||||
pop {pc}
|
pop {pc}
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
@ -63,6 +78,7 @@ CallbackSon proc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
END
|
END
|
Loading…
Reference in a new issue