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