Révision 431
Ajouté par melepogam il y a plus de 6 ans
branch/lepogam/Emb_App/SessionM32C_E8a_system.ini | ||
---|---|---|
[Target]
|
||
M32C E8a SYSTEM=Renesas Communications
|
||
[USER_DATA]
|
||
RESET=ff004c
|
||
RESET=ff0050
|
branch/lepogam/Emb_App/programme_principal_etud.c | ||
---|---|---|
unsigned int vitesse=0;
|
||
unsigned int couleur=0; // vert -> ligne droie
|
||
unsigned int npiste=0;
|
||
unsigned int lectM=0;
|
||
unsigned int feu=0;
|
||
unsigned int distance_ref=700;
|
||
unsigned int distance_ref_init=700;
|
||
unsigned int consigne=450;
|
||
... | ... | |
|
||
snd_dtq (CanTx,demande.msg); // Interrogation du peripherique
|
||
dly_tsk(500);
|
||
npiste=periph[ADDR('M')].val<<8; // contient la valeur de retour du simulateur.
|
||
// contient la valeur de retour du simulateur.
|
||
npiste=periph[ADDR('M')].val<<8;
|
||
|
||
|
||
switch(npiste){
|
||
|
||
... | ... | |
vitesse=vitesse_min; //virage
|
||
}
|
||
}
|
||
void feu_t(){
|
||
CanFrame comm;
|
||
CanFrame demande;
|
||
CanFrame reponse;
|
||
while(1){
|
||
demande.data.id='M';
|
||
demande.data.rtr=1;
|
||
|
||
snd_dtq (CanTx,demande.msg); // Interrogation du peripherique
|
||
dly_tsk(100);
|
||
lectM=periph[ADDR('M')].val>>15; //lecture feu
|
||
if (lectM==1){
|
||
feu=1;
|
||
ext_tsk();
|
||
}
|
||
}
|
||
}
|
||
|
||
void main()
|
||
{
|
||
... | ... | |
sta_tsk(ID_periph_rx);
|
||
|
||
sta_tsk(ID_piste);
|
||
sta_tsk(ID_feu_t);
|
||
sta_tsk(ID_asserv_tourelle);
|
||
sta_tsk(ID_asserv_roue);
|
||
sta_cyc(ID_asserv1);
|
||
... | ... | |
|
||
|
||
dly_tsk(600); // attente mise en place de la tourelle
|
||
while (feu!=1);
|
||
sta_tsk(ID_asserv_vitesse);
|
||
sta_cyc(ID_asserv3);
|
||
|
branch/lepogam/Emb_App/conf_noyau.cfg | ||
---|---|---|
initial_start = OFF;
|
||
exinf = 0x0;
|
||
};
|
||
task[]{
|
||
entry_address = feu_t();
|
||
name = ID_feu_t;
|
||
stack_size = 256;
|
||
stack_section = stack;
|
||
priority = 6;
|
||
initial_start = OFF;
|
||
exinf = 0x0;
|
||
};
|
||
flag[]{
|
||
name = ev_bus_fin_tr;
|
||
initial_pattern = 0x0000;
|
Formats disponibles : Unified diff
Ajout attente feu vert