From 3e88b876490f25c4d11256922645c185193aba36 Mon Sep 17 00:00:00 2001 From: brunetto Date: Fri, 14 Apr 2023 15:57:32 +0200 Subject: [PATCH] Step_Jeu_Son Fini --- soft/PjtKEIL_StepSon/Src/GestionSon.h | 14 ++++++++++++++ soft/PjtKEIL_StepSon/Src/GestionSon.s | 15 ++++++++------- soft/PjtKEIL_StepSon/Src/principal.c | 18 ++++++++---------- soft/PjtKEIL_StepSon/StepSon.uvoptx | 6 +++--- 4 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 soft/PjtKEIL_StepSon/Src/GestionSon.h diff --git a/soft/PjtKEIL_StepSon/Src/GestionSon.h b/soft/PjtKEIL_StepSon/Src/GestionSon.h new file mode 100644 index 0000000..a0068a5 --- /dev/null +++ b/soft/PjtKEIL_StepSon/Src/GestionSon.h @@ -0,0 +1,14 @@ +/** + * Bibliothèque comprenant les fonctions de gestion du son bruitverre.asm à travers GestionSon.s + * Les fonctions présentes sont CallbackSon et StartSon + */ +#include "DriverJeuLaser.h" + + +//********************************************************************************************************** +//--------------------- FONCTIONS DE GESTION DU SON -------------------------------------- +//********************************************************************************************************** + +void CallbackSon(void); + +void StartSon(void); \ No newline at end of file diff --git a/soft/PjtKEIL_StepSon/Src/GestionSon.s b/soft/PjtKEIL_StepSon/Src/GestionSon.s index 9db345c..6932b1d 100644 --- a/soft/PjtKEIL_StepSon/Src/GestionSon.s +++ b/soft/PjtKEIL_StepSon/Src/GestionSon.s @@ -17,7 +17,7 @@ Index dcw 0 ; =============================================================================================== EXPORT SortieSon EXPORT CallbackSon - ;EXPORT StartSon + EXPORT StartSon IMPORT Son IMPORT LongueurSon IMPORT PWM_Set_Value_TIM3_Ch3 @@ -67,12 +67,13 @@ Fin endp -;StartSon proc -; push {lr} -; ldr r3,=Index -; mov r1, #0 -; strh r1,[r3] -; pop {pc} +StartSon proc + push {lr} + ldr r3,=Index + mov r1, #0 + strh r1,[r3] + pop {pc} + endp diff --git a/soft/PjtKEIL_StepSon/Src/principal.c b/soft/PjtKEIL_StepSon/Src/principal.c index 351c8ec..dbfaf06 100644 --- a/soft/PjtKEIL_StepSon/Src/principal.c +++ b/soft/PjtKEIL_StepSon/Src/principal.c @@ -1,9 +1,5 @@ -#include "DriverJeuLaser.h" - -void CallbackSon(void); - -//void StartSon(void); +#include "GestionSon.h" int main(void) { @@ -35,17 +31,19 @@ Active_IT_Debordement_Timer( TIM4, 2, CallbackSon ); GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL); GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL); + +//Appel Startson tout les secondes. Enlevez le commentaire pour tester StartSon en simulation +/* +Timer_1234_Init_ff( TIM2, 72000000 ); + +Active_IT_Debordement_Timer( TIM2, 2, StartSon ); +*/ //============================================================================ while (1) { - /* - for(int i = 0; i<99999; i++) - { - StartSon(); - }*/ } } diff --git a/soft/PjtKEIL_StepSon/StepSon.uvoptx b/soft/PjtKEIL_StepSon/StepSon.uvoptx index 59ac483..6e45982 100644 --- a/soft/PjtKEIL_StepSon/StepSon.uvoptx +++ b/soft/PjtKEIL_StepSon/StepSon.uvoptx @@ -180,7 +180,7 @@ 1 10 - R2 + R3 0 @@ -230,12 +230,12 @@ 0 (PORTB & 0x00000001) - 008000000000000000000000000000000000F03F0000000000000000000000000000000028504F52544220262030783030303030303031290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F0E00000000000000000000000000000000000000F20A0008 + 008000000000000000000000000000000000F03F0000000000000000000000000000000028504F52544220262030783030303030303031290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F1900000000000000000000000000000000000000F20A0008 1 (SortieSon & 0xFFFF) >> 0 - 000080000000000000000000000000000000884000000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003000000FFFFFFFFFFFFDF3F0E00000000000000000000000000000000000000CC090008 + 000080000000000000000000000000000000884000000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000FFFFFFFFFFFFDF3F1900000000000000000000000000000000000000CC090008