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)
|
||||
{
|
||||
screen_updated = true;
|
||||
screen_updated_ts = millis();
|
||||
screen_updated = true;
|
||||
}
|
||||
|
||||
void console_shabadge::panel_update_thread()
|
||||
{
|
||||
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);
|
||||
|
||||
for(int y=0; y<t_height; y++) {
|
||||
|
|
|
@ -12,11 +12,12 @@
|
|||
class console_shabadge : public console_esp32
|
||||
{
|
||||
private:
|
||||
unsigned char image[4736];
|
||||
Paint *paint { nullptr };
|
||||
Epd epd;
|
||||
unsigned char image[4736];
|
||||
Paint *paint { nullptr };
|
||||
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;
|
||||
|
||||
|
|
|
@ -286,8 +286,13 @@ std::optional<std::pair<std::vector<disk_backend *>, std::vector<disk_backend *>
|
|||
|
||||
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)))
|
||||
sd.initErrorHalt();
|
||||
#endif
|
||||
|
||||
for(;;) {
|
||||
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)
|
||||
{
|
||||
for(;;) {
|
||||
Serial.println(F("Load disk"));
|
||||
c->put_string_lf("Load disk");
|
||||
|
||||
auto backend = select_disk_backend(cnsl);
|
||||
|
||||
|
@ -548,6 +553,8 @@ void setup()
|
|||
Serial.flush();
|
||||
|
||||
cnsl->start_thread();
|
||||
|
||||
cnsl->put_string_lf("PDP-11/70 emulator, (C) Folkert van Heusden");
|
||||
}
|
||||
|
||||
void loop()
|
||||
|
|
Loading…
Add table
Reference in a new issue