Version Lanard 24/05
This commit is contained in:
parent
1ba02718a1
commit
641ddf4276
43 changed files with 21986 additions and 21888 deletions
|
@ -15,13 +15,58 @@
|
||||||
; ===============================================================================================
|
; ===============================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
Index DCD 0
|
||||||
|
Somme DCD 0
|
||||||
|
|
||||||
|
|
||||||
;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
|
||||||
|
|
||||||
|
DTF_ModuleAuCarre proc
|
||||||
|
|
||||||
|
push{r4}
|
||||||
|
push{r5}
|
||||||
|
push{r6}
|
||||||
|
push{r7}
|
||||||
|
push{r8}
|
||||||
|
push{r9}
|
||||||
|
|
||||||
|
ldr r2, =Index
|
||||||
|
ldr r3,[r2]
|
||||||
|
ldr r4, =TabCos
|
||||||
|
ldr r7, =Somme
|
||||||
|
ldr r8,[r7]
|
||||||
|
|
||||||
|
|
||||||
|
cmp r3 , #63
|
||||||
|
|
||||||
|
bne notEqual
|
||||||
|
|
||||||
|
pop{r9}
|
||||||
|
pop{r8}
|
||||||
|
pop{r7}
|
||||||
|
pop{r6}
|
||||||
|
pop{r5}
|
||||||
|
pop{r4}
|
||||||
|
|
||||||
|
bx lr
|
||||||
|
|
||||||
|
notEqual
|
||||||
|
ldrsh r6,[r0,r3] ;on charge le signal[index]
|
||||||
|
mul r1 , r3 ;k*index
|
||||||
|
and r1, #32 ; %64
|
||||||
|
ldrsh r5,[r4,r3] ;on charge le TabCos[(k*index%64)]
|
||||||
|
mul r5,r6 ; on multiplie le signal[index] et le cosinus
|
||||||
|
add r7, r5 ; somme = somme + signal*cosinus
|
||||||
|
mov r9, #1
|
||||||
|
add r3, r9 ;index ++
|
||||||
|
strh r0,[r3] ;on stocke le résultat dans le registre de retour
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
AREA Signal, DATA, READONLY
|
AREA Signal, DATA, READONLY
|
||||||
export LeSignal
|
export LeSignal
|
||||||
|
|
||||||
LeSignal
|
LeSignal
|
||||||
DCW 0x0fff ; 0 4095 0.99976
|
DCW 0x0fff ; 0 4095 0.99976
|
||||||
DCW 0x0ff6 ; 1 4086 0.99756
|
DCW 0x0ff6 ; 1 4086 0.99756
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "DriverJeuLaser.h"
|
#include "DriverJeuLaser.h"
|
||||||
|
extern int DFT_ModuleAuCarre( short int * Signal64ech, char k) ;
|
||||||
|
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,8 +21,10 @@
|
||||||
export SortieSon
|
export SortieSon
|
||||||
extern LongueurSon
|
extern LongueurSon
|
||||||
extern Son
|
extern Son
|
||||||
|
export StartSon
|
||||||
|
|
||||||
Index DCD 0
|
Index DCD 0
|
||||||
|
export Index
|
||||||
SortieSon DCW 0
|
SortieSon DCW 0
|
||||||
|
|
||||||
;Section ROM code (read only) :
|
;Section ROM code (read only) :
|
||||||
|
@ -30,6 +32,8 @@ SortieSon DCW 0
|
||||||
; écrire le code ici
|
; écrire le code ici
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CallbackSon proc
|
CallbackSon proc
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,13 +43,24 @@ CallbackSon proc
|
||||||
ldr r2,=Son
|
ldr r2,=Son
|
||||||
ldr r3,LongueurSon
|
ldr r3,LongueurSon
|
||||||
|
|
||||||
|
push {r4}
|
||||||
|
push {r5}
|
||||||
|
push {r6}
|
||||||
|
push {r7}
|
||||||
|
mov r4, #2
|
||||||
|
mul r3,r4
|
||||||
|
|
||||||
|
|
||||||
|
ldr r7,[r0] ; comparaison de la valeur de l'index pour savoir si c'est la fin
|
||||||
|
cmp r3,r7
|
||||||
|
beq FinIndex
|
||||||
|
|
||||||
cmp r1,r3
|
cmp r1,r3
|
||||||
ble notEqual
|
ble notEqual
|
||||||
|
|
||||||
notEqual
|
notEqual
|
||||||
|
|
||||||
push {r4}
|
|
||||||
push {r5}
|
|
||||||
ldrsh r5,[r2,r1]
|
ldrsh r5,[r2,r1]
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,17 +70,27 @@ notEqual
|
||||||
mul r5,r4
|
mul r5,r4
|
||||||
mov r4,#65535
|
mov r4,#65535
|
||||||
udiv r5,r4
|
udiv r5,r4
|
||||||
push {r6}
|
|
||||||
ldr r6,=SortieSon
|
ldr r6,=SortieSon
|
||||||
|
|
||||||
strh r5,[r6]
|
strh r5,[r6]
|
||||||
|
|
||||||
|
push {r1}
|
||||||
|
push {lr}
|
||||||
|
push {r0}
|
||||||
|
mov r0,r5
|
||||||
|
bl PWM_Set_Value_TIM3_Ch3
|
||||||
|
pop {r0}
|
||||||
|
pop {lr}
|
||||||
|
pop {r1}
|
||||||
|
|
||||||
add r1, #2
|
add r1, #2
|
||||||
|
|
||||||
str r1,[r0]
|
str r1,[r0]
|
||||||
pop{r6}
|
|
||||||
pop {r4}
|
pop {r7}
|
||||||
|
pop {r6}
|
||||||
pop {r5}
|
pop {r5}
|
||||||
|
pop {r4}
|
||||||
|
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
|
@ -73,5 +98,24 @@ notEqual
|
||||||
|
|
||||||
ENDFUNC
|
ENDFUNC
|
||||||
|
|
||||||
|
StartSon proc
|
||||||
|
ldr r0, =Index
|
||||||
|
mov r2,#0
|
||||||
|
str r2,[r0]
|
||||||
|
bx lr
|
||||||
|
endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FinIndex
|
||||||
|
push {r8}
|
||||||
|
mov r8,#-1
|
||||||
|
str r8,[r0]
|
||||||
|
pop {r8}
|
||||||
|
pop {r7}
|
||||||
|
pop {r6}
|
||||||
|
pop {r5}
|
||||||
|
pop {r4}
|
||||||
|
bx lr
|
||||||
|
endp
|
||||||
END
|
END
|
|
@ -3,7 +3,9 @@
|
||||||
#include "DriverJeuLaser.h"
|
#include "DriverJeuLaser.h"
|
||||||
|
|
||||||
extern void CallbackSon(void);
|
extern void CallbackSon(void);
|
||||||
|
extern short SortieSon ;
|
||||||
|
extern void StartSon(void) ;
|
||||||
|
extern short Index ;
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -15,17 +17,24 @@ int main(void)
|
||||||
CLOCK_Configure();
|
CLOCK_Configure();
|
||||||
|
|
||||||
Timer_1234_Init_ff( TIM4, 6552);
|
Timer_1234_Init_ff( TIM4, 6552);
|
||||||
Timer_1234_Init_ff( TIM3,720);
|
//Timer_1234_Init_ff( TIM3,720);
|
||||||
Active_IT_Debordement_Timer( TIM4, 2, CallbackSon);
|
|
||||||
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||||
PWM_Init_ff( TIM3, 3, 720);
|
PWM_Init_ff( TIM3, 3, 720);
|
||||||
|
Active_IT_Debordement_Timer( TIM4, 2, CallbackSon);
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
|
//Pour la prochaine fois, on doit afficher le signal sur l'oscillo et coder la fonction start
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (Index==-1){
|
||||||
|
StartSon() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -429,7 +429,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>
|
||||||
|
|
Loading…
Reference in a new issue