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.
Dependents: Interference_Simple StrCommandHandler_Demo SerialInputReactionHandler_DEMO
Diff: SerialInputReactionHandler.h
- Revision:
- 1:fd211f137803
- Parent:
- 0:ec916055f0dd
- Child:
- 2:4718a4eaf340
diff -r ec916055f0dd -r fd211f137803 SerialInputReactionHandler.h
--- a/SerialInputReactionHandler.h Tue Nov 12 01:10:29 2019 +0000
+++ b/SerialInputReactionHandler.h Tue Nov 12 02:41:58 2019 +0000
@@ -39,7 +39,7 @@
* or a byte written thru communication with like PCs.
*/
void sig_bind();
-
+
Callback<int (char const * const)> callback_onCommand;
static int echoCommand (char const * const);
@@ -48,6 +48,8 @@
InputMode m_input_mode;
uint8_t m_buffer_c;
string m_buffer_s;
+
+ bool isArrowSymbol();
};
inline int SerialInputReactionHandler::echoCommand (char const * const arg_str)
@@ -55,5 +57,10 @@
printf("%s", arg_str);
return 0;
}
+inline void SerialInputReactionHandler::discardBuffer()
+{
+ m_buffer_c = '\0';
+ m_buffer_s = "";
+}
#endif