Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 4:87ec8f45cafe
- Parent:
- 3:1df7773ae017
- Child:
- 5:07e3997f4856
--- a/main.cpp Fri May 11 14:22:53 2018 +0000
+++ b/main.cpp Fri May 11 15:26:44 2018 +0000
@@ -9,7 +9,7 @@
//LocalFileSystem local("local");
// Dimensione massima del vettore MRxB
-#define MRxBDIM 200
+#define MRxBDIM 50
// Dimensione massima del vettore ARxB
#define ARxBDIM 200
@@ -80,6 +80,8 @@
int main()
{
+ start:
+
//FILE *flis;
// Configurazione del baud rate per la comunicazione col PC
@@ -91,13 +93,14 @@
pc.printf("\r\n");
pc.printf(" PROGRAMMA PER L'INVIO DI COMANDI AT SU PORTA SERIALE\r\n");
- pc.printf("________________________________________________________________________________\r\n");
- pc.printf("\r\n");
+ pc.printf("________________________________________________________________________________\r\n");
+ pc.printf("\r\n");
pc.printf(" ----------------------------------------------------------------------------\r\n");
- pc.printf(" | Premere il tasto 'm' per inserire un comando |\r\n");
+ pc.printf(" | Premere il tasto 'i' per inserire un comando |\r\n");
pc.printf(" | Premere il tasto 'a' per l'invio automatico della sequenza di comandi |\r\n");
+ pc.printf(" | Premere il tasto 'r' per rinviare l'ultimo comando |\r\n");
pc.printf(" | Premere il tasto 't' per testare il tempo di risposta del modem |\r\n");
- pc.printf(" | Premere il tasto 'r' per rinviare l'ultimo comando |\r\n");
+ pc.printf(" | Premere il tasto 's' per riavviare il programma |\r\n");
pc.printf(" | Premere il tasto 'e' per uscire dal programma |\r\n");
pc.printf(" ----------------------------------------------------------------------------\r\n");
pc.printf("________________________________________________________________________________\r\n");
@@ -123,8 +126,7 @@
input=pc.getc();
-
- if((input=='m')||(input=='M'))
+ if((input=='i')||(input=='I'))
{
LedOFF();
@@ -146,14 +148,14 @@
esc1:
pc.printf("\r\n\r\nRisposta:\r\n");
-
+
at.read(MRxB, MRxBDIM);
for(i=0;i<MRxBDIM;i++)
{
pc.printf("%c",MRxB[i]);
}
-
+
pc.printf("________________________________________________________________________________\r\n");
pc.printf("\r\n");
@@ -269,6 +271,15 @@
} // End if
+ if ((input=='s')||(input=='S'))
+ {
+ LedOFF();
+ Vreset();
+
+ goto start;
+ }
+
+
if ((input=='e')||(input=='E'))
{
pc.printf("Il programma e' stato chiuso\n\r\n\r");