ajout d'une condition d'arrêt (non testé) à timer.c

This commit is contained in:
Marco ORFAO 2023-12-08 10:17:31 +01:00
parent ea56827b2c
commit 70af067414

View File

@ -59,13 +59,13 @@ int afficher_minute(int min){
} }
void creer_timer(void){ void creer_timer(void){
int sec = 0,min=0; int sec = 0,min=0,x=1;
unsigned long int temps = 0,seconde,pause=0; unsigned long int temps = 0,seconde,pause=0;
seconde=Microsecondes()+cycle; seconde=Microsecondes()+cycle;
afficher_seconde(sec); afficher_seconde(sec);
afficher_minute(min); afficher_minute(min);
EcrireTexte(110,100,":",2); EcrireTexte(110,100,":",2);
while(1){ while(x=1){
if(Microsecondes()>seconde){ if(Microsecondes()>seconde){
sec++; sec++;
printf("%d\n",sec); printf("%d\n",sec);
@ -83,6 +83,9 @@ void creer_timer(void){
if(Touche()==XK_space){ if(Touche()==XK_space){
pause=attendre(); pause=attendre();
} }
if(Touche()==XK_Escape){
x=0;
}
} }
} }
} }