Skip to content
Snippets Groups Projects
Commit 784778f6 authored by RobertPatzke's avatar RobertPatzke
Browse files

Update 20230926 TestSerial mit Strings

parent 99b27243
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "nRF52840SerE.h" #include "nRF52840SerE.h"
#include "ComRingBuf.h" #include "ComRingBuf.h"
#define TmpVerMsg "Version 20230923-10 " #define TmpVerMsg "Version 20230925-4 "
#ifdef DebugTerminal #ifdef DebugTerminal
// **************************************************************************** // ****************************************************************************
...@@ -36,6 +36,7 @@ void smPutCharRB(); ...@@ -36,6 +36,7 @@ void smPutCharRB();
void smReadPtrRB(); void smReadPtrRB();
void smGetCntIntSer(); void smGetCntIntSer();
void smReadAllRB(); void smReadAllRB();
void smWriteStrRB();
#endif #endif
......
...@@ -303,6 +303,7 @@ char *smCheckRBHelp = ...@@ -303,6 +303,7 @@ char *smCheckRBHelp =
"B Zeichen in P2 eingeben\r\n" "B Zeichen in P2 eingeben\r\n"
"I Anzahl der Interrupts anzeigen\r\n" "I Anzahl der Interrupts anzeigen\r\n"
"R Inhalte der Empfangspuffer auslesen\r\n" "R Inhalte der Empfangspuffer auslesen\r\n"
"Sx String in Px eingeben\r\n"
"Z Zeiger/Index der Ringpuffer anzeigen\r\n" "Z Zeiger/Index der Ringpuffer anzeigen\r\n"
}; };
...@@ -340,6 +341,11 @@ void smCheckRB() ...@@ -340,6 +341,11 @@ void smCheckRB()
sm.userVar = 1; sm.userVar = 1;
sm.enter(smReadAllRB); sm.enter(smReadAllRB);
} }
else if(mon.lastKeyIn == 'S' || mon.lastKeyIn == 's')
{
sm.userVar = 0;
sm.enter(smWriteStrRB);
}
else if(mon.lastKeyIn == 'Z' || mon.lastKeyIn == 'z') else if(mon.lastKeyIn == 'Z' || mon.lastKeyIn == 'z')
{ {
sm.userVar = 1; sm.userVar = 1;
...@@ -454,5 +460,48 @@ void smReadAllRB() ...@@ -454,5 +460,48 @@ void smReadAllRB()
sm.userVar++; sm.userVar++;
} }
char smWrStNr;
void smWriteStrRB()
{
if(sm.firstEnter())
{
mon.print((char *) "String (Endezeichen TAB) eingeben für Puffer ");
}
if(mon.lastKeyIn == ':') return;
if(sm.userVar < 1)
{
if(mon.lastKeyIn < '1' || mon.lastKeyIn > '2') return;
smWrStNr = mon.lastKeyIn;
mon.cprint(smWrStNr);
mon.cprint(':');
mon.cprint(' ');
sm.userVar++;
mon.lastKeyIn = ':';
return;
}
if(mon.lastKeyIn != '\t')
{
tmpCharBuf[sm.userVar - 1] = mon.lastKeyIn;
mon.cprint(mon.lastKeyIn);
sm.userVar++;
mon.lastKeyIn = ':';
return;
}
tmpCharBuf[sm.userVar - 1] = '\0';
if(smWrStNr == '1')
crb1.putStr((char *) tmpCharBuf);
else if(smWrStNr == '2')
crb2.putStr((char *) tmpCharBuf);
mon.println();
mon.lastKeyIn = ':';
sm.enter(smCheckRB);
}
#endif // DebugTerminal #endif // DebugTerminal
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment