2
$\begingroup$

How can I replace the line in the time display with a dot? Using Marlin 2.1

Photo of LCD display of a 3D printer with the time circled

$\endgroup$

1 Answer 1

1
$\begingroup$

The apostrophe or single quote character is officially used to indicate minutes, if there are two, this indicates seconds (but, in the image from the question, the double quote cannot be seen).

Replacing the single quote for a decimal isn't a good idea to display the time as the following number is in seconds, not a fraction of a minute.

Either way, the remaining time is converted from a number into a human readable format by the toDigital() function of the duration_t.h file (referring to the Marlin 2.1 bugfix branch). Even with little programming skills if is easy to find where and what you want to change ( hint, see comment: // 12'34), the function is quoted for reference below:

uint8_t toDigital(char *buffer, bool with_days=false) const {
    const uint16_t h = uint16_t(this->hour()),
                   m = uint16_t(this->minute() % 60UL);
    if (with_days) {
      const uint16_t d = this->day();
      sprintf_P(buffer, PSTR("%hud %02hu:%02hu"), d, h % 24, m);  // 1d 23:45
      return d >= 10 ? 9 : 8;
    }
    else if (!h) {
      const uint16_t s = uint16_t(this->second() % 60UL);
      sprintf_P(buffer, PSTR("%02hu'%02hu"), m, s);     // 12'34
      return 5;
    }
    else if (h < 100) {
      sprintf_P(buffer, PSTR("%02hu:%02hu"), h, m);     // 12:34
      return 5;
    }
    else {
      sprintf_P(buffer, PSTR("%hu:%02hu"), h, m);       // 123:45
      return 6;
    }
  }
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .