|
@ -40,14 +40,15 @@ uint16_t MarlinHAL::adc_result; |
|
|
// Public functions
|
|
|
// Public functions
|
|
|
// ------------------------
|
|
|
// ------------------------
|
|
|
|
|
|
|
|
|
TERN_(POSTMORTEM_DEBUGGING, extern void install_min_serial()); |
|
|
#if ENABLED(POSTMORTEM_DEBUGGING) |
|
|
|
|
|
extern void install_min_serial(); |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
void MarlinHAL::init() { |
|
|
void MarlinHAL::init() { |
|
|
// Initialize the USB stack
|
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
#if ENABLED(SDSUPPORT) |
|
|
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
|
|
|
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
|
|
|
#endif |
|
|
#endif |
|
|
usb_task_init(); |
|
|
usb_task_init(); // Initialize the USB stack
|
|
|
TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); // Install the min serial handler
|
|
|
TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); // Install the min serial handler
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -72,6 +73,10 @@ uint8_t MarlinHAL::get_reset_source() { |
|
|
|
|
|
|
|
|
void MarlinHAL::reboot() { rstc_start_software_reset(RSTC); } |
|
|
void MarlinHAL::reboot() { rstc_start_software_reset(RSTC); } |
|
|
|
|
|
|
|
|
|
|
|
// ------------------------
|
|
|
|
|
|
// Free Memory Accessor
|
|
|
|
|
|
// ------------------------
|
|
|
|
|
|
|
|
|
extern "C" { |
|
|
extern "C" { |
|
|
extern unsigned int _ebss; // end of bss section
|
|
|
extern unsigned int _ebss; // end of bss section
|
|
|
} |
|
|
} |
|
@ -82,6 +87,10 @@ int freeMemory() { |
|
|
return (int)&free_memory - (heap_end ?: (int)&_ebss); |
|
|
return (int)&free_memory - (heap_end ?: (int)&_ebss); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ------------------------
|
|
|
|
|
|
// Serial Ports
|
|
|
|
|
|
// ------------------------
|
|
|
|
|
|
|
|
|
// Forward the default serial ports
|
|
|
// Forward the default serial ports
|
|
|
#if USING_HW_SERIAL0 |
|
|
#if USING_HW_SERIAL0 |
|
|
DefaultSerial1 MSerial0(false, Serial); |
|
|
DefaultSerial1 MSerial0(false, Serial); |
|
|