diff --git a/dossier/soft/PjtKEIL_StepSon/PWM.net b/dossier/soft/PjtKEIL_StepSon/PWM.net deleted file mode 100644 index 6842c5e..0000000 --- a/dossier/soft/PjtKEIL_StepSon/PWM.net +++ /dev/null @@ -1,16 +0,0 @@ -* U:\Documents\TP_Pioustolet\Partie ASM\grpE_RAMOUCHE_CASEAU\dossier\soft\PjtKEIL_StepSon\PWM.asc -V1 Compteur 0 PULSE(0 3.3 0 5u 0 0 5u) -C1 Filtre 0 10n -R1 Filtre PWM 3.9k -V2 CompValue 0 SINE(1.65 1 2k) -B1 PWM 0 V=if(V(CompValue)>V(Compteur),3.3,0) -;ac dec 100 1 10meg -.tran 0 1.5m 0 0.01u -* Compteur de l'unité Timer -* Partie PWM de l'unité Timer -* TIMER3 -* PB0 -* Chanel 3 -* STM32F103 -.backanno -.end diff --git a/dossier/soft/PjtKEIL_StepSon/Src/GestionSon.h b/dossier/soft/PjtKEIL_StepSon/Src/GestionSon.h new file mode 100644 index 0000000..210bee7 --- /dev/null +++ b/dossier/soft/PjtKEIL_StepSon/Src/GestionSon.h @@ -0,0 +1,6 @@ +//Il joue une donnée du tableau Son à chaque appel +extern void callbackson(void); + +//Permet le lancement de la séquence sonore +extern void StartSon(void); + \ No newline at end of file diff --git a/dossier/soft/PjtKEIL_StepSon/Src/GestionSon.s b/dossier/soft/PjtKEIL_StepSon/Src/GestionSon.s index bbe8f89..ae33a83 100644 --- a/dossier/soft/PjtKEIL_StepSon/Src/GestionSon.s +++ b/dossier/soft/PjtKEIL_StepSon/Src/GestionSon.s @@ -19,14 +19,14 @@ FlagSon dcb 0 SortieSon dcd 0 EXPORT SortieSon -Index dcw 0 +Index dcw 0xFFFF ;on met Index à sa valeur la plus haute pour être sûr de ne pas jouer le son tant qu'on aura pas fait appel à StartSon qui le mettra à 0 EXPORT Index ; =============================================================================================== ;Exportation de la fonction callbackson() EXPORT callbackson - + EXPORT StartSon ;Section ROM code (read only) : @@ -74,5 +74,16 @@ FINSI pop{r4} pop {PC} endp + +StartSon proc + push{lr} + + ldr r0, = Index + mov r1, #0 + str r1, [r0] + + pop{PC} + endp + END \ No newline at end of file diff --git a/dossier/soft/PjtKEIL_StepSon/Src/principal.c b/dossier/soft/PjtKEIL_StepSon/Src/principal.c index 60b31d8..7a67ec9 100644 --- a/dossier/soft/PjtKEIL_StepSon/Src/principal.c +++ b/dossier/soft/PjtKEIL_StepSon/Src/principal.c @@ -1,4 +1,5 @@ #include "DriverJeuLaser.h" +#include "GestionSon.h" int main(void) { @@ -16,10 +17,6 @@ Timer_1234_Init_ff(TIM4, 6552); //6552 // configuration du Timer 3 pour une PWM de fréquence 100kHz PWM_Init_ff(TIM3, 3, 720); -//Récupération de la fonction timer_callback() codée en ASM - extern void callbackson(); - - // Activation des interruptions issues du Timer 4 // Association de la fonction à exécuter lors de l'interruption : timer_callback @@ -33,23 +30,8 @@ GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL); //============================================================================ +StartSon(); while (1) { } } - -/*char FlagCligno; - -void timer_callback(void) -{ - if (FlagCligno==1) - { - FlagCligno=0; - GPIOB_Set(1); - } - else - { - FlagCligno=1; - GPIOB_Clear(1); - } -}*/ \ No newline at end of file diff --git a/dossier/soft/PjtKEIL_StepSon/StepSon.uvprojx b/dossier/soft/PjtKEIL_StepSon/StepSon.uvprojx index f62bcd5..0e0a60c 100644 --- a/dossier/soft/PjtKEIL_StepSon/StepSon.uvprojx +++ b/dossier/soft/PjtKEIL_StepSon/StepSon.uvprojx @@ -388,6 +388,11 @@ 1 .\Src\principal.c + + GestionSon.h + 5 + .\Src\GestionSon.h + @@ -439,7 +444,7 @@ CibleSondeKEIL 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 @@ -817,6 +822,11 @@ 1 .\Src\principal.c + + GestionSon.h + 5 + .\Src\GestionSon.h + @@ -1315,6 +1325,11 @@ 1 .\Src\principal.c + + GestionSon.h + 5 + .\Src\GestionSon.h +