Cleanup, apply standards to SD lib, cardreader

This commit is contained in:
Scott Lahteine
2017-11-14 22:48:40 -06:00
parent d8b1343279
commit 2390f6d3ab
15 changed files with 1439 additions and 1752 deletions

View File

@@ -26,13 +26,15 @@
*
* This file is part of the Arduino Sd2Card Library
*/
#include "Marlin.h"
#include "MarlinConfig.h"
#if ENABLED(SDSUPPORT)
#include "SdFatUtil.h"
//------------------------------------------------------------------------------
/** Amount of free RAM
#include "SdFatUtil.h"
#include "serial.h"
/**
* Amount of free RAM
* \return The number of free bytes.
*/
#ifdef __arm__
@@ -44,7 +46,8 @@ int SdFatUtil::FreeRam() {
#else // __arm__
extern char* __brkval;
extern char __bss_end;
/** Amount of free RAM
/**
* Amount of free RAM
* \return The number of free bytes.
*/
int SdFatUtil::FreeRam() {
@@ -53,8 +56,8 @@ int SdFatUtil::FreeRam() {
}
#endif // __arm
//------------------------------------------------------------------------------
/** %Print a string in flash memory.
/**
* %Print a string in flash memory.
*
* \param[in] pr Print object for output.
* \param[in] str Pointer to string stored in flash memory.
@@ -62,30 +65,27 @@ int SdFatUtil::FreeRam() {
void SdFatUtil::print_P(PGM_P str) {
for (uint8_t c; (c = pgm_read_byte(str)); str++) MYSERIAL.write(c);
}
//------------------------------------------------------------------------------
/** %Print a string in flash memory followed by a CR/LF.
/**
* %Print a string in flash memory followed by a CR/LF.
*
* \param[in] pr Print object for output.
* \param[in] str Pointer to string stored in flash memory.
*/
void SdFatUtil::println_P(PGM_P str) {
print_P(str);
MYSERIAL.println();
}
//------------------------------------------------------------------------------
/** %Print a string in flash memory to Serial.
void SdFatUtil::println_P(PGM_P str) { print_P(str); MYSERIAL.println(); }
/**
* %Print a string in flash memory to Serial.
*
* \param[in] str Pointer to string stored in flash memory.
*/
void SdFatUtil::SerialPrint_P(PGM_P str) {
print_P(str);
}
//------------------------------------------------------------------------------
/** %Print a string in flash memory to Serial followed by a CR/LF.
void SdFatUtil::SerialPrint_P(PGM_P str) { print_P(str); }
/**
* %Print a string in flash memory to Serial followed by a CR/LF.
*
* \param[in] str Pointer to string stored in flash memory.
*/
void SdFatUtil::SerialPrintln_P(PGM_P str) {
println_P(str);
}
#endif
void SdFatUtil::SerialPrintln_P(PGM_P str) { println_P(str); }
#endif // SDSUPPORT