Skip to content

Commit

Permalink
Fix Buzzer (pin) init for uninitialized FastIO (MarlinFirmware#19559)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhapsodyv authored and vgadreau committed Dec 9, 2020
1 parent 89bc1d3 commit 83a1c07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,11 @@ void setup() {
SERIAL_ECHO_MSG("Compiled: " __DATE__);
SERIAL_ECHO_MSG(STR_FREE_MEMORY, freeMemory(), STR_PLANNER_BUFFER_BYTES, (int)sizeof(block_t) * (BLOCK_BUFFER_SIZE));

// Init buzzer pin(s)
#if USE_BEEPER
SETUP_RUN(buzzer.init());
#endif

// Set up LEDs early
#if HAS_COLOR_LEDS
SETUP_RUN(leds.setup());
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/libs/buzzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@

public:
/**
* @brief Class constructor
* @brief Init Buzzer
*/
Buzzer() {
static inline void init() {
SET_OUTPUT(BEEPER_PIN);
reset();
}
Expand Down

0 comments on commit 83a1c07

Please sign in to comment.