Include days in Graphical LCD print timer
This commit is contained in:
@ -141,14 +141,16 @@ struct duration_t {
|
||||
* @param buffer The array pointed to must be able to accommodate 10 bytes
|
||||
*
|
||||
* Output examples:
|
||||
* 1234567890 (strlen)
|
||||
* 1193046:59
|
||||
* 123456789 (strlen)
|
||||
* 99:59
|
||||
* 11d 12:33
|
||||
*/
|
||||
void toDigital(char *buffer) const {
|
||||
int h = this->hour(),
|
||||
m = this->minute() % 60;
|
||||
|
||||
sprintf_P(buffer, PSTR("%02i:%02i"), h, m);
|
||||
void toDigital(char *buffer, bool with_days=false) const {
|
||||
int m = this->minute() % 60;
|
||||
if (with_days)
|
||||
sprintf_P(buffer, PSTR("%id %02i:%02i"), this->day(), this->hour() % 24, m);
|
||||
else
|
||||
sprintf_P(buffer, PSTR("%02i:%02i"), this->hour(), m);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user