removed ram cache and access flash lut directly

experimental/st7789-pio
jon 2022-06-17 10:37:54 +01:00
rodzic 1eec6169b3
commit 51ea5034ba
1 zmienionych plików z 2 dodań i 12 usunięć

Wyświetl plik

@ -94,17 +94,6 @@ namespace pimoroni {
void PicoGraphics_PenRGB332::scanline_convert(PenType type, conversion_callback_func callback) {
if(type == PEN_RGB565) {
static RGB565 cache[256];
for(auto i = 0u; i < 256; i++) {
cache[i] = rgb332_to_rgb565_lut[i]; // defined in pico_graphics.hpp
}
// 2ms slower, I swear!
/*
static RGB565 cache[256];
memcpy(cache, rgb332_to_rgb565_lut, 256 * sizeof(RGB565));
*/
// Treat our void* frame_buffer as uint8_t
uint8_t *src = (uint8_t *)frame_buffer;
@ -112,7 +101,8 @@ namespace pimoroni {
uint16_t row_buf[bounds.w];
for(auto y = 0; y < bounds.h; y++) {
for(auto x = 0; x < bounds.w; x++) {
row_buf[x] = cache[*src];
row_buf[x] = rgb332_to_rgb565_lut[*src];
src++;
}
// Callback to the driver with the row data