screen refresh & work on sd-card
This commit is contained in:
parent
f12c0f5b53
commit
4c5aa67280
3 changed files with 19 additions and 8 deletions
|
@ -43,15 +43,18 @@ console_shabadge::~console_shabadge()
|
||||||
|
|
||||||
void console_shabadge::put_char_ll(const char c)
|
void console_shabadge::put_char_ll(const char c)
|
||||||
{
|
{
|
||||||
|
screen_updated_ts = millis();
|
||||||
screen_updated = true;
|
screen_updated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void console_shabadge::panel_update_thread()
|
void console_shabadge::panel_update_thread()
|
||||||
{
|
{
|
||||||
for(;;) {
|
for(;;) {
|
||||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_RATE_MS);
|
||||||
|
|
||||||
|
if (screen_updated && millis() - screen_updated_ts >= 1000) {
|
||||||
|
screen_updated = false;
|
||||||
|
|
||||||
if (screen_updated.exchange(false)) {
|
|
||||||
paint->Clear(UNCOLORED);
|
paint->Clear(UNCOLORED);
|
||||||
|
|
||||||
for(int y=0; y<t_height; y++) {
|
for(int y=0; y<t_height; y++) {
|
||||||
|
|
|
@ -16,6 +16,7 @@ private:
|
||||||
Paint *paint { nullptr };
|
Paint *paint { nullptr };
|
||||||
Epd epd;
|
Epd epd;
|
||||||
|
|
||||||
|
std::atomic_int screen_updated_ts { 0 };
|
||||||
std::atomic_bool screen_updated { false };
|
std::atomic_bool screen_updated { false };
|
||||||
|
|
||||||
void put_char_ll(const char c) override;
|
void put_char_ll(const char c) override;
|
||||||
|
|
|
@ -286,8 +286,13 @@ std::optional<std::pair<std::vector<disk_backend *>, std::vector<disk_backend *>
|
||||||
|
|
||||||
c->put_string_lf("Files on SD-card:");
|
c->put_string_lf("Files on SD-card:");
|
||||||
|
|
||||||
|
#if defined(SHA2017)
|
||||||
|
if (!sd.begin(21, SD_SCK_MHZ(10)))
|
||||||
|
sd.initErrorHalt();
|
||||||
|
#else
|
||||||
if (!sd.begin(SS, SD_SCK_MHZ(15)))
|
if (!sd.begin(SS, SD_SCK_MHZ(15)))
|
||||||
sd.initErrorHalt();
|
sd.initErrorHalt();
|
||||||
|
#endif
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
sd.ls("/", LS_DATE | LS_SIZE | LS_R);
|
sd.ls("/", LS_DATE | LS_SIZE | LS_R);
|
||||||
|
@ -352,7 +357,7 @@ void set_disk_configuration(std::pair<std::vector<disk_backend *>, std::vector<d
|
||||||
void configure_disk(console *const c)
|
void configure_disk(console *const c)
|
||||||
{
|
{
|
||||||
for(;;) {
|
for(;;) {
|
||||||
Serial.println(F("Load disk"));
|
c->put_string_lf("Load disk");
|
||||||
|
|
||||||
auto backend = select_disk_backend(cnsl);
|
auto backend = select_disk_backend(cnsl);
|
||||||
|
|
||||||
|
@ -548,6 +553,8 @@ void setup()
|
||||||
Serial.flush();
|
Serial.flush();
|
||||||
|
|
||||||
cnsl->start_thread();
|
cnsl->start_thread();
|
||||||
|
|
||||||
|
cnsl->put_string_lf("PDP-11/70 emulator, (C) Folkert van Heusden");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
|
|
Loading…
Add table
Reference in a new issue