Skip to content

Commit

Permalink
misc. cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Feb 19, 2023
1 parent 109e3cf commit 53a2468
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/AVR/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void MarlinHAL::init() {

init_pwm_timers(); // Init user timers to default frequency - 1000HZ

#if defined(BEEPER_PIN) && !ENABLED(ATMEGA_NO_BEEPFIX)
#if PIN_EXISTS(BEEPER) && ENABLED(HAL_AVR_DIRTY_INIT) && DISABLED(ATMEGA_NO_BEEPFIX)
// Make sure no alternative is locked onto the BEEPER.
// This fixes the issue where the ATmega is constantly beeping.
// Might disable other peripherals using the pin; to circumvent that please undefine one of the above things!
Expand Down
11 changes: 10 additions & 1 deletion Marlin/src/HAL/AVR/registers.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
Expand All @@ -20,6 +20,12 @@
*
*/

#ifdef __AVR__

#include "../../inc/MarlinConfigPre.h"

#if ENABLED(HAL_AVR_DIRTY_INIT)

#include "registers.h"

// Since the compiler could be creating multiple copies of function code-graphs for each header inline-inclusion,
Expand Down Expand Up @@ -968,3 +974,6 @@ ATmegaPinFunctions _ATmega_getPinFunctions(int pin) {

return ATmegaPinFunctions(); // default and empty.
}

#endif // HAL_AVR_DIRTY_INIT
#endif // __AVR__
3 changes: 1 addition & 2 deletions Marlin/src/HAL/AVR/registers.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
Expand All @@ -19,7 +19,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

#pragma once

#include <stdint.h>
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/lcd/dogm/status_screen_DOGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,9 @@ void MarlinUI::draw_status_screen() {

const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive());

static u8g_uint_t progress_bar_solid_width = 0;
#if HAS_PRINT_PROGRESS
static u8g_uint_t progress_bar_solid_width = 0;
#endif

// At the first page, generate new display values
if (first_page) {
Expand Down

0 comments on commit 53a2468

Please sign in to comment.