Début son, à finir

This commit is contained in:
Marie Brunetto 2023-04-07 15:16:03 +02:00
parent 9dbcbf0005
commit ac5d9f74b4
7 changed files with 160 additions and 35 deletions

View file

@ -75,7 +75,7 @@
<OPTFL> <OPTFL>
<tvExp>1</tvExp> <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget> <IsCurrentTarget>0</IsCurrentTarget>
</OPTFL> </OPTFL>
<CpuCode>18</CpuCode> <CpuCode>18</CpuCode>
<DebugOpt> <DebugOpt>
@ -272,7 +272,7 @@
<OPTFL> <OPTFL>
<tvExp>1</tvExp> <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>0</IsCurrentTarget> <IsCurrentTarget>1</IsCurrentTarget>
</OPTFL> </OPTFL>
<CpuCode>18</CpuCode> <CpuCode>18</CpuCode>
<DebugOpt> <DebugOpt>
@ -379,7 +379,7 @@
<AscS3>0</AscS3> <AscS3>0</AscS3>
<aSer3>0</aSer3> <aSer3>0</aSer3>
<eProf>0</eProf> <eProf>0</eProf>
<aLa>0</aLa> <aLa>1</aLa>
<aPa1>0</aPa1> <aPa1>0</aPa1>
<AscS4>0</AscS4> <AscS4>0</AscS4>
<aSer4>0</aSer4> <aSer4>0</aSer4>

View file

@ -424,7 +424,7 @@
<TargetName>CibleSondeKEIL</TargetName> <TargetName>CibleSondeKEIL</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>

View file

@ -1,7 +1,7 @@
PRESERVE8 PRESERVE8
THUMB THUMB
include DriverJeuLaser.inc include Driver/DriverJeuLaser.inc
; ====================== zone de réservation de données, ====================================== ; ====================== zone de réservation de données, ======================================
;Section RAM (read only) : ;Section RAM (read only) :
@ -23,22 +23,24 @@ FlagCligno dcd 0
; écrire le code ici ; écrire le code ici
timer_callback proc timer_callback proc
push lr push {lr}
mov r0,#1 ; r0 : constant = 1 (arg fonct GPIOB) mov r0,#1 ; r0 : constant = 1 (arg fonct GPIOB)
ldr r2,=FlagCligno ; r2 : addr de FlagCligno ldr r2,=FlagCligno ; r2 : addr de FlagCligno
mov r1,[r2] ; r1 : valeur FlagCligno ldr r1,[r2] ; r1 : valeur FlagCligno
cmp r1,#0 cmp r1,#0
beq FC0 beq FC0
; if FlagCligno == 1 ; if FlagCligno == 1
str #0,[r2] mov r3,#0
str r3,[r2]
bl GPIOB_Set bl GPIOB_Set
b fin b fin
; if FlagCligno == 0 ; if FlagCligno == 0
FC0 FC0
mov r3,#1
str r3,[r2] str r3,[r2]
bl GPIOB_Clear bl GPIOB_Clear
fin fin
pop pc pop {pc}
endp endp
END END

View file

@ -1,6 +1,7 @@
PRESERVE8 PRESERVE8
THUMB THUMB
include Driver/DriverJeuLaser.inc
; ====================== zone de réservation de données, ====================================== ; ====================== zone de réservation de données, ======================================
;Section RAM (read only) : ;Section RAM (read only) :
@ -10,18 +11,52 @@
;Section RAM (read write): ;Section RAM (read write):
area maram,data,readwrite area maram,data,readwrite
SortieSon dcw 0
Index dcw 0
; =============================================================================================== ; ===============================================================================================
EXPORT SortieSon
EXPORT CallbackSon
IMPORT Son
IMPORT LongueurSon
;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
CallbackSon proc
push {lr}
ldr r3,=Index
ldr r1,[r3]
ldr r0,=LongueurSon
ldr r2,[r0]
cmp r1,r2
beq FinSig
bge Fin
; if index < longueur son
ldr r2,=Son ; r2 = @ debut son
ldr r0,[r2,r1]
add r0,#32768
mov r2,#720
mul r0,r2
lsr r0,#16
ldr r2,=SortieSon
str r0,[r2]
add r1,#1
str r1,[r3]
b Fin
;if index = longueurSon
FinSig
mov r0,#0
ldr r2,=SortieSon
str r0,[r2]
add r1,#1
str r1,[r3]
; if index > longueurson
Fin
pop {pc}
endp

View file

@ -2,7 +2,7 @@
#include "DriverJeuLaser.h" #include "DriverJeuLaser.h"
void CallbackSon(void);
int main(void) int main(void)
{ {
@ -14,10 +14,11 @@ int main(void)
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers // Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
CLOCK_Configure(); CLOCK_Configure();
Timer_1234_Init_ff( TIM4, 6552 );
Active_IT_Debordement_Timer( TIM4, 2, CallbackSon );
GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL);
//============================================================================ //============================================================================

View file

@ -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>
@ -75,7 +75,7 @@
<OPTFL> <OPTFL>
<tvExp>1</tvExp> <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>0</IsCurrentTarget> <IsCurrentTarget>1</IsCurrentTarget>
</OPTFL> </OPTFL>
<CpuCode>18</CpuCode> <CpuCode>18</CpuCode>
<DebugOpt> <DebugOpt>
@ -154,13 +154,28 @@
</SetRegEntry> </SetRegEntry>
</TargetDriverDllRegistry> </TargetDriverDllRegistry>
<Breakpoint/> <Breakpoint/>
<WatchWindow1>
<Ww>
<count>0</count>
<WinNumber>1</WinNumber>
<ItemText>SortieSon</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow1>
<Mm>
<WinNumber>1</WinNumber>
<SubType>257</SubType>
<ItemText>r0</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow1>
<Tracepoint> <Tracepoint>
<THDelay>0</THDelay> <THDelay>0</THDelay>
</Tracepoint> </Tracepoint>
<DebugFlag> <DebugFlag>
<trace>0</trace> <trace>0</trace>
<periodic>1</periodic> <periodic>1</periodic>
<aLwin>1</aLwin> <aLwin>0</aLwin>
<aCover>0</aCover> <aCover>0</aCover>
<aSer1>0</aSer1> <aSer1>0</aSer1>
<aSer2>0</aSer2> <aSer2>0</aSer2>
@ -199,8 +214,8 @@
<LogicAnalyzers> <LogicAnalyzers>
<Wi> <Wi>
<IntNumber>0</IntNumber> <IntNumber>0</IntNumber>
<FirstString>((portb &amp; 0x00000002) &gt;&gt; 1 &amp; 0x2) &gt;&gt; 1</FirstString> <FirstString>`SortieSon</FirstString>
<SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F160000000000000000000000000000000000000096020008</SecondString> <SecondString>0080000000000000000000000000E0FFFFFFEF4100000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F0A00000000000000000000000000000000000000080A0008</SecondString>
</Wi> </Wi>
</LogicAnalyzers> </LogicAnalyzers>
<DebugDescription> <DebugDescription>
@ -360,7 +375,7 @@
<DebugFlag> <DebugFlag>
<trace>0</trace> <trace>0</trace>
<periodic>1</periodic> <periodic>1</periodic>
<aLwin>1</aLwin> <aLwin>0</aLwin>
<aCover>0</aCover> <aCover>0</aCover>
<aSer1>0</aSer1> <aSer1>0</aSer1>
<aSer2>0</aSer2> <aSer2>0</aSer2>
@ -460,7 +475,7 @@
<OPTFL> <OPTFL>
<tvExp>1</tvExp> <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget> <IsCurrentTarget>0</IsCurrentTarget>
</OPTFL> </OPTFL>
<CpuCode>18</CpuCode> <CpuCode>18</CpuCode>
<DebugOpt> <DebugOpt>
@ -608,7 +623,7 @@
<Group> <Group>
<GroupName>Sources</GroupName> <GroupName>Sources</GroupName>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
@ -666,6 +681,38 @@
</File> </File>
</Group> </Group>
<Group>
<GroupName>Son</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>4</FileNumber>
<FileType>2</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\Src\bruitverre.asm</PathWithFileName>
<FilenameWithoutPath>bruitverre.asm</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>5</FileNumber>
<FileType>2</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\Src\GestionSon.s</PathWithFileName>
<FilenameWithoutPath>GestionSon.s</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group> <Group>
<GroupName>::CMSIS</GroupName> <GroupName>::CMSIS</GroupName>
<tvExp>0</tvExp> <tvExp>0</tvExp>

View file

@ -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>
@ -410,6 +410,21 @@
</File> </File>
</Files> </Files>
</Group> </Group>
<Group>
<GroupName>Son</GroupName>
<Files>
<File>
<FileName>bruitverre.asm</FileName>
<FileType>2</FileType>
<FilePath>.\Src\bruitverre.asm</FilePath>
</File>
<File>
<FileName>GestionSon.s</FileName>
<FileType>2</FileType>
<FilePath>.\Src\GestionSon.s</FilePath>
</File>
</Files>
</Group>
<Group> <Group>
<GroupName>::CMSIS</GroupName> <GroupName>::CMSIS</GroupName>
</Group> </Group>
@ -419,7 +434,7 @@
<TargetName>CibleSondeKEIL</TargetName> <TargetName>CibleSondeKEIL</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>
@ -819,6 +834,21 @@
</File> </File>
</Files> </Files>
</Group> </Group>
<Group>
<GroupName>Son</GroupName>
<Files>
<File>
<FileName>bruitverre.asm</FileName>
<FileType>2</FileType>
<FilePath>.\Src\bruitverre.asm</FilePath>
</File>
<File>
<FileName>GestionSon.s</FileName>
<FileType>2</FileType>
<FilePath>.\Src\GestionSon.s</FilePath>
</File>
</Files>
</Group>
<Group> <Group>
<GroupName>::CMSIS</GroupName> <GroupName>::CMSIS</GroupName>
<GroupOption> <GroupOption>
@ -897,7 +927,7 @@
<TargetName>CibleSondeST</TargetName> <TargetName>CibleSondeST</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>
@ -1297,6 +1327,21 @@
</File> </File>
</Files> </Files>
</Group> </Group>
<Group>
<GroupName>Son</GroupName>
<Files>
<File>
<FileName>bruitverre.asm</FileName>
<FileType>2</FileType>
<FilePath>.\Src\bruitverre.asm</FilePath>
</File>
<File>
<FileName>GestionSon.s</FileName>
<FileType>2</FileType>
<FilePath>.\Src\GestionSon.s</FilePath>
</File>
</Files>
</Group>
<Group> <Group>
<GroupName>::CMSIS</GroupName> <GroupName>::CMSIS</GroupName>
</Group> </Group>
@ -1322,12 +1367,7 @@
<LayerInfo> <LayerInfo>
<Layers> <Layers>
<Layer> <Layer>
<LayName>&lt;Project Info&gt;</LayName> <LayName>StepSon</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>