Step_Jeu_Son sans StartSon

This commit is contained in:
Marie Brunetto 2023-04-14 15:31:15 +02:00
parent ac5d9f74b4
commit 311f55db45
3 changed files with 138 additions and 17 deletions

View file

@ -17,14 +17,20 @@ Index dcw 0
; ===============================================================================================
EXPORT SortieSon
EXPORT CallbackSon
;EXPORT StartSon
IMPORT Son
IMPORT LongueurSon
IMPORT PWM_Set_Value_TIM3_Ch3
;Section ROM code (read only) :
area moncode,code,readonly
; écrire le code ici
CallbackSon proc
push {lr}
ldr r3,=Index
@ -36,29 +42,37 @@ CallbackSon proc
bge Fin
; if index < longueur son
ldr r2,=Son ; r2 = @ debut son
ldr r0,[r2,r1]
ldrsh r0,[r2,r1, LSL #1]
add r0,#32768
mov r2,#720
mul r0,r2
lsr r0,#16
lsr r0,#16 ; division par 65536
ldr r2,=SortieSon
str r0,[r2]
strh r0,[r2]
add r1,#1
str r1,[r3]
strh r1,[r3]
bl PWM_Set_Value_TIM3_Ch3
b Fin
;if index = longueurSon
FinSig
mov r0,#0
mov r0,#360
ldr r2,=SortieSon
str r0,[r2]
strh r0,[r2]
add r1,#1
str r1,[r3]
strh r1,[r3]
bl PWM_Set_Value_TIM3_Ch3
; if index > longueurson
Fin
pop {pc}
endp
;StartSon proc
; push {lr}
; ldr r3,=Index
; mov r1, #0
; strh r1,[r3]
; pop {pc}

View file

@ -1,9 +1,10 @@
#include "DriverJeuLaser.h"
void CallbackSon(void);
//void StartSon(void);
int main(void)
{
@ -12,18 +13,39 @@ int main(void)
// ===========================================================================
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
/*
CLOCK_Configure();
Timer_1234_Init_ff( TIM4, 6552 );
Active_IT_Debordement_Timer( TIM4, 2, CallbackSon );
GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL);
*/
//-----------------------------------------------------------------
CLOCK_Configure();
PWM_Init_ff( TIM3, 3, 720 );
Timer_1234_Init_ff( TIM4, 6552 );
Active_IT_Debordement_Timer( TIM4, 2, CallbackSon );
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL);
//============================================================================
while (1)
{
/*
for(int i = 0; i<99999; i++)
{
StartSon();
}*/
}
}

View file

@ -158,14 +158,29 @@
<Ww>
<count>0</count>
<WinNumber>1</WinNumber>
<ItemText>SortieSon</ItemText>
<ItemText>r0,0x0A</ItemText>
</Ww>
<Ww>
<count>1</count>
<WinNumber>1</WinNumber>
<ItemText>r1,0x0A</ItemText>
</Ww>
<Ww>
<count>2</count>
<WinNumber>1</WinNumber>
<ItemText>SortieSon,0x0A</ItemText>
</Ww>
<Ww>
<count>3</count>
<WinNumber>1</WinNumber>
<ItemText>Index</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow1>
<Mm>
<WinNumber>1</WinNumber>
<SubType>257</SubType>
<ItemText>r0</ItemText>
<SubType>10</SubType>
<ItemText>R2</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow1>
@ -189,7 +204,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>
@ -214,8 +229,13 @@
<LogicAnalyzers>
<Wi>
<IntNumber>0</IntNumber>
<FirstString>`SortieSon</FirstString>
<SecondString>0080000000000000000000000000E0FFFFFFEF4100000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F0A00000000000000000000000000000000000000080A0008</SecondString>
<FirstString>(PORTB &amp; 0x00000001)</FirstString>
<SecondString>008000000000000000000000000000000000F03F0000000000000000000000000000000028504F52544220262030783030303030303031290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F0E00000000000000000000000000000000000000F20A0008</SecondString>
</Wi>
<Wi>
<IntNumber>1</IntNumber>
<FirstString>(SortieSon &amp; 0xFFFF) &gt;&gt; 0</FirstString>
<SecondString>000080000000000000000000000000000000884000000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003000000FFFFFFFFFFFFDF3F0E00000000000000000000000000000000000000CC090008</SecondString>
</Wi>
</LogicAnalyzers>
<DebugDescription>
@ -360,7 +380,72 @@
<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>2</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\principal.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>3</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\principal.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>2</Number>
<Type>0</Type>
<LineNumber>45</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\principal.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>3</Number>
<Type>0</Type>
<LineNumber>44</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\principal.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<MemoryWindow1>
<Mm>
<WinNumber>1</WinNumber>
@ -389,7 +474,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>
@ -623,7 +708,7 @@
<Group>
<GroupName>Sources</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>