Formatting

This commit is contained in:
Neil 2024-03-16 16:39:26 +01:00 committed by NeilSCGH
parent a4e9dfd4bf
commit 58b0d28904

View file

@ -235,8 +235,7 @@ void WaveshareEPaper7C::fill(Color color) {
// | byte 1 | byte 2 | byte 3 | // | byte 1 | byte 2 | byte 3 |
// |aaabbbaa|abbbaaab|bbaaabbb| // |aaabbbaa|abbbaaab|bbaaabbb|
buffer[buffer_pos + 0] = pixel_color << 5 | pixel_color << 2 | pixel_color >> 1; buffer[buffer_pos + 0] = pixel_color << 5 | pixel_color << 2 | pixel_color >> 1;
buffer[buffer_pos + 1] = buffer[buffer_pos + 1] = pixel_color << 7 | pixel_color << 4 | pixel_color << 1 | pixel_color >> 2;
pixel_color << 7 | pixel_color << 4 | pixel_color << 1 | pixel_color >> 2;
buffer[buffer_pos + 2] = pixel_color << 6 | pixel_color << 3 | pixel_color << 0; buffer[buffer_pos + 2] = pixel_color << 6 | pixel_color << 3 | pixel_color << 0;
} }
App.feed_wdt(); App.feed_wdt();
@ -2617,9 +2616,8 @@ void HOT WaveshareEPaper7P3InF::display() {
uint8_t byte_to_send; uint8_t byte_to_send;
for (auto &buffer : this->buffers_) { for (auto &buffer : this->buffers_) {
for (uint32_t buffer_pos = 0; buffer_pos < small_buffer_length; buffer_pos += 3) { for (uint32_t buffer_pos = 0; buffer_pos < small_buffer_length; buffer_pos += 3) {
std::bitset<24> triplet = buffer[buffer_pos + 0] << 16 | std::bitset<24> triplet =
buffer[buffer_pos + 1] << 8 | buffer[buffer_pos + 0] << 16 | buffer[buffer_pos + 1] << 8 | buffer[buffer_pos + 2] << 0;
buffer[buffer_pos + 2] << 0;
// 8 bitset<3> are stored in 3 bytes // 8 bitset<3> are stored in 3 bytes
// |aaabbbaa|abbbaaab|bbaaabbb| // |aaabbbaa|abbbaaab|bbaaabbb|
// | byte 1 | byte 2 | byte 3 | // | byte 1 | byte 2 | byte 3 |