screen refresh & work on sd-card

This commit is contained in:
folkert van heusden 2023-04-01 21:09:10 +02:00
parent f12c0f5b53
commit 4c5aa67280
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1
3 changed files with 19 additions and 8 deletions

View file

@ -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 = true; screen_updated_ts = millis();
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++) {

View file

@ -12,11 +12,12 @@
class console_shabadge : public console_esp32 class console_shabadge : public console_esp32
{ {
private: private:
unsigned char image[4736]; unsigned char image[4736];
Paint *paint { nullptr }; Paint *paint { nullptr };
Epd epd; Epd epd;
std::atomic_bool screen_updated { false }; std::atomic_int screen_updated_ts { 0 };
std::atomic_bool screen_updated { false };
void put_char_ll(const char c) override; void put_char_ll(const char c) override;

View file

@ -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()