diff --git a/soft/PjtKEIL_StepDeb_2/Src/Cligno.s b/soft/PjtKEIL_StepDeb_2/Src/Cligno.s index 8c80eb5..25e91e4 100644 --- a/soft/PjtKEIL_StepDeb_2/Src/Cligno.s +++ b/soft/PjtKEIL_StepDeb_2/Src/Cligno.s @@ -30,7 +30,7 @@ ;Section RAM (read write): area maram,data,readwrite FlagCligno dcd 0 - +index dcd 0 ; =============================================================================================== diff --git a/soft/PjtKEIL_StepSon/Src/GestionSon.s b/soft/PjtKEIL_StepSon/Src/GestionSon.s index 8a75b7a..17ae42e 100644 --- a/soft/PjtKEIL_StepSon/Src/GestionSon.s +++ b/soft/PjtKEIL_StepSon/Src/GestionSon.s @@ -1,6 +1,11 @@ PRESERVE8 THUMB - + + export CallbackSon + export index + export SortieSon + import LongueurSon + import Son ; ====================== zone de réservation de données, ====================================== ;Section RAM (read only) : @@ -9,7 +14,8 @@ ;Section RAM (read write): area maram,data,readwrite - +SortieSon dcw 0 +index dcd 0 ; =============================================================================================== @@ -19,12 +25,42 @@ ;Section ROM code (read only) : area moncode,code,readonly -; écrire le code ici +; écrire le code ici + +CallbackSon proc + push {r4,lr,r5,r6,r7} + ldr r4,=LongueurSon + ldr r4,[r4] + ldr r2,=index + ldr r7,[r2] + cmp r4,r7 + + bne alors + +sinon + b finsi + +alors + ldr r3,=SortieSon + ldr r1,=Son + + ldrsh r0,[r1,r2,lsl#1] ; R0 = *(R1+2*R2 ) R0 = R1[R2] + + mov r5,#719 + mul r3,r5 + asr r3,#16 + + ldr r6,=23560192 ;719*32768 + add r3,r6 + asr r3,#16 + + add r7,#1 ;index=index+1 + str r7,[r2] ; *R2 = R7 - - - - +finsi + pop {r4,lr,r5,r6,r7} + bx lr + endp END \ No newline at end of file diff --git a/soft/PjtKEIL_StepSon/Src/principal.c b/soft/PjtKEIL_StepSon/Src/principal.c index 7e1db07..41da6a4 100644 --- a/soft/PjtKEIL_StepSon/Src/principal.c +++ b/soft/PjtKEIL_StepSon/Src/principal.c @@ -2,7 +2,9 @@ #include "DriverJeuLaser.h" -extern u32 * PeriodeSonMicroSec; +//extern u32 * PeriodeSonMicroSec; + +extern void CallbackSon(void); int main(void) { @@ -14,7 +16,8 @@ int main(void) // Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers CLOCK_Configure(); -Timer_1234_Init_ff( TIM4,*PeriodeSonMicroSec); +Timer_1234_Init_ff( TIM4, 1000000/11025); //Calcul de la periode de 91 microsec +Active_IT_Debordement_Timer( TIM4, 2, CallbackSon ); @@ -26,3 +29,15 @@ while (1) } } +/* +short int SortieSon +int index +Algo CallbackSon +if index-U066CFF574857847167074929 -O2254 -S0 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM) - + + + 0 + 0 + 31 + 1 +
134219960
+ 0 + 0 + 0 + 0 + 0 + 1 + .\Src\GestionSon.s + + \\StepSon\Src/GestionSon.s\31 +
+
+ + + 1 + 0 + R2 + 0 + + 0 @@ -174,7 +199,7 @@ 0 0 0 - 0 + 1 0 0 0 @@ -200,7 +225,12 @@ 0 ((portb & 0x00000002) >> 1 & 0x2) >> 1 - FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F160000000000000000000000000000000000000096020008 + FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F100000000000000000000000000000000000000096020008 + + + 1 + `SortieSon + 0080000000000000000000000000E0FFFFFFEF4100000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000E03F100000000000000000000000000000000000000094080008