Skip to content

Commit

Permalink
Reduce warnings, extern "C" cleanup (MarlinFirmware#20279)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and zillarob committed Feb 25, 2021
1 parent 54f1f34 commit 3aa17d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions Marlin/src/HAL/STM32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,19 @@ void _delay_ms(const int delay);

extern "C" char* _sbrk(int incr);

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

static inline int freeMemory() {
volatile char top;
return &top - reinterpret_cast<char*>(_sbrk(0));
}

#pragma GCC diagnostic pop
#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif

//
// ADC
Expand Down
10 changes: 7 additions & 3 deletions Marlin/src/HAL/STM32F1/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader

void _delay_ms(const int delay);

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

/*
extern "C" {
Expand All @@ -215,7 +217,9 @@ static inline int freeMemory() {
return &top - _sbrk(0);
}

#pragma GCC diagnostic pop
#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif

//
// ADC
Expand Down

0 comments on commit 3aa17d6

Please sign in to comment.