forked from acco/chti23
partie son terminaient
This commit is contained in:
parent
e5735774cf
commit
add2839abb
4 changed files with 27 additions and 14 deletions
|
@ -0,0 +1,3 @@
|
|||
void callback_son(void);
|
||||
|
||||
void start_son(void);
|
|
@ -3,8 +3,9 @@
|
|||
|
||||
include Driver/DriverJeuLaser.inc
|
||||
export callback_son;
|
||||
export start_son;
|
||||
export sortieSon;
|
||||
extern Son;
|
||||
extern Son;
|
||||
; ====================== zone de réservation de données, ======================================
|
||||
;Section RAM (read only) :
|
||||
area mesdata,data,readonly
|
||||
|
@ -25,9 +26,12 @@ index dcd 0
|
|||
; écrire le code ici
|
||||
|
||||
callback_son
|
||||
push{lr,r4};
|
||||
push{lr,r4,r5};
|
||||
ldr r0, =index;
|
||||
ldr r4, [r0];
|
||||
mov r5, #5512;
|
||||
cmp r4,r5;
|
||||
bgt fin;
|
||||
ldr r1, =sortieSon;
|
||||
ldr r2, =Son;
|
||||
ldrsh r3, [r2, r4,lsl #1];
|
||||
|
@ -40,12 +44,13 @@ callback_son
|
|||
str r3, [r1];
|
||||
mov r0,r3;
|
||||
bl PWM_Set_Value_TIM3_Ch3;
|
||||
pop{pc,r4};
|
||||
END
|
||||
fin
|
||||
pop{pc,r4,r5};
|
||||
|
||||
StartSon
|
||||
start_son
|
||||
push{lr};
|
||||
|
||||
|
||||
ldr r0, =index;
|
||||
mov r1, #0;
|
||||
str r1, [r0];
|
||||
pop{pc};
|
||||
END
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
#include "DriverJeuLaser.h"
|
||||
extern void callback_son(void);
|
||||
|
||||
extern void callback_son(void);
|
||||
extern void start_son(void);
|
||||
int button = 0;
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
@ -20,7 +21,11 @@ GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
|||
|
||||
while (1)
|
||||
{
|
||||
|
||||
if (button == 1){
|
||||
start_son();
|
||||
button = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
|
@ -168,7 +168,7 @@
|
|||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aLwin>0</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
|
@ -182,7 +182,7 @@
|
|||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>1</aLa>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
|
@ -280,7 +280,7 @@
|
|||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
|
|
Loading…
Reference in a new issue