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