diff --git a/soft/PjtKEIL_StepDeb_1/BacASable.uvprojx b/soft/PjtKEIL_StepDeb_1/BacASable.uvprojx
index e7a5ede..2318c0c 100644
--- a/soft/PjtKEIL_StepDeb_1/BacASable.uvprojx
+++ b/soft/PjtKEIL_StepDeb_1/BacASable.uvprojx
@@ -424,7 +424,7 @@
CibleSondeKEIL
0x4
ARM-ADS
- 5060750::V5.06 update 6 (build 750)::.\ARMCC
+ 5060960::V5.06 update 7 (build 960)::.\ARMCC
0
diff --git a/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx b/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx
index f1315bb..e12fc32 100644
--- a/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx
+++ b/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx
@@ -10,7 +10,7 @@
*.s*; *.src; *.a*
*.obj; *.o
*.lib
- *.txt; *.h; *.inc
+ *.txt; *.h; *.inc; *.md
*.plm
*.cpp
0
@@ -75,7 +75,7 @@
1
0
- 1
+ 0
18
@@ -154,6 +154,21 @@
+
+
+ 0
+ 1
+ FlagCligno
+
+
+
+
+ 1
+ 1
+ 0x200000A0
+ 0
+
+
0
@@ -174,7 +189,7 @@
0
0
0
- 0
+ 1
0
0
0
@@ -200,7 +215,7 @@
0
((portb & 0x00000002) >> 1 & 0x2) >> 1
- FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F160000000000000000000000000000000000000096020008
+ FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F040000000000000000000000000000000000000096020008
@@ -267,7 +282,7 @@
1
0
- 0
+ 1
18
@@ -374,7 +389,7 @@
0
0
0
- 0
+ 1
0
0
0
diff --git a/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx b/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx
index d99d0f0..71dc2cc 100644
--- a/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx
+++ b/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx
@@ -10,7 +10,7 @@
Simu
0x4
ARM-ADS
- 5060750::V5.06 update 6 (build 750)::.\ARMCC
+ 5060960::V5.06 update 7 (build 960)::.\ARMCC
0
@@ -357,7 +357,7 @@
-
+ .\Driver
@@ -424,7 +424,7 @@
CibleSondeKEIL
0x4
ARM-ADS
- 5060750::V5.06 update 6 (build 750)::.\ARMCC
+ 5060960::V5.06 update 7 (build 960)::.\ARMCC
0
@@ -771,7 +771,7 @@
-
+ .\Driver
@@ -1337,12 +1337,7 @@
- <Project Info>
-
-
-
-
-
+ BacASable
0
1
diff --git a/soft/PjtKEIL_StepDeb_2/Src/Cligno.s b/soft/PjtKEIL_StepDeb_2/Src/Cligno.s
index 8a75b7a..325433a 100644
--- a/soft/PjtKEIL_StepDeb_2/Src/Cligno.s
+++ b/soft/PjtKEIL_StepDeb_2/Src/Cligno.s
@@ -1,5 +1,8 @@
+ include DriverJeuLaser.inc
+
PRESERVE8
- THUMB
+ THUMB
+
; ====================== zone de réservation de données, ======================================
@@ -10,7 +13,12 @@
;Section RAM (read write):
area maram,data,readwrite
+FlagCligno dcd 0
+
+ export FlagCligno
+
+
; ===============================================================================================
@@ -19,12 +27,35 @@
;Section ROM code (read only) :
area moncode,code,readonly
-; écrire le code ici
-
-
-
+; écrire le code ici
+ EXPORT timer_callback
+timer_callback proc
+
+ push {lr}
+ ldr r1,=FlagCligno
+ ldr r0,[r1]
+ cmp r0, #1
+ bne Proc0
+
+ mov r0, #1
+ mov r2, #0
+ str r2, [r1]
+ bl GPIOB_Set
+ b fin
+
+Proc0
+ mov r0, #1
+ mov r2, #1
+ str r2, [r1]
+ bl GPIOB_Clear
+
+fin
+ pop {pc}
+ endp
+
+ END
- END
\ No newline at end of file
+
\ No newline at end of file
diff --git a/soft/PjtKEIL_StepDeb_2/Src/principal.c b/soft/PjtKEIL_StepDeb_2/Src/principal.c
index 4d726a1..60282e5 100644
--- a/soft/PjtKEIL_StepDeb_2/Src/principal.c
+++ b/soft/PjtKEIL_StepDeb_2/Src/principal.c
@@ -2,7 +2,7 @@
#include "DriverJeuLaser.h"
-void timer_callback(void);
+extern void timer_callback(void);
int main(void)
{
@@ -18,6 +18,10 @@ CLOCK_Configure();
//** Placez votre code là ** //
+ Timer_1234_Init_ff( TIM4, 7200000);
+
+ Active_IT_Debordement_Timer( TIM4, 2, timer_callback );
+
// Activation des interruptions issues du Timer 4
@@ -39,12 +43,13 @@ GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL);
while (1)
{
+
}
}
-char FlagCligno;
+//char FlagCligno;
-void timer_callback(void)
+/*void timer_callback(void)
{
if (FlagCligno==1)
{
@@ -57,5 +62,5 @@ void timer_callback(void)
GPIOB_Clear(1);
}
-}
+}*/
diff --git a/soft/PjtKEIL_StepSon/Src/GestionSon.s b/soft/PjtKEIL_StepSon/Src/GestionSon.s
index 8a75b7a..a81ce4c 100644
--- a/soft/PjtKEIL_StepSon/Src/GestionSon.s
+++ b/soft/PjtKEIL_StepSon/Src/GestionSon.s
@@ -1,6 +1,10 @@
PRESERVE8
THUMB
-
+
+ import Son
+ import LongueurSon
+ import PeriodeSonMicroSec
+
; ====================== zone de réservation de données, ======================================
;Section RAM (read only) :
@@ -11,6 +15,11 @@
area maram,data,readwrite
+SortieSon dcw 0
+Index dcw 0
+
+ export SortieSon
+
; ===============================================================================================
@@ -21,10 +30,41 @@
area moncode,code,readonly
; écrire le code ici
+ export timer_callback_son
+timer_callback_son proc
+ push {lr,r4}
+ ldr r4,=Index
+ ldr r2,[r4]
+ mov r0, r2
+ ldr r1,=LongueurSon
+ ldr r2,[r1]
+ mov r1, r2
+ cmp r0, r1
+ beq fin
+
+ ldr r3,=SortieSon
+ ldr r2,=Son
+
+ ldrsh r1,[r2,r0, lsl #1]
+ add r1,#32768
+ mov r2, #720
+ mul r1,r2
+ asr r1,#16
+
+ str r1, [r3]
+
+
+ mov r3, r0
+ add r3, #1
+ str r3, [r4]
+
-
+fin
+ pop {lr,r4}
+ 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 d09be75..23f8b08 100644
--- a/soft/PjtKEIL_StepSon/Src/principal.c
+++ b/soft/PjtKEIL_StepSon/Src/principal.c
@@ -2,7 +2,7 @@
#include "DriverJeuLaser.h"
-
+extern void timer_callback_son(void);
int main(void)
{
@@ -14,6 +14,12 @@ int main(void)
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
CLOCK_Configure();
+// configuration du Timer 4 en débordement 91 microsecondes
+
+ Timer_1234_Init_ff( TIM4, 91*72);
+
+ Active_IT_Debordement_Timer( TIM4, 2, timer_callback_son );
+
diff --git a/soft/PjtKEIL_StepSon/StepSon.uvoptx b/soft/PjtKEIL_StepSon/StepSon.uvoptx
index a13d7da..a6f7da5 100644
--- a/soft/PjtKEIL_StepSon/StepSon.uvoptx
+++ b/soft/PjtKEIL_StepSon/StepSon.uvoptx
@@ -10,7 +10,7 @@
*.s*; *.src; *.a*
*.obj; *.o
*.lib
- *.txt; *.h; *.inc
+ *.txt; *.h; *.inc; *.md
*.plm
*.cpp
0
@@ -75,7 +75,7 @@
1
0
- 0
+ 1
18
@@ -154,6 +154,14 @@
+
+
+ 1
+ 265
+ r3
+ 0
+
+
0
@@ -174,7 +182,7 @@
0
0
0
- 0
+ 1
0
0
0
@@ -199,8 +207,8 @@
0
- ((portb & 0x00000002) >> 1 & 0x2) >> 1
- FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F160000000000000000000000000000000000000096020008
+ `SortieSon
+ 008000000000000000000000000000000080864000000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F00000001000000000000000000F03F0D00000000000000000000000000000000000000AE080008
@@ -460,7 +468,7 @@
1
0
- 1
+ 0
18
@@ -616,7 +624,7 @@
1
1
1
- 0
+ 1
0
0
.\Src\principal.c
@@ -666,6 +674,38 @@
+
+ son
+ 1
+ 0
+ 0
+ 0
+
+ 4
+ 4
+ 2
+ 0
+ 0
+ 0
+ .\Src\bruitverre.asm
+ bruitverre.asm
+ 0
+ 0
+
+
+ 4
+ 5
+ 2
+ 0
+ 0
+ 0
+ .\Src\GestionSon.s
+ GestionSon.s
+ 0
+ 0
+
+
+
::CMSIS
0
diff --git a/soft/PjtKEIL_StepSon/StepSon.uvprojx b/soft/PjtKEIL_StepSon/StepSon.uvprojx
index d0b5c10..8e2853b 100644
--- a/soft/PjtKEIL_StepSon/StepSon.uvprojx
+++ b/soft/PjtKEIL_StepSon/StepSon.uvprojx
@@ -10,7 +10,7 @@
Simu
0x4
ARM-ADS
- 5060750::V5.06 update 6 (build 750)::.\ARMCC
+ 5060960::V5.06 update 7 (build 960)::.\ARMCC
0
@@ -410,6 +410,21 @@
+
+ son
+
+
+ bruitverre.asm
+ 2
+ .\Src\bruitverre.asm
+
+
+ GestionSon.s
+ 2
+ .\Src\GestionSon.s
+
+
+
::CMSIS
@@ -819,6 +834,21 @@
+
+ son
+
+
+ bruitverre.asm
+ 2
+ .\Src\bruitverre.asm
+
+
+ GestionSon.s
+ 2
+ .\Src\GestionSon.s
+
+
+
::CMSIS
@@ -897,7 +927,7 @@
CibleSondeST
0x4
ARM-ADS
- 5060750::V5.06 update 6 (build 750)::.\ARMCC
+ 5060960::V5.06 update 7 (build 960)::.\ARMCC
0
@@ -1297,6 +1327,21 @@
+
+ son
+
+
+ bruitverre.asm
+ 2
+ .\Src\bruitverre.asm
+
+
+ GestionSon.s
+ 2
+ .\Src\GestionSon.s
+
+
+
::CMSIS
@@ -1322,12 +1367,7 @@
- <Project Info>
-
-
-
-
-
+ StepSon
0
1