Skip to content

Commit b9b5e30

Browse files
committed
Trust SdBaseFile::write
1 parent c4040fa commit b9b5e30

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Marlin/src/gcode/eeprom/M500-M504.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void GcodeSuite::M502() {
7373
bool success = true;
7474
for (uint16_t i = 0; success && i < sizeof(mc_zip); ++i) {
7575
const uint8_t c = pgm_read_byte(&mc_zip[i]);
76-
success = (file.write(&c) == 1);
76+
success = file.write(c) > 0;
7777
}
7878
success = file.close() && success;
7979

Marlin/src/sd/SdFile.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ int16_t SdFile::write(const void * const buf, const uint16_t nbyte) { return SdB
6767
* \param[in] b the byte to be written.
6868
* Use writeError to check for errors.
6969
*/
70-
#if ARDUINO >= 100
71-
size_t SdFile::write(const uint8_t b) { return SdBaseFile::write(&b, 1); }
72-
#else
73-
void SdFile::write(const uint8_t b) { SdBaseFile::write(&b, 1); }
74-
#endif
70+
size_t SdFile::write(const uint8_t b) { return SdBaseFile::write(&b, 1); }
7571

7672
/**
7773
* Write a string to a file. Used by the Arduino Print class.

0 commit comments

Comments
 (0)