Giter Site home page Giter Site logo

Comments (4)

5chufti avatar 5chufti commented on May 30, 2024

at least solve contradiction between configurable lines/columns in config.h (user) and fixed settings in LCDDisplay.h, most 4 line displays have 20 columns...
best would be to take over definitions from config.h

from commandstation-ex.

Neil-McK avatar Neil-McK commented on May 30, 2024

Whilst the 4-line LCD has 20 characters, and 128-column OLED displays are capable of 21 characters, 2-line LCDs are only 16 characters long. So to avoid losing the end of messages off some screens, we limit the length of the messages to 16 characters.
A second option would be to drop support for the LCD1602 display, allowing messages of up to 20 characters.
A third option might be to code short and long versions of messages so that they can be abbreviated when on a 16-character screen, e.g. by marking optional characters with a prefix character. Alternative messages could also be substituted by conditional compilation.
A fourth option is to increase the buffer size to 21 characters per line but retain all standard messages at 16 characters max. This would allow tinkerers to add longer messages if desired.

from commandstation-ex.

5chufti avatar 5chufti commented on May 30, 2024

as I allready wrote: best would be to take over the setting from config.h as there the user has to/is expected to put the actual values of his display after all...
then it is up to the implementation of the "LCD" macro to prevent buffer overflows (cut chars/lines) if the passed text would exeed the defined chars/lines

from commandstation-ex.

Neil-McK avatar Neil-McK commented on May 30, 2024

As of v3.0.5, parameter MAX_MSG_SIZE can be used to allocate buffers for longer lines. This defaults to 16 since all existing messages are designed to fit on a 16 character LCD, so longer buffers would be wasted RAM, particularly on an Uno.

Example for a 132x64 SH1106-based I2C OLED display:

#define MAX_MSG_SIZE 22

Note that this resolves the immediate request by enabling longer messages. However, the wider issue remains, of how to benefit from longer messages without losing information on smaller screens.

from commandstation-ex.

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.