Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/terminal.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef struct
class Terminal: public IPutChar
{
public:
Terminal(uint32_t usart, const TERM_CMD* commands, bool remap = false, bool echo = true);
Terminal(uint32_t usart, const TERM_CMD* commands, bool remap = false, bool echo = true, bool enablefastuart = true);
void SetNodeId(uint8_t id);
void Run();
void PutChar(char c);
Expand Down Expand Up @@ -82,6 +82,7 @@ class Terminal: public IPutChar
char inBuf[bufSize];
char outBuf[2][bufSize]; //double buffering
char args[bufSize];
bool enablefastuart;
};

#endif // TERMINAL_H
13 changes: 9 additions & 4 deletions src/terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Terminal::HwInfo Terminal::hwInfo[] =

Terminal* Terminal::defaultTerminal;

Terminal::Terminal(uint32_t usart, const TERM_CMD* commands, bool remap, bool echo)
Terminal::Terminal(uint32_t usart, const TERM_CMD* commands, bool remap, bool echo, bool enablefastuart)
: usart(usart),
remap(remap),
termCmds(commands),
Expand All @@ -53,7 +53,8 @@ Terminal::Terminal(uint32_t usart, const TERM_CMD* commands, bool remap, bool ec
curBuf(0),
curIdx(0),
firstSend(true),
echo(echo)
echo(echo),
enablefastuart(enablefastuart)
{
//Search info entry
hw = hwInfo;
Expand Down Expand Up @@ -146,8 +147,12 @@ void Terminal::Run()
}
else if (my_strcmp(inBuf, "fastuart") == 0)
{
FastUart(args);
currentIdx = 0;
if (enablefastuart) {
FastUart(args);
} else {
Send("fastuart not available\r\n");
}
currentIdx = 0;
}
else if (my_strcmp(inBuf, "echo") == 0)
{
Expand Down