TP Son fini

This commit is contained in:
Boyu Fu 2023-04-12 09:43:29 +02:00
parent b965387758
commit 7fff3125bd
4 changed files with 138 additions and 88 deletions

View file

@ -1,7 +1,7 @@
PRESERVE8
THUMB
; ====================== zone de réservation de données, ======================================
;Section RAM (read only) :
area mesdata,data,readonly
@ -10,58 +10,63 @@
;Section RAM (read write):
area maram,data,readwrite
SortieSon dcw 0
EXPORT SortieSon
Offset equ 32768
Intervalle equ 360
Index equ 0
EXPORT CallbackSon
Offset equ 32768
SortieSon equ 0
Index equ 0
import LongueurSon
import Son
import PWM_Set_Value_TIM3_Ch3
export CallBackSon
; ===============================================================================================
;Section ROM code (read only) :
area moncode,code,readonly
; écrire le code ici
;short int SortieSon;
;int LongueurSon 5512
;int i;
;if not i == LongueurSon
;lire[i] str
;i++
;
;360*(SortieSon+32768)/32768
import son
import LongueurSon
CallBackSon proc
ldr r0, =Index
ldr r1, [r0]
ldr r2, =LongueurSon
ldr r2, [r2]
CallbackSon proc
push {lr}
cmp r1, r2
bne FIN_Son
ldr r0,=son ; tableau de données
ldr r1,=SortieSon ; resultat
ldr r2,[r1,#LongueurSon] ; point fini
ldr r3,[r1,#Index] ; position actuelle
add r3,#1
cmp r2,r3 ;if on n'arrive pas la fin de tableau, on continue
beq FIN ; if oui on quitte le prog
; ldr r4,
; ldrsh []
mov r0, #0
ldr r2, =SortieSon
str r0, [r2]
bx lr
FIN
mov r3,#0
ENDP
FIN_Son
add r1, #1
str r1, [r0]
sub r1, #1
ldr r3, =Son
ldrsh r3, [r3,r1,LSL #1]
add r3, #Offset
mov r0, #360
mul r3,r0
ldr r0,=Offset
udiv r3, r0
ldr r0, =SortieSon
str r3, [r0]
mov r0, r3
bl PWM_Set_Value_TIM3_Ch3
bx lr
endp
END

View file

@ -2,14 +2,12 @@
#include "DriverJeuLaser.h"
extern void CallbackSon(void);
extern void CallBackSon(void);
int main(void)
{
// ===========================================================================
// ============= INIT PERIPH (faites qu'une seule fois) =====================
@ -17,13 +15,21 @@ 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, 65520000);
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
Run_Timer(TIM4);
Timer_1234_Init_ff( TIM4, 6552);
Active_IT_Debordement_Timer( TIM4, 2, CallBackSon );
PWM_Init_ff( TIM3, 3, 720);
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
//============================================================================
@ -31,4 +37,3 @@ while (1)
{
}
}

View file

@ -75,7 +75,7 @@
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>0</IsCurrentTarget>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<DebugOpt>
@ -153,7 +153,80 @@
<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>53</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>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>54</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>
<Bp>
<Number>2</Number>
<Type>0</Type>
<LineNumber>55</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134220486</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>.\Src\GestionSon.s</Filename>
<ExecCommand></ExecCommand>
<Expression>\\StepSon\Src/GestionSon.s\55</Expression>
</Bp>
<Bp>
<Number>3</Number>
<Type>0</Type>
<LineNumber>52</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134220476</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>.\Src\GestionSon.s</Filename>
<ExecCommand></ExecCommand>
<Expression>\\StepSon\Src/GestionSon.s\52</Expression>
</Bp>
</Breakpoint>
<MemoryWindow1>
<Mm>
<WinNumber>1</WinNumber>
<SubType>266</SubType>
<ItemText>r3</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow1>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
@ -460,7 +533,7 @@
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
<IsCurrentTarget>0</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<DebugOpt>
@ -538,40 +611,7 @@
<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>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>8</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>7</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>
<Breakpoint/>
<MemoryWindow1>
<Mm>
<WinNumber>1</WinNumber>

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>