Skip to content

Commit 821cdc9

Browse files
committed
Change dither buffer location to PSRAM
1 parent 76e611e commit 821cdc9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/graphics/Image/Image.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@
1818
#include "Inkplate.h"
1919
#ifndef USE_COLOR_IMAGE
2020
#include "Image.h"
21-
#include "TJpeg/TJpg_Decoder.h"
21+
#include "../TJpeg/TJpg_Decoder.h"
2222
#include "pgmspace.h"
2323

2424

2525
Image *_imagePtrJpeg = nullptr;
2626
Image *_imagePtrPng = nullptr;
2727

28-
uint8_t (*Image::ditherBuffer)[E_INK_WIDTH + 20] = nullptr;
29-
uint8_t (*Image::jpegDitherBuffer)[18] = nullptr;
28+
//uint8_t (*Image::ditherBuffer)[E_INK_WIDTH + 20] = nullptr;
29+
__attribute__((section(".ext_ram.bss")))uint8_t Image::ditherBuffer[2][E_INK_WIDTH + 20];
30+
__attribute__((section(".ext_ram.bss")))uint8_t Image::jpegDitherBuffer[18][18];
31+
//uint8_t (*Image::jpegDitherBuffer)[18] = nullptr;
3032
uint8_t *Image::pixelBuffer = nullptr;
3133
uint32_t *Image::ditherPalette = nullptr;
3234
uint8_t *Image::palette = nullptr;
@@ -38,10 +40,10 @@ void Image::begin(Inkplate *inkplateptr)
3840
_imagePtrPng = this;
3941

4042

41-
jpegDitherBuffer = (uint8_t (*)[18])heap_caps_calloc(18, 18, MALLOC_CAP_SPIRAM);
43+
//jpegDitherBuffer = (uint8_t (*)[18])heap_caps_calloc(18, 18, MALLOC_CAP_SPIRAM);
4244

4345

44-
ditherBuffer = (uint8_t (*)[E_INK_WIDTH + 20])heap_caps_calloc(2, (E_INK_WIDTH + 20), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
46+
//ditherBuffer = (uint8_t (*)[E_INK_WIDTH + 20])heap_caps_calloc(2, (E_INK_WIDTH + 20), MALLOC_CAP_SPIRAM);
4547

4648

4749
pixelBuffer = (uint8_t *)heap_caps_calloc(1, (E_INK_WIDTH * 4 + 5), MALLOC_CAP_SPIRAM);

src/graphics/Image/Image.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ class Image
117117
private:
118118

119119
static uint8_t *pixelBuffer;
120-
static uint8_t (*jpegDitherBuffer)[18];
121-
static uint8_t (*ditherBuffer)[E_INK_WIDTH + 20];
120+
static uint8_t jpegDitherBuffer[18][18];
121+
static uint8_t ditherBuffer[2][E_INK_WIDTH + 20];
122122
static uint32_t* ditherPalette; // 8 bit colors, in color, 3x8 bit colors
123123
static uint8_t* palette; // 2 3 bit colors per byte, _###_###
124124

0 commit comments

Comments
 (0)