// rev 09/04/2024 by HT // rev 31-07-2024 rajout saisie Bavard sur 2 digits => donc 00 à 19 au lieu de 0 à 9 // pour mieux cibler les zones à tester/verifier // rev 30-08-2023 remplacé minute par Minut dans forcage HMM=xx:xx // rev 28-08-2023 rajout cde Reset // rev 11-08-2023 rajout cde HM=12:12 pour test SANS la RTCet HM=00:00 pour usage RTC // rev 19-07/2023 bavard de 0 à 7 // rev 15-07/2023 bavard de 0 à 3 // 08/07/2023 RAZ_UART1_Buffer1(); // et arme interrupt UART RX __delay_ms(1500); // 1500mS if(Flag_Buffer1==1) { CPrint("Recu :"); Print(Buffer1); CRLF1(); p0=&Buffer1[0]; if ( (*(p0)=='H') && (*(p0+1)=='e') && ( *(p0+2)=='l') && ( *(p0+3)=='p') ) { CPrint("\r\n Help Commandes :\r\n"); CPrint(" MAJ RTC via : \r\n"); CPrint(" ex: U;28;08;23;18;14;01;# pour 28 Aout 2023 , 18H14,Lundi \r\n"); CPrint(" PRG=xx Programme en cours xx= 00 a 11 \r\n"); CPrint(" BAV=xx mode Bavard avec x=00 a 19 \r\n"); CPrint(" HM=xx:yy set Heure(xx)Minutes(yy) SANS lien avec RTC ! \r\n"); CPrint(" si HM=00:00 usage RTC reactive\r\n"); CPrint(" Etat Bruleur BRU=0 ou 1 (pour test only) \r\n"); CPrint(" LED_Clignote=64 ou 32 (pour test clignote Led Eco ou conf) \r\n"); CPrint(" Reset MCU : Reset \r\n"); CPrint(" Help \r\n"); Print(Buffer1); CRLF1(); p0=0 ; } #ifdef With_RTC_DS3231 // U;27;04;23;15;14;04;# pour le 27 avril 2023 15H14 Jeudi if ( (*(p0)=='U') && (*(p0+1)==';') && ( *(p0+19)==';') && (HHMN_force==0 )) { CPrint("\r\n MAJ RTC \r\n"); Print(Buffer1); CRLF1(); MAJ_RTC(); CRLF1(); p0=0; } #endif // cde BRUleur if ((*(p0)=='B') && (*(p0+1)=='R') && ( *(p0+2)=='U') && ( *(p0+3)=='=') ) { if(*(p0+4)=='1') Etat_Bruleur=1; if(*(p0+4)=='0') Etat_Bruleur=0; p0=0; } // cde BAVard xx=00 à 19 if ((*(p0)=='B') && (*(p0+1)=='A') && ( *(p0+2)=='V') && ( *(p0+3)=='=')&& (*(p0+6)==0) ) { if( isdigit(*(p0+4)) && isdigit(*(p0+5)) ) { // 31-08-2024 cx=*(p0+4); Bavard=(cx-48)*10; cx=*(p0+5); Bavard=Bavard + cx-48; } else { Bavard=0; CPrint("\r\n Erreur saisie valeur de Bavard \r\n"); } p0=0; } // cde Choix PRoGramme if ((*(p0)=='P') && (*(p0+1)=='R') && ( *(p0+2)=='G') && ( *(p0+3)=='=') ) { cx=(*(p0+4)-48) *10 ; cx= cx + *(p0+5)-48; if ( (cx & 0x7F) <11 ) { Progr_En_Cours=cx; sprintf(CRam1,"new prog en cours %3d %c \r\n",cx,Progr_Name[cx]); Print(CRam1); Rafraichit_LCD_Table_en_cours(cx); } p0=0; } // cde HM=10:22 (Heure Minute) pour tests SANS RTC ! if ( (*(p0)=='H') && (*(p0+1)=='M') && ( *(p0+2)=='=') && ( *(p0+5)==':') ) { cx=*(p0+3); time[0]=cx; cx=cx-48; k=cx*10; cx=*(p0+4); time[1]=cx; cx=cx-48; k=k+cx; if ( k<24) { cx=*(p0+6); time[3]=cx; cx=cx-48; m=cx*10; cx=*(p0+7); time[4]=cx; cx=cx-48; m=m+cx; // if ( (k>=0) && (k<60) ) minute=k; // minute en BCD !dans RTC // 30-08-2023 if ( k<60) Minut=(unsigned char) m; } if( (k==0) &&(m==0) ) { HHMN_force=0; } else { Hour=(unsigned char) k; Minut=(unsigned char) m; HHMN_force=1; Sec=0; sprintf(CRam1,"\r\n New time Hour=%3d Minu=%3d \r\n",Hour,Minut); Print(CRam1); } p0=0; } // p0=strncmp(Buffer1,"Reset",5); // if ( ( p0>0) && ( strlen(p0)>=5) ) if ( (*(p0)=='R') && (*(p0+1)=='E') && ( *(p0+2)=='S') && ( *(p0+3)=='E') && ( *(p0+4)=='T') ) { if(strlen(p0)==5) { CPrint("\r\n Reset volontaire \r\n"); p0=0; __delay_xSec(4); Reset(); } p0=0; } if(strncmp(Buffer1,"LED_Cli10=",10)==0) { // if( isdigit(*(p0+13)) && isdigit(*(p0+14)) ) if( isdigit(*(p0+11) ) ) { cx=*(p0+11)-48; if (cx < 15) LED_Clignote10=cx; sprintf(CRam1,"\r\n Force Led_Clignote10 PortA -> %d \r\n",LED_Clignote10); Print(CRam1); } p0=0; } // autre tests ... } //if flag