ESP32 console
This commit is contained in:
parent
14bd8b3625
commit
fa6ed0ca1f
3 changed files with 8 additions and 5 deletions
|
@ -26,7 +26,7 @@ int console_esp32::wait_for_char(const int timeout)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void console_esp32::put_char(const char c)
|
void console_esp32::put_char_ll(const char c)
|
||||||
{
|
{
|
||||||
Serial.print(c);
|
Serial.print(c);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,11 +8,11 @@ class console_esp32 : public console
|
||||||
protected:
|
protected:
|
||||||
int wait_for_char(const int timeout) override;
|
int wait_for_char(const int timeout) override;
|
||||||
|
|
||||||
|
void put_char_ll(const char c) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
console_esp32(std::atomic_bool *const terminate);
|
console_esp32(std::atomic_bool *const terminate);
|
||||||
virtual ~console_esp32();
|
virtual ~console_esp32();
|
||||||
|
|
||||||
void put_char(const char c) override;
|
|
||||||
|
|
||||||
void resize_terminal() override;
|
void resize_terminal() override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -17,9 +18,11 @@ console::console(std::atomic_bool *const terminate) :
|
||||||
|
|
||||||
console::~console()
|
console::~console()
|
||||||
{
|
{
|
||||||
th->join();
|
if (th) {
|
||||||
|
th->join();
|
||||||
|
|
||||||
delete th;
|
delete th;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool console::poll_char()
|
bool console::poll_char()
|
||||||
|
|
Loading…
Add table
Reference in a new issue