Safe changes from HAL cleanup

This commit is contained in:
Scott Lahteine
2019-08-28 21:21:38 -05:00
parent 95963121b0
commit 1d8ad7cf71
8 changed files with 36 additions and 25 deletions

View File

@@ -160,9 +160,6 @@ uint8_t HAL_get_reset_source(void);
void _delay_ms(const int delay);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
/*
extern "C" {
int freeMemory(void);
@@ -172,14 +169,17 @@ extern "C" {
extern "C" char* _sbrk(int incr);
/*
static int freeMemory() {
int freeMemory() {
volatile int top;
top = (int)((char*)&top - reinterpret_cast<char*>(_sbrk(0)));
return top;
}
*/
static int freeMemory() {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
static inline int freeMemory(void) {
volatile char top;
return &top - reinterpret_cast<char*>(_sbrk(0));
}