Compare commits

...

2 Commits

Author SHA1 Message Date
nopnop2002
8b00a7e705 Flip upside down enabled 2024-09-16 19:13:30 +09:00
nopnop2002
c40aa646aa Changed variable name 2024-09-16 15:24:09 +09:00
3 changed files with 9 additions and 13 deletions

View File

@ -196,13 +196,13 @@ void app_main(void)
}
// Allocate memory for background frame
uint8_t *buffer = (uint8_t *)malloc(1024*4);
if (buffer == NULL) {
uint8_t *background = (uint8_t *)malloc(1024*4);
if (background == NULL) {
ESP_LOGE(TAG, "malloc failed");
while(1) { vTaskDelay(1); }
}
// Allocate memory for background frame
// Allocate memory for balloon frame
uint8_t *balloon = (uint8_t *)malloc(1024);
if (balloon == NULL) {
ESP_LOGE(TAG, "malloc failed");
@ -213,22 +213,22 @@ void app_main(void)
ssd1306_clear_screen(&dev, false);
ssd1306_bitmaps(&dev, 0, 0, cloud11, 64, 32, true);
ssd1306_get_buffer(&dev, &buffer[1024*0]);
ssd1306_get_buffer(&dev, &background[1024*0]);
vTaskDelay(10);
ssd1306_clear_screen(&dev, false);
ssd1306_bitmaps(&dev, 0, 0, cloud12, 64, 32, true);
ssd1306_get_buffer(&dev, &buffer[1024*1]);
ssd1306_get_buffer(&dev, &background[1024*1]);
vTaskDelay(10);
ssd1306_clear_screen(&dev, false);
ssd1306_bitmaps(&dev, 0, 0, cloud13, 64, 32, true);
ssd1306_get_buffer(&dev, &buffer[1024*2]);
ssd1306_get_buffer(&dev, &background[1024*2]);
vTaskDelay(10);
ssd1306_clear_screen(&dev, false);
ssd1306_bitmaps(&dev, 0, 0, cloud14, 64, 32, true);
ssd1306_get_buffer(&dev, &buffer[1024*3]);
ssd1306_get_buffer(&dev, &background[1024*3]);
vTaskDelay(10);
ssd1306_clear_screen(&dev, false);
@ -267,14 +267,14 @@ void app_main(void)
if (page1 < 4) {
for (int seg=0;seg<64;seg++) {
if (seg+segmentOffset1 > 0 && seg+segmentOffset1 < 128)
wk[seg+segmentOffset1] = buffer[page1*128+seg+frameOffset1];
wk[seg+segmentOffset1] = background[page1*128+seg+frameOffset1];
}
}
if (page2 < 4) {
for (int seg=0;seg<64;seg++) {
if (seg+segmentOffset2 > 0 && seg+segmentOffset2 < 128)
wk[seg+segmentOffset2] = buffer[page2*128+seg+frameOffset2];
wk[seg+segmentOffset2] = background[page2*128+seg+frameOffset2];
}
}
ssd1306_set_buffer(&dev, wk);

View File

@ -14,8 +14,6 @@ __Wire cables should be as short as possible.__
I used a 10 cm wire cable.
However, it is sometimes affected by noise.
__Flip upside down cannot be enabled.__
__This demo does not support 128x32 panels.__
The SPI interface operates faster than the I2C interface.

View File

@ -631,12 +631,10 @@ void app_main(void)
spi_master_init(&dev, CONFIG_MOSI_GPIO, CONFIG_SCLK_GPIO, CONFIG_CS_GPIO, CONFIG_DC_GPIO, CONFIG_RESET_GPIO);
#endif // CONFIG_SPI_INTERFACE
#if 0
#if CONFIG_FLIP
dev._flip = true;
ESP_LOGW(TAG, "Flip upside down");
#endif
#endif
#if CONFIG_SSD1306_128x64
ESP_LOGI(TAG, "Panel is 128x64");