forked from acco/chti23
TP2 non fini
This commit is contained in:
parent
951b575884
commit
739aba2f09
4 changed files with 105 additions and 34 deletions
|
@ -10,7 +10,7 @@
|
||||||
<aExt>*.s*; *.src; *.a*</aExt>
|
<aExt>*.s*; *.src; *.a*</aExt>
|
||||||
<oExt>*.obj; *.o</oExt>
|
<oExt>*.obj; *.o</oExt>
|
||||||
<lExt>*.lib</lExt>
|
<lExt>*.lib</lExt>
|
||||||
<tExt>*.txt; *.h; *.inc</tExt>
|
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||||
<pExt>*.plm</pExt>
|
<pExt>*.plm</pExt>
|
||||||
<CppX>*.cpp</CppX>
|
<CppX>*.cpp</CppX>
|
||||||
<nMigrate>0</nMigrate>
|
<nMigrate>0</nMigrate>
|
||||||
|
@ -153,7 +153,55 @@
|
||||||
<Name>-U066CFF574857847167074929 -O2254 -S0 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM)</Name>
|
<Name>-U066CFF574857847167074929 -O2254 -S0 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM)</Name>
|
||||||
</SetRegEntry>
|
</SetRegEntry>
|
||||||
</TargetDriverDllRegistry>
|
</TargetDriverDllRegistry>
|
||||||
<Breakpoint/>
|
<Breakpoint>
|
||||||
|
<Bp>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Type>0</Type>
|
||||||
|
<LineNumber>22</LineNumber>
|
||||||
|
<EnabledFlag>1</EnabledFlag>
|
||||||
|
<Address>134220300</Address>
|
||||||
|
<ByteObject>0</ByteObject>
|
||||||
|
<HtxType>0</HtxType>
|
||||||
|
<ManyObjects>0</ManyObjects>
|
||||||
|
<SizeOfObject>0</SizeOfObject>
|
||||||
|
<BreakByAccess>0</BreakByAccess>
|
||||||
|
<BreakIfRCount>1</BreakIfRCount>
|
||||||
|
<Filename>.\Src\principal.c</Filename>
|
||||||
|
<ExecCommand></ExecCommand>
|
||||||
|
<Expression>\\BacASable\Src/principal.c\22</Expression>
|
||||||
|
</Bp>
|
||||||
|
<Bp>
|
||||||
|
<Number>1</Number>
|
||||||
|
<Type>0</Type>
|
||||||
|
<LineNumber>56</LineNumber>
|
||||||
|
<EnabledFlag>1</EnabledFlag>
|
||||||
|
<Address>134220362</Address>
|
||||||
|
<ByteObject>0</ByteObject>
|
||||||
|
<HtxType>0</HtxType>
|
||||||
|
<ManyObjects>0</ManyObjects>
|
||||||
|
<SizeOfObject>0</SizeOfObject>
|
||||||
|
<BreakByAccess>0</BreakByAccess>
|
||||||
|
<BreakIfRCount>1</BreakIfRCount>
|
||||||
|
<Filename>.\Src\Cligno.s</Filename>
|
||||||
|
<ExecCommand></ExecCommand>
|
||||||
|
<Expression>\\BacASable\Src/Cligno.s\56</Expression>
|
||||||
|
</Bp>
|
||||||
|
</Breakpoint>
|
||||||
|
<WatchWindow1>
|
||||||
|
<Ww>
|
||||||
|
<count>0</count>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<ItemText>FlagCligno</ItemText>
|
||||||
|
</Ww>
|
||||||
|
</WatchWindow1>
|
||||||
|
<MemoryWindow1>
|
||||||
|
<Mm>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<SubType>0</SubType>
|
||||||
|
<ItemText>r1</ItemText>
|
||||||
|
<AccSizeX>0</AccSizeX>
|
||||||
|
</Mm>
|
||||||
|
</MemoryWindow1>
|
||||||
<Tracepoint>
|
<Tracepoint>
|
||||||
<THDelay>0</THDelay>
|
<THDelay>0</THDelay>
|
||||||
</Tracepoint>
|
</Tracepoint>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<TargetName>Simu</TargetName>
|
<TargetName>Simu</TargetName>
|
||||||
<ToolsetNumber>0x4</ToolsetNumber>
|
<ToolsetNumber>0x4</ToolsetNumber>
|
||||||
<ToolsetName>ARM-ADS</ToolsetName>
|
<ToolsetName>ARM-ADS</ToolsetName>
|
||||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||||
<uAC6>0</uAC6>
|
<uAC6>0</uAC6>
|
||||||
<TargetOption>
|
<TargetOption>
|
||||||
<TargetCommonOption>
|
<TargetCommonOption>
|
||||||
|
@ -357,7 +357,7 @@
|
||||||
<MiscControls></MiscControls>
|
<MiscControls></MiscControls>
|
||||||
<Define></Define>
|
<Define></Define>
|
||||||
<Undefine></Undefine>
|
<Undefine></Undefine>
|
||||||
<IncludePath></IncludePath>
|
<IncludePath>.\Driver</IncludePath>
|
||||||
</VariousControls>
|
</VariousControls>
|
||||||
</Aads>
|
</Aads>
|
||||||
<LDads>
|
<LDads>
|
||||||
|
@ -1338,11 +1338,6 @@
|
||||||
<Layers>
|
<Layers>
|
||||||
<Layer>
|
<Layer>
|
||||||
<LayName><Project Info></LayName>
|
<LayName><Project Info></LayName>
|
||||||
<LayDesc></LayDesc>
|
|
||||||
<LayUrl></LayUrl>
|
|
||||||
<LayKeys></LayKeys>
|
|
||||||
<LayCat></LayCat>
|
|
||||||
<LayLic></LayLic>
|
|
||||||
<LayTarg>0</LayTarg>
|
<LayTarg>0</LayTarg>
|
||||||
<LayPrjMark>1</LayPrjMark>
|
<LayPrjMark>1</LayPrjMark>
|
||||||
</Layer>
|
</Layer>
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
THUMB
|
THUMB
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ====================== zone de réservation de données, ======================================
|
; ====================== zone de réservation de données, ======================================
|
||||||
;Section RAM (read only) :
|
;Section RAM (read only) :
|
||||||
area mesdata,data,readonly
|
area mesdata,data,readonly
|
||||||
|
@ -10,21 +14,59 @@
|
||||||
;Section RAM (read write):
|
;Section RAM (read write):
|
||||||
area maram,data,readwrite
|
area maram,data,readwrite
|
||||||
|
|
||||||
|
FlagCligno dcb 0
|
||||||
|
|
||||||
|
EXPORT FlagCligno
|
||||||
|
|
||||||
; ===============================================================================================
|
; ===============================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
;constantes (équivalent du #define en C)
|
||||||
|
;char FlagCligno;
|
||||||
|
EXPORT timer_callback ; la fonction timer_callback est rendue publique donc utilisable par d'autres modules.
|
||||||
|
|
||||||
|
|
||||||
;Section ROM code (read only) :
|
;Section ROM code (read only) :
|
||||||
area moncode,code,readonly
|
area moncode,code,readonly
|
||||||
; écrire le code ici
|
; écrire le code ici
|
||||||
|
|
||||||
|
;*void timer_callback(void)
|
||||||
|
;{
|
||||||
|
; if (FlagCligno==1)
|
||||||
|
; {
|
||||||
|
; FlagCligno=0;
|
||||||
|
; GPIOB_Set(1);
|
||||||
|
; }
|
||||||
|
; else
|
||||||
|
; {
|
||||||
|
; FlagCligno=1;
|
||||||
|
; GPIOB_Clear(1);
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
include DriverJeuLaser.inc
|
||||||
|
|
||||||
|
timer_callback proc
|
||||||
|
|
||||||
|
ldr r1,=FlagCligno ;
|
||||||
|
|
||||||
|
cmp r1,#0x1 ; si r1(FlagCligno) == 1, on continue.
|
||||||
|
bne L0 ; sinon break to L0
|
||||||
|
mov r2, #0x0 ; copie valeur "0" dans r2
|
||||||
|
str r2, [r1] ; la valeur 32bits contenue dans r2 est copiée en RAM à l'adresse spécifiée dans r1
|
||||||
|
mov r0, #1 ; GPIOB_Set(r0 = "1")
|
||||||
|
bl GPIOB_Set
|
||||||
|
bx lr
|
||||||
|
|
||||||
|
L0
|
||||||
|
mov r2, #0x1
|
||||||
|
str r2, [r1]
|
||||||
|
mov r0, #1 ; GPIOB_Clear("1")
|
||||||
|
bl GPIOB_Clear
|
||||||
|
|
||||||
|
bx lr
|
||||||
|
endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
END
|
END
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
#include "DriverJeuLaser.h"
|
#include "DriverJeuLaser.h"
|
||||||
|
|
||||||
void timer_callback(void);
|
extern void timer_callback(void);
|
||||||
|
extern char FlagCligno;
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
@ -17,11 +18,12 @@ CLOCK_Configure();
|
||||||
// configuration du Timer 4 en débordement 100ms
|
// configuration du Timer 4 en débordement 100ms
|
||||||
|
|
||||||
//** Placez votre code là ** //
|
//** 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
|
||||||
|
// Association de la fonction à exécuter lors de l'interruption : timer_callback
|
||||||
// Activation des interruptions issues du Timer 4
|
|
||||||
// Association de la fonction à exécuter lors de l'interruption : timer_callback
|
|
||||||
// cette fonction (si écrite en ASM) doit être conforme à l'AAPCS
|
// cette fonction (si écrite en ASM) doit être conforme à l'AAPCS
|
||||||
|
|
||||||
//** Placez votre code là ** //
|
//** Placez votre code là ** //
|
||||||
|
@ -42,20 +44,4 @@ while (1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char FlagCligno;
|
|
||||||
|
|
||||||
void timer_callback(void)
|
|
||||||
{
|
|
||||||
if (FlagCligno==1)
|
|
||||||
{
|
|
||||||
FlagCligno=0;
|
|
||||||
GPIOB_Set(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FlagCligno=1;
|
|
||||||
GPIOB_Clear(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue