|
|
@@ -176,7 +176,7 @@ class CycleEngine {
|
|
|
// epaper_spi trace on the same panel. Bulk plane data isn't logged
|
|
|
// here (see step_write_plane_) - only the command skeleton matters for
|
|
|
// that comparison.
|
|
|
- char buf[32];
|
|
|
+ char buf[32] = {0};
|
|
|
int n = 0;
|
|
|
for (uint8_t i = 0; i < data_len && n < (int) sizeof(buf) - 3; i++)
|
|
|
n += snprintf(buf + n, sizeof(buf) - n, "%02X ", data[i]);
|
|
|
@@ -242,9 +242,23 @@ class CycleEngine {
|
|
|
|
|
|
void step_write_plane_() {
|
|
|
if (this->cursor_ == 0) {
|
|
|
- ESP_LOGD("gxepd2", "plane %u: cmd 0x%02X, %u bytes, invert=%d", this->plane_,
|
|
|
- this->desc_->plane_write_cmd[this->plane_], (unsigned) this->plane_bytes_,
|
|
|
- this->desc_->plane_invert[this->plane_]);
|
|
|
+ const uint8_t *buf = this->planes_[this->plane_];
|
|
|
+ uint32_t histo[3] = {0, 0, 0}; // [0]=0x00, [1]=0xFF, [2]=other
|
|
|
+ if (buf != nullptr) {
|
|
|
+ for (uint32_t i = 0; i < this->plane_bytes_; i++) {
|
|
|
+ if (buf[i] == 0x00)
|
|
|
+ histo[0]++;
|
|
|
+ else if (buf[i] == 0xFF)
|
|
|
+ histo[1]++;
|
|
|
+ else
|
|
|
+ histo[2]++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ESP_LOGD("gxepd2", "plane %u: cmd 0x%02X, %u bytes, invert=%d, buf[0]=0x%02X buf[last]=0x%02X, histo(00/FF/other)=%u/%u/%u",
|
|
|
+ this->plane_, this->desc_->plane_write_cmd[this->plane_], (unsigned) this->plane_bytes_,
|
|
|
+ this->desc_->plane_invert[this->plane_], buf != nullptr ? buf[0] : 0,
|
|
|
+ buf != nullptr ? buf[this->plane_bytes_ - 1] : 0, (unsigned) histo[0], (unsigned) histo[1],
|
|
|
+ (unsigned) histo[2]);
|
|
|
this->write_byte_(this->desc_->plane_write_cmd[this->plane_], false);
|
|
|
}
|
|
|
const uint8_t *buf = this->planes_[this->plane_];
|