forked from acco/chti23
TP Son fini
This commit is contained in:
parent
b965387758
commit
7fff3125bd
4 changed files with 138 additions and 88 deletions
|
@ -10,58 +10,63 @@
|
||||||
;Section RAM (read write):
|
;Section RAM (read write):
|
||||||
area maram,data,readwrite
|
area maram,data,readwrite
|
||||||
|
|
||||||
|
Offset equ 32768
|
||||||
|
SortieSon equ 0
|
||||||
|
Index equ 0
|
||||||
|
|
||||||
SortieSon dcw 0
|
import LongueurSon
|
||||||
EXPORT SortieSon
|
import Son
|
||||||
|
import PWM_Set_Value_TIM3_Ch3
|
||||||
Offset equ 32768
|
export CallBackSon
|
||||||
Intervalle equ 360
|
|
||||||
Index equ 0
|
|
||||||
|
|
||||||
EXPORT CallbackSon
|
|
||||||
|
|
||||||
; ===============================================================================================
|
; ===============================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;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
|
||||||
|
|
||||||
;short int SortieSon;
|
|
||||||
;int LongueurSon 5512
|
|
||||||
;int i;
|
|
||||||
;if not i == LongueurSon
|
|
||||||
;lire[i] str
|
|
||||||
;i++
|
|
||||||
;
|
|
||||||
;360*(SortieSon+32768)/32768
|
|
||||||
|
|
||||||
import son
|
CallBackSon proc
|
||||||
import LongueurSon
|
ldr r0, =Index
|
||||||
|
ldr r1, [r0]
|
||||||
|
|
||||||
CallbackSon proc
|
ldr r2, =LongueurSon
|
||||||
push {lr}
|
ldr r2, [r2]
|
||||||
|
|
||||||
ldr r0,=son ; tableau de données
|
cmp r1, r2
|
||||||
ldr r1,=SortieSon ; resultat
|
bne FIN_Son
|
||||||
|
|
||||||
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_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
|
||||||
|
|
||||||
|
|
||||||
FIN
|
ldr r0, =SortieSon
|
||||||
mov r3,#0
|
str r3, [r0]
|
||||||
|
mov r0, r3
|
||||||
|
|
||||||
ENDP
|
bl PWM_Set_Value_TIM3_Ch3
|
||||||
|
|
||||||
|
bx lr
|
||||||
|
|
||||||
|
endp
|
||||||
|
|
||||||
END
|
END
|
|
@ -2,15 +2,13 @@
|
||||||
|
|
||||||
#include "DriverJeuLaser.h"
|
#include "DriverJeuLaser.h"
|
||||||
|
|
||||||
extern void CallbackSon(void);
|
extern void CallBackSon(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// ============= INIT PERIPH (faites qu'une seule fois) =====================
|
// ============= INIT PERIPH (faites qu'une seule fois) =====================
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
@ -18,9 +16,17 @@ 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, 65520000);
|
|
||||||
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
|
Timer_1234_Init_ff( TIM4, 6552);
|
||||||
Run_Timer(TIM4);
|
|
||||||
|
|
||||||
|
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
@ -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>
|
<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>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>
|
<Tracepoint>
|
||||||
<THDelay>0</THDelay>
|
<THDelay>0</THDelay>
|
||||||
</Tracepoint>
|
</Tracepoint>
|
||||||
|
@ -460,7 +533,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>
|
||||||
|
@ -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>
|
<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>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>
|
|
||||||
<MemoryWindow1>
|
<MemoryWindow1>
|
||||||
<Mm>
|
<Mm>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue