fix buffer size bug (#1747)

* fix buffer size bug

* faster file over usbcdc - wip

* minimal faster display tx
This commit is contained in:
Totoo 2024-01-09 18:30:43 +01:00 committed by GitHub
parent ad94ae05c1
commit 0e6f303eec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 19 deletions

View file

@ -241,18 +241,17 @@ static void cmd_screenframeshort(BaseSequentialStream* chp, int argc, char* argv
for (int y = 0; y < ui::screen_height; y++) {
std::array<ui::ColorRGB888, ui::screen_width> row;
portapack::display.read_pixels({0, y, ui::screen_width, 1}, row);
for (int px = 0; px < ui::screen_width; px += 60) {
char buffer[60];
for (int i = 0; i < 60; ++i) {
buffer[i] = getChrFromRgb(row[px + i].r, row[px + i].g, row[px + i].b);
}
fillOBuffer(&((SerialUSBDriver*)chp)->oqueue, (const uint8_t*)buffer, 60);
char buffer[242];
for (int i = 0; i < 240; ++i) {
buffer[i] = getChrFromRgb(row[i].r, row[i].g, row[i].b);
}
chprintf(chp, "\r\n");
buffer[240] = '\r';
buffer[241] = '\n';
fillOBuffer(&((SerialUSBDriver*)chp)->oqueue, (const uint8_t*)buffer, 242);
}
evtd->exit_shell_working_mode();
chprintf(chp, "ok\r\n");
chprintf(chp, "\r\nok\r\n");
}
static void cmd_write_memory(BaseSequentialStream* chp, int argc, char* argv[]) {