Echo the result onto serial
Example: MMU2:1111111111111110011 1 means filament present (solid block) 0 means otherwise (dash) Change in memory: Flash: +94 bytes SRAM: 0 bytes
This commit is contained in:
parent
20c6a448fa
commit
7e025894d1
|
|
@ -305,6 +305,7 @@ bool MMU2::VerifyFilamentEnteredPTFE() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Disable_E0();
|
Disable_E0();
|
||||||
|
TryLoadUnloadProgressbarEcho();
|
||||||
TryLoadUnloadProgressbarDeinit();
|
TryLoadUnloadProgressbarDeinit();
|
||||||
|
|
||||||
if (fsensorState) {
|
if (fsensorState) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#include "mmu2.h"
|
#include "mmu2.h"
|
||||||
|
#include "mmu2_log.h"
|
||||||
#include "mmu2_reporting.h"
|
#include "mmu2_reporting.h"
|
||||||
#include "mmu2_error_converter.h"
|
#include "mmu2_error_converter.h"
|
||||||
#include "mmu2/error_codes.h"
|
#include "mmu2/error_codes.h"
|
||||||
|
|
@ -292,6 +293,17 @@ void TryLoadUnloadProgressbarDeinit() {
|
||||||
lcd_reset_status_message_timeout();
|
lcd_reset_status_message_timeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TryLoadUnloadProgressbarEcho() {
|
||||||
|
char buf[LCD_WIDTH];
|
||||||
|
lcd_getstatus(buf);
|
||||||
|
for (uint8_t i = 0; i < sizeof(buf); i++) {
|
||||||
|
// 0xFF is -1 when converting from unsigned to signed char
|
||||||
|
// If the number is negative, that means filament is present
|
||||||
|
buf[i] = (buf[i] < 0) ? '1' : '0';
|
||||||
|
}
|
||||||
|
MMU2_ECHO_MSGLN(buf);
|
||||||
|
}
|
||||||
|
|
||||||
void TryLoadUnloadProgressbar(uint8_t col, bool sensorState) {
|
void TryLoadUnloadProgressbar(uint8_t col, bool sensorState) {
|
||||||
lcd_insert_char_into_status(col, sensorState ? '-' : LCD_STR_SOLID_BLOCK[0]);
|
lcd_insert_char_into_status(col, sensorState ? '-' : LCD_STR_SOLID_BLOCK[0]);
|
||||||
if (!lcd_update_enabled) lcdui_print_status_line();
|
if (!lcd_update_enabled) lcdui_print_status_line();
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,9 @@ void TryLoadUnloadProgressbarInit();
|
||||||
/// @brief Clear the status line and setup the LCD cursor
|
/// @brief Clear the status line and setup the LCD cursor
|
||||||
void TryLoadUnloadProgressbarDeinit();
|
void TryLoadUnloadProgressbarDeinit();
|
||||||
|
|
||||||
|
/// @brief Report the results to serial
|
||||||
|
void TryLoadUnloadProgressbarEcho();
|
||||||
|
|
||||||
/// @brief Add one block to the progress bar
|
/// @brief Add one block to the progress bar
|
||||||
/// @param col pixel position on the LCD status line, should range from 0 to (LCD_WIDTH - 1)
|
/// @param col pixel position on the LCD status line, should range from 0 to (LCD_WIDTH - 1)
|
||||||
/// @param sensorState if true, filament is not present, else filament is present. This controls which character to render
|
/// @param sensorState if true, filament is not present, else filament is present. This controls which character to render
|
||||||
|
|
|
||||||
|
|
@ -7079,6 +7079,10 @@ void lcd_clearstatus()
|
||||||
lcd_status_message_idx = 0;
|
lcd_status_message_idx = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lcd_getstatus(char buf[LCD_WIDTH]) {
|
||||||
|
strncpy(buf, lcd_status_message, LCD_WIDTH);
|
||||||
|
}
|
||||||
|
|
||||||
void lcd_setstatuspgm(const char* message)
|
void lcd_setstatuspgm(const char* message)
|
||||||
{
|
{
|
||||||
if (lcd_message_check(LCD_STATUS_NONE))
|
if (lcd_message_check(LCD_STATUS_NONE))
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,10 @@ void ultralcd_init();
|
||||||
// Set the current status message (equivalent to LCD_STATUS_NONE)
|
// Set the current status message (equivalent to LCD_STATUS_NONE)
|
||||||
void lcdui_print_status_line(void);
|
void lcdui_print_status_line(void);
|
||||||
void lcd_clearstatus();
|
void lcd_clearstatus();
|
||||||
|
|
||||||
|
/// @brief Copy the contents of lcd_status_message
|
||||||
|
/// @param buf destination buffer
|
||||||
|
void lcd_getstatus(char buf[LCD_WIDTH]);
|
||||||
void lcd_insert_char_into_status(uint8_t position, const char message);
|
void lcd_insert_char_into_status(uint8_t position, const char message);
|
||||||
void lcd_setstatus(const char* message);
|
void lcd_setstatus(const char* message);
|
||||||
void lcd_setstatuspgm(const char* message);
|
void lcd_setstatuspgm(const char* message);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue