fin séance

This commit is contained in:
Clement Mauperon 2023-03-21 18:18:30 +01:00
parent 672b04586b
commit dbe899586d
4 changed files with 146 additions and 24 deletions

View file

@ -10,21 +10,57 @@
;Section RAM (read write):
area maram,data,readwrite
SortieSon dcw 0
Index dcb 0
ResolutionEntree equ 32768
ResolutionSortie equ 720
; ===============================================================================================
IMPORT Son
IMPORT LongueurSon
EXPORT SortieSon
EXPORT CallbackSon
EXPORT Index
;Section ROM code (read only) :
area moncode,code,readonly
; écrire le code ici
CallbackSon proc
; int* indexAdress = &Index
ldr r5,=Index
; int index = *indexAdress
ldr r6,[r5]
; if (index < LongueurSon) return;
ldr r7,=LongueurSon
ldr r7,[r7]
cmp r6,r7
blt LireEchantillon
bx lr
LireEchantillon
; long* son = &Son
ldr r7,=Son
; long echantillon = son[index]
ldr r7,[r6]
; index += 1
add r6,r6,#1
; *indexAdresse = index
str r6,[r5]
; int resolutionEntree = ResolutionEntree
ldr r5,=ResolutionEntree
; son = son + ResolutionEntree
adds r7,r7,r5
; int resolutionSortie = ResolutionSortie
ldr r5,=ResolutionSortie
; son = son / resolutionSortie
sdiv r7,r7,r5
; long* sortieSon = &SortieSon
ldr r5,=SortieSon
; *sortieSon = son
str r7,[r5]
bx lr
endp
END

View file

@ -2,7 +2,10 @@
#include "DriverJeuLaser.h"
#define CLOCK_FREQ 72000 // kHz
extern int PeriodeSonMicroSec;
extern void CallbackSon(void);
int main(void)
{
@ -15,9 +18,13 @@ int main(void)
CLOCK_Configure();
Timer_1234_Init_ff(TIM4, PeriodeSonMicroSec * CLOCK_FREQ);
GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL);
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
//============================================================================

View file

@ -10,7 +10,7 @@
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<tExt>*.txt; *.h; *.inc; *.md</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
@ -75,7 +75,7 @@
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>0</IsCurrentTarget>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<DebugOpt>
@ -154,6 +154,14 @@
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<MemoryWindow1>
<Mm>
<WinNumber>1</WinNumber>
<SubType>0</SubType>
<ItemText>0x08000A38</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow1>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
@ -174,7 +182,7 @@
<AscS3>0</AscS3>
<aSer3>0</aSer3>
<eProf>0</eProf>
<aLa>0</aLa>
<aLa>1</aLa>
<aPa1>0</aPa1>
<AscS4>0</AscS4>
<aSer4>0</aSer4>
@ -199,8 +207,13 @@
<LogicAnalyzers>
<Wi>
<IntNumber>0</IntNumber>
<FirstString>((portb &amp; 0x00000002) &gt;&gt; 1 &amp; 0x2) &gt;&gt; 1</FirstString>
<SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F160000000000000000000000000000000000000096020008</SecondString>
<FirstString>`SortieSon</FirstString>
<SecondString>008000000000000000000000000000000000894000000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000001000000000000000000E03F17000000000000000000000000000000000000009C090008</SecondString>
</Wi>
<Wi>
<IntNumber>1</IntNumber>
<FirstString>`Index</FirstString>
<SecondString>008000000000000000000000000000000070B74000000000000000000000000000000000496E6465780000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000002000000000000000000E03F17000000000000000000000000000000000000009C090008</SecondString>
</Wi>
</LogicAnalyzers>
<DebugDescription>
@ -460,7 +473,7 @@
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
<IsCurrentTarget>0</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<DebugOpt>
@ -538,7 +551,24 @@
<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>
</TargetDriverDllRegistry>
<Breakpoint/>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>27</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>.\Src\GestionSon.s</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<MemoryWindow1>
<Mm>
<WinNumber>1</WinNumber>
@ -624,6 +654,30 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>2</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>1</GroupNumber>
<FileNumber>3</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>
@ -634,7 +688,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>2</FileNumber>
<FileNumber>4</FileNumber>
<FileType>2</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -654,7 +708,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>3</FileNumber>
<FileNumber>5</FileNumber>
<FileType>4</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>

View file

@ -10,7 +10,7 @@
<TargetName>Simu</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<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>
<TargetOption>
<TargetCommonOption>
@ -388,6 +388,16 @@
<FileType>1</FileType>
<FilePath>.\Src\principal.c</FilePath>
</File>
<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>
@ -797,6 +807,16 @@
<FileType>1</FileType>
<FilePath>.\Src\principal.c</FilePath>
</File>
<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>
@ -897,7 +917,7 @@
<TargetName>CibleSondeST</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<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>
<TargetOption>
<TargetCommonOption>
@ -1275,6 +1295,16 @@
<FileType>1</FileType>
<FilePath>.\Src\principal.c</FilePath>
</File>
<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>
@ -1323,11 +1353,6 @@
<Layers>
<Layer>
<LayName>&lt;Project Info&gt;</LayName>
<LayDesc></LayDesc>
<LayUrl></LayUrl>
<LayKeys></LayKeys>
<LayCat></LayCat>
<LayLic></LayLic>
<LayTarg>0</LayTarg>
<LayPrjMark>1</LayPrjMark>
</Layer>