🎨 Minor HAL cleanup
This commit is contained in:
@@ -44,25 +44,6 @@
|
||||
#endif
|
||||
USBSerialType USBSerial(false, SerialUSB);
|
||||
|
||||
// ------------------------
|
||||
// Class Utilities
|
||||
// ------------------------
|
||||
|
||||
#define __bss_end _ebss
|
||||
|
||||
extern "C" {
|
||||
extern char __bss_end;
|
||||
extern char __heap_start;
|
||||
extern void* __brkval;
|
||||
|
||||
// Doesn't work on Teensy 4.x
|
||||
uint32_t freeMemory() {
|
||||
uint32_t free_memory;
|
||||
free_memory = ((uint32_t)&free_memory) - (((uint32_t)__brkval) ?: ((uint32_t)&__bss_end));
|
||||
return free_memory;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// FastIO
|
||||
// ------------------------
|
||||
@@ -97,7 +78,9 @@ void MarlinHAL::clear_reset_source() {
|
||||
SRC_SRSR = reset_source;
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// ADC
|
||||
// ------------------------
|
||||
|
||||
int8_t MarlinHAL::adc_select;
|
||||
|
||||
@@ -180,4 +163,23 @@ uint16_t MarlinHAL::adc_value() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
#define __bss_end _ebss
|
||||
|
||||
extern "C" {
|
||||
extern char __bss_end;
|
||||
extern char __heap_start;
|
||||
extern void* __brkval;
|
||||
|
||||
// Doesn't work on Teensy 4.x
|
||||
uint32_t freeMemory() {
|
||||
uint32_t free_memory;
|
||||
free_memory = ((uint32_t)&free_memory) - (((uint32_t)__brkval) ?: ((uint32_t)&__bss_end));
|
||||
return free_memory;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __IMXRT1062__
|
||||
|
@@ -140,7 +140,7 @@ typedef int8_t pin_t;
|
||||
bool is_output(pin_t pin);
|
||||
|
||||
// ------------------------
|
||||
// Class Utilities
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
|
Reference in New Issue
Block a user