Etape 3 #1
4 changed files with 67 additions and 26 deletions
|
@ -219,12 +219,44 @@
|
||||||
<ExecCommand></ExecCommand>
|
<ExecCommand></ExecCommand>
|
||||||
<Expression>\\Simu_Etape0\FonctionEtape3.asm\51</Expression>
|
<Expression>\\Simu_Etape0\FonctionEtape3.asm\51</Expression>
|
||||||
</Bp>
|
</Bp>
|
||||||
|
<Bp>
|
||||||
|
<Number>5</Number>
|
||||||
|
<Type>0</Type>
|
||||||
|
<LineNumber>58</LineNumber>
|
||||||
|
<EnabledFlag>1</EnabledFlag>
|
||||||
|
<Address>0</Address>
|
||||||
|
<ByteObject>0</ByteObject>
|
||||||
|
<HtxType>0</HtxType>
|
||||||
|
<ManyObjects>0</ManyObjects>
|
||||||
|
<SizeOfObject>0</SizeOfObject>
|
||||||
|
<BreakByAccess>0</BreakByAccess>
|
||||||
|
<BreakIfRCount>0</BreakIfRCount>
|
||||||
|
<Filename>.\FonctionEtape3.asm</Filename>
|
||||||
|
<ExecCommand></ExecCommand>
|
||||||
|
<Expression></Expression>
|
||||||
|
</Bp>
|
||||||
|
<Bp>
|
||||||
|
<Number>6</Number>
|
||||||
|
<Type>0</Type>
|
||||||
|
<LineNumber>68</LineNumber>
|
||||||
|
<EnabledFlag>1</EnabledFlag>
|
||||||
|
<Address>0</Address>
|
||||||
|
<ByteObject>0</ByteObject>
|
||||||
|
<HtxType>0</HtxType>
|
||||||
|
<ManyObjects>0</ManyObjects>
|
||||||
|
<SizeOfObject>0</SizeOfObject>
|
||||||
|
<BreakByAccess>0</BreakByAccess>
|
||||||
|
<BreakIfRCount>0</BreakIfRCount>
|
||||||
|
<Filename>.\FonctionEtape3.asm</Filename>
|
||||||
|
<ExecCommand></ExecCommand>
|
||||||
|
<Expression></Expression>
|
||||||
|
</Bp>
|
||||||
</Breakpoint>
|
</Breakpoint>
|
||||||
<MemoryWindow1>
|
<MemoryWindow1>
|
||||||
<Mm>
|
<Mm>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<SubType>0</SubType>
|
<SubType>0</SubType>
|
||||||
<ItemText>0xE000ED08</ItemText>
|
<ItemText>0x20000200</ItemText>
|
||||||
<AccSizeX>0</AccSizeX>
|
<AccSizeX>0</AccSizeX>
|
||||||
</Mm>
|
</Mm>
|
||||||
</MemoryWindow1>
|
</MemoryWindow1>
|
||||||
|
|
|
@ -92,12 +92,11 @@ Allume_LED PROC
|
||||||
; On inverse la LED (besoin de R0)
|
; On inverse la LED (besoin de R0)
|
||||||
;*******************************************************************************
|
;*******************************************************************************
|
||||||
Inverse_LED PROC
|
Inverse_LED PROC
|
||||||
PUSH {R12,R0} ;On stocke R12 dans R0
|
PUSH {R12,R5} ;R12 et R5 sont mis dans la pile
|
||||||
LDR R12,=GPIOBASEB ;On recupère l'adresse de base
|
LDR R12,=GPIOBASEB ;On recupère l'adresse de base
|
||||||
|
LDR R1,=isLedOn ;On recupère l'adresse de isLedOn
|
||||||
MOV R5,#(0x01 << 10) ;1 décalé de 10 dans R5
|
MOV R5,#(0x01 << 10) ;1 décalé de 10 dans R5
|
||||||
CMP R0,#0 ;Si R3=0 (default) alors on allume, sinon on eteint
|
CMP R0,#0 ;Si R3=0 (default) alors on allume, sinon on eteint
|
||||||
;BEQ Allume
|
|
||||||
;B Eteint
|
|
||||||
BNE Eteint
|
BNE Eteint
|
||||||
Allume
|
Allume
|
||||||
STRH R5,[R12,#OffsetSet] ;On stocke la variable R5 à l'adresse 0x0X40010C10 (set)
|
STRH R5,[R12,#OffsetSet] ;On stocke la variable R5 à l'adresse 0x0X40010C10 (set)
|
||||||
|
@ -110,8 +109,8 @@ Eteint
|
||||||
|
|
||||||
|
|
||||||
Fin
|
Fin
|
||||||
POP {R12,R0} ;On restitue R12 dans R0
|
POP {R12,R5} ;On restitue R12
|
||||||
BX LR ;Retour
|
BX LR ;Retour
|
||||||
|
|
||||||
ENDP
|
ENDP
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
AREA MesDonnees, data, readwrite
|
AREA MesDonnees, data, readwrite
|
||||||
;**************************************************************************
|
;**************************************************************************
|
||||||
|
|
||||||
Timer_Up_Reg EQU 25
|
Timer_Up_Reg EQU 25+0x40
|
||||||
Timer_Cc_Reg EQU 27
|
Timer_Cc_Reg EQU 27+0x40
|
||||||
MAX_Interrupt EQU 256
|
MAX_Interrupt EQU 256
|
||||||
TVI_Flash EQU 0x0
|
TVI_Flash EQU 0x0
|
||||||
TVI_Pile EQU 0x20000200 ;9 bits de poids faible = 0
|
TVI_Pile EQU 0x20000200 ;9 bits de poids faible = 0
|
||||||
|
@ -44,26 +44,34 @@ TVI_Pile EQU 0x20000200 ;9 bits de poids faible = 0
|
||||||
AREA moncode, code, readonly
|
AREA moncode, code, readonly
|
||||||
;**************************************************************************
|
;**************************************************************************
|
||||||
|
|
||||||
|
scbvector_link PROC
|
||||||
|
LDR R1,=TVI_Pile ;On relit l'adresse de TVIPile
|
||||||
|
LDR R0,=SCB_VTOR ;ON lit l'adresse de SCB_VTOR
|
||||||
|
STR R1,[R0] ;On met l'adresse de TVI_Pile dans le SCB_VTOR
|
||||||
|
BX LR
|
||||||
|
ENDP
|
||||||
|
|
||||||
|
Timer1_IRQHandler PROC
|
||||||
|
|
||||||
|
|
||||||
|
;On copie toute la TVI dans la RAM (0x2....)
|
||||||
|
;On modifie les interruptions Up et CC pour pointer sur nos fonctions rien qu'à nous
|
||||||
|
;On fait pointer à SCB_VTOR l'adresse de la TVI que nous avons copié
|
||||||
Init_TVI PROC
|
Init_TVI PROC
|
||||||
;On copie toute la TVI dans la RAM (0x2....)
|
LDR R0,=TVI_Flash ;On Lit le premier TVI
|
||||||
;On modifie les interruptions Up et CC pour pointer sur nos fonctions rien qu'à nous
|
LDR R1,=TVI_Pile ;Nouvelle TVI
|
||||||
;On fait pointer à SCB_VTOR l'adresse de la TVI que nous avons copié
|
MOV R2,#0 ;i
|
||||||
LDR R0,=TVI_Flash ;On Lit le premier TVI
|
|
||||||
LDR R1,=TVI_Pile ;Nouvelle TVI
|
|
||||||
MOV R2,#0 ;i
|
|
||||||
for_tvi ;for(int i=0;i<MAX_Interrupt;i++)
|
for_tvi ;for(int i=0;i<MAX_Interrupt;i++)
|
||||||
LDR R3,[R0] ;temp = TVI_Flash[i]
|
LDR R3,[R0] ;temp = TVI_Flash[i]
|
||||||
STR R3, [R1] ;TVI_Pile[i] = temp
|
STR R3, [R1] ;TVI_Pile[i] = temp
|
||||||
ADD R1,R1,#4 ;TVI_Pile++
|
ADD R1,R1,#4 ;TVI_Pile++
|
||||||
ADD R0,R0,#4 ;TVI_Flash++
|
ADD R0,R0,#4 ;TVI_Flash++
|
||||||
ADD R2,R2,#1 ;i++
|
ADD R2,R2,#1 ;i++
|
||||||
CMP R2,#MAX_Interrupt ;is i == MAX_Interrupt?
|
CMP R2,#MAX_Interrupt ;is i == MAX_Interrupt?
|
||||||
BNE for_tvi
|
BNE for_tvi
|
||||||
scbvector_link
|
|
||||||
LDR R1,=TVI_Pile ;On relit l'adresse de TVIPile
|
BL scbvector_link ;Mets à jour SCB_VTOR avec TVI_Pile
|
||||||
LDR R0,=SCB_VTOR ;ON lit l'adresse de SCB_VTOR
|
|
||||||
STR R1,[R0] ;On met l'adresse de TVI_Pile dans le SCB_VTOR
|
|
||||||
|
|
||||||
ENDP
|
ENDP
|
||||||
;**************************************************************************
|
;**************************************************************************
|
||||||
END
|
END
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
AREA MesDonnees, data, readwrite
|
AREA MesDonnees, data, readwrite
|
||||||
;**************************************************************************
|
;**************************************************************************
|
||||||
|
|
||||||
|
isLedOn DCB 0x00
|
||||||
|
|
||||||
Barette1 DCB 0xff,0x00,0x0
|
Barette1 DCB 0xff,0x00,0x0
|
||||||
DCB 0xff,0x00,0x0
|
DCB 0xff,0x00,0x0
|
||||||
DCB 0xff,0x00,0x0
|
DCB 0xff,0x00,0x0
|
||||||
|
|
Loading…
Add table
Reference in a new issue