Giter Site home page Giter Site logo

Comments (7)

rttgnck avatar rttgnck commented on September 2, 2024 1

I think I had solved it sometime back and forgot to say something. I'll try to dig back into my code and see what I did or if I left myself any clues

from diy-esp32-epub-reader.

rttgnck avatar rttgnck commented on September 2, 2024 1

I really hope you found a solution and share it

So I will have to look further, possibly fork, and upload my changes.

At first glance, it looks like I rendered a new font.
I also changed a section of the epd_driver.c which is part of the epdiy repo, not this one.
Pretty sure I also changed the font size, or line height, to get a few more words on a page.

In my personal changes I was adding a section page count, and trying to add a bookmark of sorts so when the unit restarts you can jump back to the page you were on (not even close to have that).

It would be a little while before I had a chance to clean up my local copy for a fork.

from diy-esp32-epub-reader.

dronix27 avatar dronix27 commented on September 2, 2024

The same in Cyrillic

from diy-esp32-epub-reader.

dronix27 avatar dronix27 commented on September 2, 2024

I think I had solved it sometime back and forgot to say something. I'll try to dig back into my code and see what I did or if I left myself any clues

I really hope you found a solution and share it

from diy-esp32-epub-reader.

dronix27 avatar dronix27 commented on September 2, 2024

Is the problem still not resolved?

from diy-esp32-epub-reader.

rttgnck avatar rttgnck commented on September 2, 2024

from diy-esp32-epub-reader.

Lefucjusz avatar Lefucjusz commented on September 2, 2024

I've run into the exact same problem on my M5Paper, it looks that the nibbles in each byte sent to the display are swapped. I didn't read very deeply into the code, but it looks that swapping them in epd_driver.c:epd_draw_pixel() resolves the issue. The original code looks like this:

void epd_draw_pixel(int x, int y, uint8_t color, uint8_t *framebuffer) {

  ...some stuff here...

  uint8_t *buf_ptr = &framebuffer[y * EPD_WIDTH / 2 + x / 2];
  if (x % 2) {
    *buf_ptr = (*buf_ptr & 0x0F) | (color & 0xF0);
  } else {
    *buf_ptr = (*buf_ptr & 0xF0) | (color >> 4);
  }
}

Just change the condition to if (!(x % 2)) or exchange the lines between if and else and the image will no longer be weirdly shifted.

from diy-esp32-epub-reader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.