|
@ -64,6 +64,19 @@ |
|
|
uint8_t MarlinUI::progress_bar_percent; // = 0
|
|
|
uint8_t MarlinUI::progress_bar_percent; // = 0
|
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if HAS_BUZZER |
|
|
|
|
|
#include "../libs/buzzer.h" |
|
|
|
|
|
void MarlinUI::buzz(const long duration, const uint16_t freq) { |
|
|
|
|
|
#if ENABLED(LCD_USE_I2C_BUZZER) |
|
|
|
|
|
lcd.buzz(duration, freq); |
|
|
|
|
|
#elif ENABLED(PCA9632_BUZZER) |
|
|
|
|
|
pca9632_buzz(const long duration, const uint16_t freq) { |
|
|
|
|
|
#elif USE_BEEPER |
|
|
|
|
|
buzzer.tone(duration, freq); |
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#if HAS_SPI_LCD |
|
|
#if HAS_SPI_LCD |
|
|
|
|
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
#if HAS_GRAPHICAL_LCD |
|
@ -89,10 +102,6 @@ |
|
|
#include "../feature/bedlevel/bedlevel.h" |
|
|
#include "../feature/bedlevel/bedlevel.h" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#if HAS_BUZZER |
|
|
|
|
|
#include "../libs/buzzer.h" |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if HAS_TRINAMIC |
|
|
#if HAS_TRINAMIC |
|
|
#include "../feature/tmc_util.h" |
|
|
#include "../feature/tmc_util.h" |
|
|
#endif |
|
|
#endif |
|
@ -568,7 +577,7 @@ void MarlinUI::status_screen() { |
|
|
const millis_t ms = millis(); |
|
|
const millis_t ms = millis(); |
|
|
#endif |
|
|
#endif |
|
|
if (ELAPSED(ms, next_beep)) { |
|
|
if (ELAPSED(ms, next_beep)) { |
|
|
BUZZ(FEEDRATE_CHANGE_BEEP_DURATION, FEEDRATE_CHANGE_BEEP_FREQUENCY); |
|
|
buzz(FEEDRATE_CHANGE_BEEP_DURATION, FEEDRATE_CHANGE_BEEP_FREQUENCY); |
|
|
next_beep = ms + 500UL; |
|
|
next_beep = ms + 500UL; |
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
@ -611,13 +620,12 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { |
|
|
#if HAS_BUZZER |
|
|
#if HAS_BUZZER |
|
|
// Buzz and wait. Is the delay needed for buttons to settle?
|
|
|
// Buzz and wait. Is the delay needed for buttons to settle?
|
|
|
buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); |
|
|
buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); |
|
|
#endif |
|
|
#if HAS_LCD_MENU |
|
|
|
|
|
#if USE_BEEPER |
|
|
#if HAS_LCD_MENU |
|
|
for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } |
|
|
#if ENABLED(LCD_USE_I2C_BUZZER) |
|
|
#else |
|
|
delay(10); |
|
|
delay(10); |
|
|
#elif PIN_EXISTS(BEEPER) |
|
|
#endif |
|
|
for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } |
|
|
|
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
} |
|
|
} |
|
@ -729,16 +737,6 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { |
|
|
|
|
|
|
|
|
LCDViewAction MarlinUI::lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; |
|
|
LCDViewAction MarlinUI::lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; |
|
|
|
|
|
|
|
|
bool MarlinUI::detected() { |
|
|
|
|
|
return |
|
|
|
|
|
#if EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && defined(DETECT_DEVICE) |
|
|
|
|
|
lcd.LcdDetected() == 1 |
|
|
|
|
|
#else |
|
|
|
|
|
true |
|
|
|
|
|
#endif |
|
|
|
|
|
; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MarlinUI::update() { |
|
|
void MarlinUI::update() { |
|
|
|
|
|
|
|
|
static uint16_t max_display_update_time = 0; |
|
|
static uint16_t max_display_update_time = 0; |
|
@ -1295,23 +1293,6 @@ void MarlinUI::update() { |
|
|
#endif // HAS_ENCODER_WHEEL
|
|
|
#endif // HAS_ENCODER_WHEEL
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#if HAS_SLOW_BUTTONS |
|
|
|
|
|
|
|
|
|
|
|
uint8_t MarlinUI::read_slow_buttons() { |
|
|
|
|
|
#if ENABLED(LCD_I2C_TYPE_MCP23017) |
|
|
|
|
|
// Reading these buttons this is likely to be too slow to call inside interrupt context
|
|
|
|
|
|
// so they are called during normal lcd_update
|
|
|
|
|
|
uint8_t slow_bits = lcd.readButtons() << B_I2C_BTN_OFFSET; |
|
|
|
|
|
#if ENABLED(LCD_I2C_VIKI) |
|
|
|
|
|
if ((slow_bits & (B_MI | B_RI)) && PENDING(millis(), next_button_update_ms)) // LCD clicked
|
|
|
|
|
|
slow_bits &= ~(B_MI | B_RI); // Disable LCD clicked buttons if screen is updated
|
|
|
|
|
|
#endif // LCD_I2C_VIKI
|
|
|
|
|
|
return slow_bits; |
|
|
|
|
|
#endif // LCD_I2C_TYPE_MCP23017
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#endif // HAS_ENCODER_ACTION
|
|
|
#endif // HAS_ENCODER_ACTION
|
|
|
|
|
|
|
|
|
#endif // HAS_SPI_LCD
|
|
|
#endif // HAS_SPI_LCD
|
|
|