Zzzzz....

This commit is contained in:
phyto 2019-05-22 15:48:21 +02:00
parent 85fa321972
commit 33d4a16040
4 changed files with 19 additions and 8 deletions

View File

@ -52,7 +52,7 @@ for (idx=0; idx<nbloops; idx++) {
else if (0x14==key) { /* request for terminal */
foo = run_the_terminal(sfd, " terminal ", 0);
putbyte(sfd, 'x'); putbyte(sfd, '\r');
// putbyte(sfd, 'x'); putbyte(sfd, '\r');
sprintf(ligne, "retour terminal = %d", foo);
aff_message(ligne); sleep(1);
}

View File

@ -252,7 +252,7 @@ for(;;) {
}
#if DEBUG_LEVEL
#if DEBUG_LEVEL > 1
fprintf(stderr, "%s -> '%s'\n", __func__, where);
#endif
return retval;

View File

@ -27,6 +27,8 @@ Global parametres;
/* -------------------------------------------------- */
void setup() {
short foo;
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
@ -34,6 +36,14 @@ void setup() {
pinMode(RELAIS_VENTILO, OUTPUT);
Serial.print("M booting\n");
for (foo=0; foo<10; foo++) {
digitalWrite(LED_BUILTIN, HIGH);
delay(50);
digitalWrite(LED_BUILTIN, LOW);
delay(50);
}
/* XXX */
/* changing the voltage reference of the ADC
* greatly increase the prcision on the limited
@ -83,12 +93,12 @@ void sendvalues(short *ptr)
{
int foo;
Serial.print("T");
prt("T");
for (foo=0; foo<NBVAL; foo++) {
Serial.print(" ");
Serial.print(ptr[foo]);
prt(" ");
prt(ptr[foo]);
}
Serial.print('\n');
prt('\n');
}
/* -------------------------------------------------- */
void update_and_send(void)
@ -115,7 +125,7 @@ void loop() {
key = Serial.read();
switch (key) {
case 'U':
Serial.println("M cli request");
prtln("M cli request");
phytocli();
break;
case '+': /* allume le frigo */
@ -135,7 +145,7 @@ void loop() {
prtln(" bad control code");
break;
}
}
}
delay(parametres.delai);
/* ETERNAL LOOP END HERE */

View File

@ -15,6 +15,7 @@
#include <ncurses.h>
#include "../serial/serial.h"
#include "../viz/curses/ecran.h"
#include "terminal.h"
extern int verbosity;