Update 'soft/PjtKEIL_StepSon/Src/GestionSon.s'
This commit is contained in:
parent
1d39dbec8b
commit
e831904f35
1 changed files with 5 additions and 6 deletions
|
@ -86,18 +86,17 @@ GestionSon proc
|
||||||
ldr r2, =Son_index
|
ldr r2, =Son_index
|
||||||
ldr r1, [r2]
|
ldr r1, [r2]
|
||||||
cmp r0, r1
|
cmp r0, r1
|
||||||
bls EndOfSound ; if (LongeurSon <= Son_index) goto ResetGestionSon;
|
bls EndOfSound ;
|
||||||
ldr r3, =Son
|
ldr r3, =Son
|
||||||
ldrsh r0, [r3, r1, lsl #1]
|
ldrsh r0, [r3, r1, lsl #1];
|
||||||
; r0 = Son[Son_index]
|
|
||||||
add r0, #32768
|
add r0, #32768
|
||||||
mov r3, #720
|
mov r3, #720
|
||||||
mul r0, r3
|
mul r0, r3
|
||||||
lsr r0, #16 ;x in [-32768; 32767] -> x in [0; 719]
|
lsr r0, #16 ;
|
||||||
ldr r3, =Sortie_son
|
ldr r3, =Sortie_son
|
||||||
str r0, [r3] ; Sortie_son = x
|
str r0, [r3] ;
|
||||||
add r1, r1, #1
|
add r1, r1, #1
|
||||||
str r1, [r2] ; Son_index++;
|
str r1, [r2] ;
|
||||||
b PWM_Set_Value_TIM3_Ch3
|
b PWM_Set_Value_TIM3_Ch3
|
||||||
EndOfSound
|
EndOfSound
|
||||||
bx lr
|
bx lr
|
||||||
|
|
Loading…
Reference in a new issue