Skip to content

Commit b89700e

Browse files
rhapsodyvthinkyhead
authored andcommitted
Fix Buzzer (pin) init for uninitialized FastIO (MarlinFirmware#19559)
1 parent ca853fb commit b89700e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Marlin/src/MarlinCore.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,11 @@ void setup() {
10481048
SERIAL_ECHO_MSG("Compiled: " __DATE__);
10491049
SERIAL_ECHO_MSG(STR_FREE_MEMORY, freeMemory(), STR_PLANNER_BUFFER_BYTES, (int)sizeof(block_t) * (BLOCK_BUFFER_SIZE));
10501050

1051+
// Init buzzer pin(s)
1052+
#if USE_BEEPER
1053+
SETUP_RUN(buzzer.init());
1054+
#endif
1055+
10511056
// Set up LEDs early
10521057
#if HAS_COLOR_LEDS
10531058
SETUP_RUN(leds.setup());

Marlin/src/libs/buzzer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@
8484

8585
public:
8686
/**
87-
* @brief Class constructor
87+
* @brief Init Buzzer
8888
*/
89-
Buzzer() {
89+
static inline void init() {
9090
SET_OUTPUT(BEEPER_PIN);
9191
reset();
9292
}

0 commit comments

Comments
 (0)