diff --git a/Etape_3.uvoptx b/Etape_3.uvoptx
index 3ec42b9..3792be7 100644
--- a/Etape_3.uvoptx
+++ b/Etape_3.uvoptx
@@ -75,7 +75,7 @@
1
0
- 0
+ 1
18
@@ -125,7 +125,7 @@
0
DLGDARM
- (1010=1003,355,1379,912,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=15,39,661,712,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=1462,180,1883,607,1)(121=1499,392,1920,819,0)(122=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=1142,371,1736,1122,1)(131=255,99,849,850,0)(132=49,93,643,844,0)(133=0,32,594,783,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)
+ (1010=1003,355,1379,912,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=15,39,661,712,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=1462,180,1883,607,1)(121=1499,392,1920,819,0)(122=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=1088,133,1682,884,1)(131=255,99,849,850,0)(132=49,93,643,844,0)(133=0,32,594,783,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)
0
@@ -142,9 +142,25 @@
0
0
- 50
+ 81
1
- 134222940
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ .\FonctionEtape3.asm
+
+
+
+
+ 1
+ 0
+ 54
+ 1
+ 134222998
0
0
0
@@ -153,7 +169,39 @@
1
.\FonctionEtape3.asm
- \\Simu_Etape0\FonctionEtape3.asm\50
+ \\Simu_Etape0\FonctionEtape3.asm\54
+
+
+ 2
+ 0
+ 55
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ .\FonctionEtape3.asm
+
+
+
+
+ 3
+ 0
+ 82
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ .\FonctionEtape3.asm
+
+
@@ -196,7 +244,7 @@
0
0
0
- 1
+ 0
0
0
0
@@ -294,7 +342,7 @@
1
0
- 1
+ 0
18
@@ -366,9 +414,9 @@
0
0
- 56
+ 55
1
- 134223162
+ 134223214
0
0
0
@@ -377,7 +425,7 @@
1
.\FonctionEtape3.asm
- \\Reel_Etape0\FonctionEtape3.asm\56
+ \\Reel_Etape0\FonctionEtape3.asm\55
@@ -494,6 +542,18 @@
0
0
+
+ 1
+ 5
+ 2
+ 0
+ 0
+ 0
+ .\Mire.asm
+ Mire.asm
+ 0
+ 0
+
@@ -504,7 +564,7 @@
0
2
- 5
+ 6
4
0
0
diff --git a/Etape_3.uvprojx b/Etape_3.uvprojx
index 3ece9ec..4f07e48 100644
--- a/Etape_3.uvprojx
+++ b/Etape_3.uvprojx
@@ -403,6 +403,11 @@
2
.\FonctionEtape3.asm
+
+ Mire.asm
+ 2
+ .\Mire.asm
+
@@ -820,6 +825,11 @@
2
.\FonctionEtape3.asm
+
+ Mire.asm
+ 2
+ .\Mire.asm
+
diff --git a/FonctionEtape3.asm b/FonctionEtape3.asm
index b237f63..6bd2564 100644
--- a/FonctionEtape3.asm
+++ b/FonctionEtape3.asm
@@ -13,7 +13,11 @@
IMPORT DataSend
EXPORT Init_TVI
+ IMPORT Stop_Timer4
+ IMPORT Run_Timer4
+ IMPORT mire
EXPORT Timer1_IRQHandler
+ EXPORT Timer1Up_IRQHandler
EXPORT setIRQFunction
IMPORT DriverReg
@@ -48,6 +52,7 @@ TVI_Flash EQU 0x0
Timer1_IRQHandler PROC
PUSH {LR}
+ BL Run_Timer4
LDR R2,=SwitchState ;On lit l'adresse de switch state
LDRB R3,[R2] ;On charge la donnée
CMP R3, #0 ;if(Switchstate == 0)
@@ -63,10 +68,22 @@ SETBarrette1
STRB R3,[R2] ;On remet la donnée
GoToDriverReg
BL DriverReg ;DriverReg(Barette3)
- LDR R0,=TIM1_SR
- LDR R1, [R0]
- AND R1, #~(1<<1)
- STR R1, [R0]
+ LDR R0,=TIM1_SR ;On charge l'adresse du flag
+ LDR R1, [R0] ;On lit le flag dans SR
+ AND R1, #~(1<<1) ;Reset le flag du SR
+ STR R1, [R0] ;On le stock
+ BL Stop_Timer4
+ POP {LR}
+ BX LR
+ ENDP
+
+Timer1Up_IRQHandler PROC
+ PUSH {LR}
+ BL Stop_Timer4
+ LDR R0,=TIM1_SR ;On charge l'adresse du flag
+ LDR R1, [R0] ;On lit le flag dans SR
+ AND R1, #~(1<<0) ;Reset le flag du SR
+ STR R1, [R0] ;On le stock
POP {LR}
BX LR
ENDP
diff --git a/Mire.asm b/Mire.asm
new file mode 100644
index 0000000..683bc21
--- /dev/null
+++ b/Mire.asm
@@ -0,0 +1,68 @@
+;************************************************************************
+ THUMB
+ REQUIRE8
+ PRESERVE8
+;************************************************************************
+
+
+;**************************************
+; Affectation des bits GPIO
+;***************************************
+; GSLCK..... PA0
+; DSPRG..... PA1
+; BLANK..... PA2
+; XLAT...... PA3
+; VPRG...... PA4
+; SCLK...... PA5
+; SIN1...... PA7
+;Capteur.....PA8
+
+;LED.........PB10
+;****************************************/
+
+
+;***************CONSTANTES*************************************************
+
+
+Nbsecteurs equ 8
+PuissanceNbSecteur equ 3
+
+
+
+
+
+;************************************************************************
+; IMPORT/EXPORT Système
+;************************************************************************
+
+ IMPORT ||Lib$$Request$$armlib|| [CODE,WEAK]
+
+
+; IMPORT/EXPORT de procédure
+
+
+
+ EXPORT mire
+
+;*******************************************************************************
+
+
+;*******************************************************************************
+ AREA mesdonnees, data, readonly
+
+
+
+mire DCB 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0, 255,0,0
+ DCB 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0, 0,255,0
+ DCB 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255
+ DCB 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0, 255,255,0
+ DCB 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255, 255,0,255
+ DCB 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255
+ DCB 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255, 255,255,255
+ DCB 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5, 5,5,5
+
+
+
+
+;*******************************************************************************
+ END
\ No newline at end of file
diff --git a/Principale.asm b/Principale.asm
index 4b16523..6aa9ec0 100644
--- a/Principale.asm
+++ b/Principale.asm
@@ -42,6 +42,7 @@
IMPORT Init_TVI
IMPORT Timer1_IRQHandler
+ IMPORT Timer1Up_IRQHandler
IMPORT setIRQFunction
EXPORT main
@@ -60,12 +61,15 @@ Timer_Cc_Reg EQU (27*4)+0x40
;*******************************************************************************
main PROC
;*******************************************************************************
+ BL Init_TVI;
MOV R0,#2
BL Init_Cible;
;*******************************************************************************
; ETAPE 3
;*******************************************************************************
- BL Init_TVI;
+ MOV R0, #Timer_Up_Reg
+ LDR R1,=Timer1Up_IRQHandler
+ BL setIRQFunction
MOV R0, #Timer_Cc_Reg
LDR R1,=Timer1_IRQHandler
BL setIRQFunction