badgeteam / ESP32-platform-firmware

Universal badge platform for ESP32 based devices! Runs on the event badges from SHA2017, HackerHotel 2019, Disobey 2019, CampZone 2019, Disobey 2020 and more!
https://badge.team
39 stars 41 forks source link

Fixed bug where drawRaw only send the first byte was read #219

Closed MaxWinsemius closed 4 years ago

MaxWinsemius commented 4 years ago

The function edited framebuffer_draw_raw calls in driver_framebuffer_setPixel, and passing through the data received, but it only sends the first byte instead of the whole word. As it is simply a cast from an array, it can easily be fixed by casting it to the whole word.

The edit was tested on the Campzone2019 badge, at which it works, but I am unsure if it will fully work with the other badges with different BBP sizes.

renzenicolai commented 4 years ago

This function indeed seems broken in multiple ways. I'm going to have a go at fixing it properly. Thank you for bringing this to my attention ;-)

renzenicolai commented 4 years ago

@MaxWinsemius Please check https://github.com/badgeteam/ESP32-platform-firmware/pull/221 , all framebuffer functions exposed to python use RGB24 color format, regardless of the color format used by the display. I've tried to properly reflect this in the drawRaw function too by having it use 3 bytes per pixel (red, green, blue).

Also: thank you for taking your time fixing bugs in the firmware! :smiley:

renzenicolai commented 4 years ago

Thank you for reporting the issue, I will close this PR for now. A big rewrite of the graphics stack is on the agenda and we will do some major improvements like an actually implemented alpha channel soon(tm). Expect to see this issue properly fixed after those improvements have been implemented.