summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorburg2005-05-01 10:53:09 +0000
committerburg2005-05-01 10:53:09 +0000
commit1e27f86555f2ac37f66886b539ad03be30797d68 (patch)
tree348092a86a5d7b63c5412010babe37296e652ca7
parent28e37e37d7644314ec858b4bc9bc46622bb4567f (diff)
main.c correction de code qui n'était pas dans la boule de clk
ascenseur.c renvoie de I pour signifié l'IDLE de l'ascenseur
-rw-r--r--n/es/src/ascenseur.c2
-rw-r--r--n/es/src/main.c38
2 files changed, 24 insertions, 16 deletions
diff --git a/n/es/src/ascenseur.c b/n/es/src/ascenseur.c
index 473e7c1..01fb7d2 100644
--- a/n/es/src/ascenseur.c
+++ b/n/es/src/ascenseur.c
@@ -118,7 +118,7 @@ void ascenseur_update ()
break;
case WAIT: // attente mobile normalement en bas
asc_libre();
- asc_message = 255;
+ if (asc_message != 0) asc_message = 255;
if (capteur_bas() && (asc_ordre ==0x01 ))
{
ascenseur_state = CMD_Mgrande;
diff --git a/n/es/src/main.c b/n/es/src/main.c
index ebee300..fbdab49 100644
--- a/n/es/src/main.c
+++ b/n/es/src/main.c
@@ -91,12 +91,12 @@ int main (void)
while(1) // boucle principale
{
- if(clk == 1 ) // rajouter etat
+ if(clk == 1 ) // rajouter etat
{
- while (rs232_poll ())
- proto_accept (rs232_getc ());
- clk = 0;
- TCNT1 = 350; //(65535L - ((20L*14745600L)/(1024L*1000L))); // LE PASSER EN COMPARATEUR.
+ while (rs232_poll ())
+ proto_accept (rs232_getc ());
+ clk = 0;
+ TCNT1 = 350; //(65535L - ((20L*14745600L)/(1024L*1000L))); // LE PASSER EN COMPARATEUR.
if(temp_sens != sens)
{
@@ -148,23 +148,28 @@ int main (void)
if (socle == 1) // active les fonctions liées au socle.
{
adc_start (pin_socle1); // pin socle1 sélectionnée
+
while(!adc_checkf()){}
valeur_socle1 = adc_read();
adc_start (pin_socle2); // pin socle2 sélectionnée
+
while(!adc_checkf()){}
valeur_socle2 = adc_read();
nb_valeur_socle++;
- if(valeur_socle1 > SEUIL_SOCLE || valeur_socle2 > SEUIL_SOCLE) tableau_socle[nb_valeur_socle & 15] = 1;
- else tableau_socle[nb_valeur_socle & 15] = 0;
+ if(valeur_socle1 > SEUIL_SOCLE || valeur_socle2 > SEUIL_SOCLE)
+ tableau_socle[nb_valeur_socle & 15] = 1;
+ else
+ tableau_socle[nb_valeur_socle & 15] = 0;
for(temp = 0; temp < 16 ;temp++)
etat_socle = tableau_socle[temp];
tableau_sharp[6] = etat_socle >> 3;
- // twi_update ((uint8_t *) (etat_socle >> 3)); // RASSEMBLER TOUS LES CAPTEURS DANS 1 TWI
+ // twi_update ((uint8_t *) (etat_socle >> 3));
+ // // RASSEMBLER TOUS LES CAPTEURS DANS 1 TWI
}
switch(asc_message) /* Affiche les messages de retour de
@@ -172,21 +177,24 @@ int main (void)
1 ascenseur en haut en attente.
2 ascenseur en bas mais suite à un
disfonctionement
+ 3 ascenseur en IDLE ou WAIT state
255 valeur réservée à la réactivation
du message (Ne pas utiliser ici)
*/
{
case 1 : proto_send0('T'); break;
case 2 : proto_send0('E'); break;
+ case 3 : proto_send0('I'); break;
}
-
+
+ if (socle == 1 && pont == 1)
+ twi_update ((uint8_t *) tableau_sharp,7);
+ if (socle == 1 && pont == 0)
+ twi_update ((uint8_t *) &(tableau_sharp[6]),1);
+ if (socle == 0 && pont == 1)
+ twi_update ((uint8_t *) tableau_sharp,6);
+
}
-
- if (socle == 1 && pont == 1) twi_update ((uint8_t *) tableau_sharp,7);
- if (socle == 1 && pont == 0) twi_update ((uint8_t *) &(tableau_sharp[6]),1);
- if (socle == 0 && pont == 1) twi_update ((uint8_t *) tableau_sharp,6);
-
-
}
return 0;
}