Skip to content

Commit

Permalink
Trust STM32 gcc versions
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 29, 2021
1 parent be7aab2 commit 82b6044
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
10 changes: 3 additions & 7 deletions Marlin/src/HAL/STM32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,15 @@ void _delay_ms(const int delay);

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

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

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

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

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

void _delay_ms(const int delay);

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

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

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

//
// ADC
Expand Down

0 comments on commit 82b6044

Please sign in to comment.