M73 remaining time for MKS UI (#18326)

This commit is contained in:
Anton Skorochod 2020-06-16 21:33:17 +02:00 committed by GitHub
parent 1c13428d84
commit 0b30de1b8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,6 +39,9 @@
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
#include "../../../../feature/powerloss.h" #include "../../../../feature/powerloss.h"
#endif #endif
#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
#include "../../../ultralcd.h"
#endif
static lv_obj_t * scr; static lv_obj_t * scr;
static lv_obj_t * labelExt1, * labelExt2, * labelFan, * labelZpos, * labelTime; static lv_obj_t * labelExt1, * labelExt2, * labelFan, * labelZpos, * labelTime;
@ -364,7 +367,12 @@ void disp_fan_speed() {
void disp_print_time() { void disp_print_time() {
memset(public_buf_l, 0, sizeof(public_buf_l)); memset(public_buf_l, 0, sizeof(public_buf_l));
sprintf(public_buf_l, "%d%d:%d%d:%d%d", print_time.hours / 10, print_time.hours % 10, print_time.minutes / 10, print_time.minutes % 10, print_time.seconds / 10, print_time.seconds % 10); #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
const uint32_t r = ui.get_remaining_time();
sprintf(public_buf_l, "%02d:%02d R", r / 3600, (r % 3600) / 60);
#else
sprintf(public_buf_l, "%d%d:%d%d:%d%d", print_time.hours / 10, print_time.hours % 10, print_time.minutes / 10, print_time.minutes % 10, print_time.seconds / 10, print_time.seconds % 10);
#endif
lv_label_set_text(labelTime, public_buf_l); lv_label_set_text(labelTime, public_buf_l);
} }