;*************************************************************************** THUMB REQUIRE8 PRESERVE8 ;************************************************************************** ; Fichier Vierge.asm ; Auteur : V.MAHOUT ; Date : 12/11/2013 ;************************************************************************** ;***************IMPORT/EXPORT********************************************** IMPORT DataSend EXPORT Init_TVI EXPORT Timer1_IRQHandler EXPORT setIRQFunction IMPORT DriverReg IMPORT Tempo ;************************************************************************** ;***************CONSTANTES************************************************* include REG_UTILES.inc include LUMIERES.inc ;************************************************************************** ;***************VARIABLES************************************************** AREA MesDonnees, data, readwrite ;************************************************************************** MAX_Interrupt EQU 256 TVI_Flash EQU 0x0 ;************************************************************************** ;***************CODE******************************************************* AREA moncode, code, readonly ;************************************************************************** Timer1_IRQHandler PROC PUSH {LR} LDRB R2,=SwitchState LDRB R3,[R2] CMP R3, #0 BEQ SETBarrette1 SETBarrette2 LDR R0, =Barette2 ;Adresse Jeu de led 2 : Argument SETBarrette1 LDR R0, =Barette1 ;Adresse Jeu de led 1 : Argument BL DriverReg ;DriverReg(Barette3) LDR R0,=TIM1_SR LDR R1, [R0] AND R1, #~(1<<1) STR R1, [R0] POP {LR} BX LR ENDP ;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 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 Interruption ;R1 -> Adresse de la fonction ;******************************************************************* setIRQFunction PROC LDR R3,=TVI_Pile ADD R0,R0,R3 STR R1, [R0] BX LR ENDP ;************************************************************************** END