12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
-
- #include "Marlin.h"
-
- #ifdef SDSUPPORT
- #include "SdFatUtil.h"
-
-
-
- #ifdef __arm__
- extern "C" char* sbrk(int incr);
- int SdFatUtil::FreeRam() {
- char top;
- return &top - reinterpret_cast<char*>(sbrk(0));
- }
- #else
- extern char *__brkval;
- extern char __bss_end;
-
- int SdFatUtil::FreeRam() {
- char top;
- return __brkval ? &top - __brkval : &top - &__bss_end;
- }
- #endif
-
-
-
- void SdFatUtil::print_P( PGM_P str) {
- for (uint8_t c; (c = pgm_read_byte(str)); str++) MYSERIAL.write(c);
- }
-
-
- void SdFatUtil::println_P( PGM_P str) {
- print_P( str);
- MYSERIAL.println();
- }
-
-
- void SdFatUtil::SerialPrint_P(PGM_P str) {
- print_P(str);
- }
-
-
- void SdFatUtil::SerialPrintln_P(PGM_P str) {
- println_P( str);
- }
- #endif
|