update code base to Marlin 2.0.9.2
This commit is contained in:
20
Marlin/src/libs/duration_t.h
Executable file → Normal file
20
Marlin/src/libs/duration_t.h
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -106,11 +106,17 @@ struct duration_t {
|
||||
return this->value;
|
||||
}
|
||||
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-overflow"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Formats the duration as a string
|
||||
* @details String will be formated using a "full" representation of duration
|
||||
* @details String will be formatted using a "full" representation of duration
|
||||
*
|
||||
* @param buffer The array pointed to must be able to accommodate 21 bytes
|
||||
* @param buffer The array pointed to must be able to accommodate 22 bytes
|
||||
* (21 for the string, 1 more for the terminating nul)
|
||||
*
|
||||
* Output examples:
|
||||
* 123456789012345678901 (strlen)
|
||||
@@ -127,7 +133,7 @@ struct duration_t {
|
||||
m = this->minute() % 60,
|
||||
s = this->second() % 60;
|
||||
|
||||
if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s);
|
||||
if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s);
|
||||
else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s);
|
||||
else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s);
|
||||
else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s);
|
||||
@@ -137,7 +143,7 @@ struct duration_t {
|
||||
|
||||
/**
|
||||
* @brief Formats the duration as a string
|
||||
* @details String will be formated using a "digital" representation of duration
|
||||
* @details String will be formatted using a "digital" representation of duration
|
||||
*
|
||||
* @param buffer The array pointed to must be able to accommodate 10 bytes
|
||||
*
|
||||
@@ -163,4 +169,8 @@ struct duration_t {
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
};
|
||||
|
Reference in New Issue
Block a user