|
|
@ -12,46 +12,54 @@
|
|
|
|
void SerialMenue(void)
|
|
|
|
void SerialMenue(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SerialWriteString("(1) Einstellungen anzeigen\r\n");
|
|
|
|
SerialWriteString("(1) Einstellungen anzeigen\r\n");
|
|
|
|
SerialWriteString("(2) Einstellungen ändern\r\n");
|
|
|
|
if(bState.WriteMsgEEprom)
|
|
|
|
|
|
|
|
SerialWriteString("\033[5m(2) Texte speichern\033[m\r\n");
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
SerialWriteString("(2) Texte speichern\r\n");
|
|
|
|
SerialWriteString("(3) Texte anzeigen\r\n");
|
|
|
|
SerialWriteString("(3) Texte anzeigen\r\n");
|
|
|
|
SerialWriteString("(4) Texte ändern\r\n");
|
|
|
|
SerialWriteString("(4) Texte ändern\r\n");
|
|
|
|
SerialWriteString("(5) Texte anhören\r\n");
|
|
|
|
|
|
|
|
SerialWriteString("\r\nEingabe: ");
|
|
|
|
SerialWriteString("\r\nEingabe: ");
|
|
|
|
|
|
|
|
bSerialState.Ausgabe = SERMENUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/** @brief Aktuelle Einstellungen über serielle Schnittstelle ausgeben
|
|
|
|
/** @brief Aktuelle Einstellungen über serielle Schnittstelle ausgeben
|
|
|
|
* @param none
|
|
|
|
* @param none
|
|
|
|
* @return none
|
|
|
|
* @return none
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void SerialSetup(void)
|
|
|
|
void SerialSetup(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sprintf(sdebug,"WpM : %i\r\n", bConfig.WpM);
|
|
|
|
sprintf(out,"%s",CLRSCR);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
SerialWriteString(out);
|
|
|
|
sprintf(sdebug,"KeyerMode : %i\r\n", bConfig.KeyerMode);
|
|
|
|
SerialWriteString("Einstellungen\r\n\r\n");
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"WpM : %i\r\n", bConfig.WpM);
|
|
|
|
sprintf(sdebug,"SidetoneFreq : %u\r\n", bConfig.SidetoneFreq);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"KeyerMode : %i\r\n", bConfig.KeyerMode);
|
|
|
|
sprintf(sdebug,"TRX1 : %i\r\n", bConfig.Trx1);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"SidetoneFreq : %u\r\n", bConfig.SidetoneFreq);
|
|
|
|
sprintf(sdebug,"TRX2 : %i\r\n", bConfig.Trx2);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"TRX1 : %i\r\n", bConfig.Trx1);
|
|
|
|
sprintf(sdebug,"SidetoneEnabled : %i\r\n", bConfig.SidetoneEnabled);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"TRX2 : %i\r\n", bConfig.Trx2);
|
|
|
|
sprintf(sdebug,"Ratio : %i\r\n", bConfig.Ratio);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"SidetoneEnabled : %i\r\n", bConfig.SidetoneEnabled);
|
|
|
|
sprintf(sdebug,"WpMBpM : %i\r\n", bConfig.WpMBpM);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"Ratio : %i\r\n", bConfig.Ratio);
|
|
|
|
sprintf(sdebug,"Reverse : %i\r\n", bConfig.Reverse);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"WpMBpM : %i\r\n", bConfig.WpMBpM);
|
|
|
|
sprintf(sdebug,"Memory : %i\r\n", bConfig.Memory);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"Reverse : %i\r\n", bConfig.Reverse);
|
|
|
|
sprintf(sdebug,"MemButtonMode : %i\r\n", bConfig.MemButtonMode);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"Memory : %i\r\n", bConfig.Memory);
|
|
|
|
sprintf(sdebug,"RiseTime : %i\r\n", bConfig.RiseTime);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"MemButtonMode : %i\r\n", bConfig.MemButtonMode);
|
|
|
|
sprintf(sdebug,"RiseTimeCounter : %i\r\n", bConfig.RiseTimeCounter);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"RiseTime : %i\r\n", bConfig.RiseTime);
|
|
|
|
sprintf(sdebug,"DebounceTime : %i\r\n", bConfig.DebounceTime);
|
|
|
|
SerialWriteString(out);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
sprintf(out,"RiseTimeCounter : %i\r\n", bConfig.RiseTimeCounter);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
sprintf(out,"DebounceTime : %i\r\n", bConfig.DebounceTime);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
SerialWriteString("\r\nTaste ...");
|
|
|
|
|
|
|
|
bSerialState.Ausgabe = SERSETUP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/** @brief Versionsinformation über serielle Schnittstelle ausgeben
|
|
|
|
/** @brief Versionsinformation über serielle Schnittstelle ausgeben
|
|
|
|
* @param none
|
|
|
|
* @param none
|
|
|
@ -59,10 +67,153 @@ void SerialSetup(void)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void SerialAbout(void)
|
|
|
|
void SerialAbout(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sprintf(sdebug,"%s", CLRSCR);
|
|
|
|
sprintf(out,"%s", CLRSCR);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
SerialWriteString(out);
|
|
|
|
sprintf(sdebug,"%s %s %s\r\n\r\n",PRG,VER,CALL);
|
|
|
|
sprintf(out,"%s %s %s\r\n\r\n",PRG,VER,CALL);
|
|
|
|
SerialWriteString(sdebug);
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SerialReset(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SerialAbout();
|
|
|
|
|
|
|
|
SerialMenue();
|
|
|
|
|
|
|
|
bSerialState.Eingabe = SERMSG0;
|
|
|
|
|
|
|
|
i = 0;
|
|
|
|
|
|
|
|
o = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SerialReceive(char c)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// CTRL Steuercodes
|
|
|
|
|
|
|
|
if(c == 0x1a) SerialReset();
|
|
|
|
|
|
|
|
if(c == 0x03) SerialReset();
|
|
|
|
|
|
|
|
switch(bSerialState.Ausgabe)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case SERMENUE:
|
|
|
|
|
|
|
|
switch(c)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case 0x30:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x31:
|
|
|
|
|
|
|
|
SerialSetup();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x32:
|
|
|
|
|
|
|
|
bState.WriteMsgEEprom = 2;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x33:
|
|
|
|
|
|
|
|
SerialMsgOut();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x34:
|
|
|
|
|
|
|
|
sprintf(out,"%s",CLRSCR);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
SerialWriteString("Welcher Speicher? (1-5)");
|
|
|
|
|
|
|
|
bSerialState.Eingabe = SERMSG0;
|
|
|
|
|
|
|
|
bSerialState.Ausgabe = SERMSGMENUE;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SERMSG:
|
|
|
|
|
|
|
|
SerialReset();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SERSETUP:
|
|
|
|
|
|
|
|
SerialReset();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SERMSGMENUE:
|
|
|
|
|
|
|
|
SerialMsgMenue(c);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
SerialReset();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SerialMsgOut(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
sprintf(out,"%s",CLRSCR);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
SerialWriteString("Textspeicher\r\n\r\n");
|
|
|
|
|
|
|
|
sprintf(out,"1: %s\r\n",bMessage.Msg1);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
sprintf(out,"2: %s\r\n",bMessage.Msg2);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
sprintf(out,"3: %s\r\n",bMessage.Msg3);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
sprintf(out,"4: %s\r\n",bMessage.Msg4);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
sprintf(out,"5: %s\r\n",bMessage.Msg5);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
bSerialState.Ausgabe = SERMSG;
|
|
|
|
|
|
|
|
SerialWriteString("\r\nTaste ...");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SerialMsgMenue(char c)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bSerialState.Ausgabe = SERMSGMENUE;
|
|
|
|
|
|
|
|
if(bSerialState.Eingabe == SERMSG0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
switch(c)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case 0x31:
|
|
|
|
|
|
|
|
sprintf(out,"\r\n%s\r\n",bMessage.Msg1);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
bSerialState.Eingabe = SERMSG1;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x32:
|
|
|
|
|
|
|
|
sprintf(out,"\r\n%s\r\n",bMessage.Msg2);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
bSerialState.Eingabe = SERMSG2;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x33:
|
|
|
|
|
|
|
|
sprintf(out,"\r\n%s\r\n",bMessage.Msg3);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
bSerialState.Eingabe = SERMSG3;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x34:
|
|
|
|
|
|
|
|
sprintf(out,"\r\n%s\r\n",bMessage.Msg4);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
bSerialState.Eingabe = SERMSG4;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x35:
|
|
|
|
|
|
|
|
sprintf(out,"\r\n%s\r\n",bMessage.Msg5);
|
|
|
|
|
|
|
|
SerialWriteString(out);
|
|
|
|
|
|
|
|
bSerialState.Eingabe = SERMSG5;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
i = 0; inp[i] = 0x00;
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
if(bSerialState.Eingabe > SERMSG0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(c == '\r')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SerialWriteString("\r\n\r\nOk! Druecke ESC\r\n");
|
|
|
|
|
|
|
|
bState.WriteMsgEEprom = 1;
|
|
|
|
|
|
|
|
inp[i] = 0x00;
|
|
|
|
|
|
|
|
switch(bSerialState.Eingabe)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case SERMSG1:
|
|
|
|
|
|
|
|
sprintf(bMessage.Msg1,"%s",inp);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SERMSG2:
|
|
|
|
|
|
|
|
sprintf(bMessage.Msg2,"%s",inp);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SERMSG3:
|
|
|
|
|
|
|
|
sprintf(bMessage.Msg3,"%s",inp);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SERMSG4:
|
|
|
|
|
|
|
|
sprintf(bMessage.Msg4,"%s",inp);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SERMSG5:
|
|
|
|
|
|
|
|
sprintf(bMessage.Msg5,"%s",inp);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (c == 0x08) {
|
|
|
|
|
|
|
|
if(i > 0) i--;
|
|
|
|
|
|
|
|
SerialWriteChar(0x7f);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if(i < 60)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if((c > 96) && (c < 123))
|
|
|
|
|
|
|
|
c = c - 32;
|
|
|
|
|
|
|
|
inp[i++] = c;
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
SerialWriteChar(0x08);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(c == 0x1b) SerialReset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|