Révision 325
Ajouté par fltronel il y a plus de 6 ans
branch/tronel_florian/Emb_App/programme_principal_etud.c | ||
---|---|---|
// correspondant au nom du v?hicule si le nom se termine par '*'
|
||
|
||
unsigned short r=0, f=0;
|
||
|
||
unsigned short t, T;
|
||
unsigned char t1, t2;
|
||
unsigned char *s=&t1, *cs=&t2;
|
||
|
||
int dist;
|
||
int ang_r;
|
||
int vit=20;
|
||
int vit=30;
|
||
|
||
int M_A=0;
|
||
int c=0;
|
||
... | ... | |
sta_tsk(ID_periph_rx);
|
||
|
||
|
||
sta_tsk(ID_task_5);//feu
|
||
sta_tsk(ID_task_5);//en attente du feu
|
||
|
||
while(f!=1);
|
||
|
||
ter_tsk(ID_task_5);//feu
|
||
ter_tsk(ID_task_5);//feu ok donc task off
|
||
|
||
//sta_tsk(ID_task_6);//temps lcd
|
||
|
||
sta_tsk(ID_task_1);//vitesse
|
||
sta_tsk(ID_task_2);//tourelle
|
||
... | ... | |
|
||
}
|
||
|
||
|
||
void task_1(){
|
||
|
||
while(1){
|
||
... | ... | |
}
|
||
|
||
}
|
||
|
||
|
||
void task_2(){
|
||
CanFrame req_1, rep, cons_tourelle;
|
||
... | ... | |
}
|
||
}
|
||
|
||
|
||
void task_3(){
|
||
CanFrame req_2;
|
||
|
||
... | ... | |
}
|
||
}
|
||
|
||
|
||
void task_4(){
|
||
CanFrame cons_roue;
|
||
|
||
... | ... | |
snd_dtq(CanTx,cons_roue.msg);
|
||
dly_tsk(3);
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
void task_5(){
|
||
CanFrame req_d;
|
||
|
||
... | ... | |
|
||
r = periph[ADDR('M')].val;
|
||
f = (r & 0x8000)>>15;
|
||
dly_tsk(7);
|
||
dly_tsk(5);
|
||
}
|
||
}
|
||
|
||
void task_6(){
|
||
CanFrame req_lcd;
|
||
while(1){
|
||
req_lcd.data.id='H';
|
||
req_lcd.data.rtr=1;
|
||
snd_dtq(CanTx,req_lcd.msg);
|
||
|
||
t = periph[ADDR('H')].val;
|
||
t1=t/100;
|
||
t2=t -(t1*100);
|
||
|
||
|
||
lcd_com(0x80);
|
||
lcd_str(s);
|
||
|
||
dly_tsk(10);
|
||
}
|
||
}
|
||
|
||
|
||
void HC_1(){
|
||
LED_V =~ LED_V;
|
||
}
|
branch/tronel_florian/Emb_App/conf_noyau.cfg | ||
---|---|---|
initial_start = OFF;
|
||
exinf = 0x0;
|
||
};
|
||
//acquisition du temps
|
||
task[]{
|
||
entry_address = task_6();
|
||
name = ID_task_6;
|
||
stack_size = 256;
|
||
stack_section = stack;
|
||
priority = 2;
|
||
initial_start = OFF;
|
||
exinf = 0x0;
|
||
};
|
||
|
||
flag[]{
|
||
name = ev_bus_fin_tr;
|
||
initial_pattern = 0x0000;
|
||
... | ... | |
buffer_size = 4;
|
||
};
|
||
|
||
|
||
//Handler cyclique pour la LED verte
|
||
cyclic_hand[]{
|
||
entry_address = HC_1();
|
Formats disponibles : Unified diff
commit fin de séance : tâche affichage lcd en cours