diff --git a/soft/PjtKEIL_StepSon/Src/GestionSon.h b/soft/PjtKEIL_StepSon/Src/GestionSon.h
new file mode 100644
index 0000000..f3f0065
--- /dev/null
+++ b/soft/PjtKEIL_StepSon/Src/GestionSon.h
@@ -0,0 +1,2 @@
+extern short SortieSon;
+extern void StartSon();
\ No newline at end of file
diff --git a/soft/PjtKEIL_StepSon/Src/GestionSon.s b/soft/PjtKEIL_StepSon/Src/GestionSon.s
index 012fa80..8b200c3 100644
--- a/soft/PjtKEIL_StepSon/Src/GestionSon.s
+++ b/soft/PjtKEIL_StepSon/Src/GestionSon.s
@@ -17,6 +17,7 @@ indexTab dcd 0
; ===============================================================================================
EXPORT CallbackSon;
+ EXPORT StartSon;
EXPORT SortieSon;
EXTERN LongueurSon;
EXTERN Son;
@@ -29,6 +30,14 @@ indexTab dcd 0
area moncode,code,readonly
; écrire le code ici
+StartSon proc
+
+ LDR r0,=indexTab
+ MOV r1,#0
+ STR r1,[r0]
+ BX LR
+ endp
+
CallbackSon proc
LDR r0,=SortieSon
LDR r1,=Son
@@ -71,7 +80,7 @@ CallbackSon proc
BX lr
Fin
- MOV r2,#0
+ MOV r2,#-1
STR r2,[r0]
pop {r8}
diff --git a/soft/PjtKEIL_StepSon/Src/principal.c b/soft/PjtKEIL_StepSon/Src/principal.c
index e86dc30..f22d0f8 100644
--- a/soft/PjtKEIL_StepSon/Src/principal.c
+++ b/soft/PjtKEIL_StepSon/Src/principal.c
@@ -1,6 +1,9 @@
#include "DriverJeuLaser.h"
+#include "GestionSon.h"
+
+
void CallbackSon(void);
@@ -22,6 +25,10 @@ GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
while (1)
{
+ if(SortieSon==-1)
+ {
+ StartSon();
+ }
}
}
diff --git a/soft/PjtKEIL_StepSon/StepSon.uvoptx b/soft/PjtKEIL_StepSon/StepSon.uvoptx
index fb2a3ed..59b47cf 100644
--- a/soft/PjtKEIL_StepSon/StepSon.uvoptx
+++ b/soft/PjtKEIL_StepSon/StepSon.uvoptx
@@ -753,6 +753,18 @@
0
0
+
+ 4
+ 6
+ 5
+ 0
+ 0
+ 0
+ .\Src\GestionSon.h
+ GestionSon.h
+ 0
+ 0
+
diff --git a/soft/PjtKEIL_StepSon/StepSon.uvprojx b/soft/PjtKEIL_StepSon/StepSon.uvprojx
index 2849fe6..33e8a1e 100644
--- a/soft/PjtKEIL_StepSon/StepSon.uvprojx
+++ b/soft/PjtKEIL_StepSon/StepSon.uvprojx
@@ -423,6 +423,11 @@
2
.\Src\GestionSon.s
+
+ GestionSon.h
+ 5
+ .\Src\GestionSon.h
+
@@ -434,7 +439,7 @@
CibleSondeKEIL
0x4
ARM-ADS
- 5060750::V5.06 update 6 (build 750)::.\ARMCC
+ 5060960::V5.06 update 7 (build 960)::.\ARMCC
0
@@ -847,6 +852,11 @@
2
.\Src\GestionSon.s
+
+ GestionSon.h
+ 5
+ .\Src\GestionSon.h
+
@@ -1340,6 +1350,11 @@
2
.\Src\GestionSon.s
+
+ GestionSon.h
+ 5
+ .\Src\GestionSon.h
+