Fix MKS H43 compile (#21240)

This commit is contained in:
Sola 2021-03-03 10:58:42 +08:00 committed by GitHub
parent 872f031405
commit 0afa4cc957
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View file

@ -49,12 +49,18 @@
#include "../../../../../feature/powerloss.h" #include "../../../../../feature/powerloss.h"
#endif #endif
#if ENABLED(SDSUPPORT)
static ExtUI::FileList filelist;
#endif
bool DGUSAutoTurnOff = false; bool DGUSAutoTurnOff = false;
uint8_t DGUSLanguageSwitch = 0; // Switch language for MKS DGUS uint8_t DGUSLanguageSwitch = 0; // Switch language for MKS DGUS
// endianness swap // endianness swap
uint32_t swap32(const uint32_t value) { return (value & 0x000000FFU) << 24U | (value & 0x0000FF00U) << 8U | (value & 0x00FF0000U) >> 8U | (value & 0xFF000000U) >> 24U; } uint32_t swap32(const uint32_t value) { return (value & 0x000000FFU) << 24U | (value & 0x0000FF00U) << 8U | (value & 0x00FF0000U) >> 8U | (value & 0xFF000000U) >> 24U; }
#if 0
void DGUSScreenHandler::sendinfoscreen_ch_mks(const uint16_t* line1, const uint16_t* line2, const uint16_t* line3, const uint16_t* line4) { void DGUSScreenHandler::sendinfoscreen_ch_mks(const uint16_t* line1, const uint16_t* line2, const uint16_t* line3, const uint16_t* line4) {
dgusdisplay.WriteVariable(VP_MSGSTR1, line1, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR1, line1, 32, true);
dgusdisplay.WriteVariable(VP_MSGSTR2, line2, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR2, line2, 32, true);
@ -76,6 +82,8 @@ void DGUSScreenHandler::sendinfoscreen_mks(const void* line1, const void* line2,
DGUSScreenHandler::sendinfoscreen_ch_mks((uint16_t *)line1, (uint16_t *)line2, (uint16_t *)line3, (uint16_t *)line4); DGUSScreenHandler::sendinfoscreen_ch_mks((uint16_t *)line1, (uint16_t *)line2, (uint16_t *)line3, (uint16_t *)line4);
} }
#endif
void DGUSScreenHandler::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) { void DGUSScreenHandler::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) {
if (var.memadr) { if (var.memadr) {
//DEBUG_ECHOPAIR(" DGUS_LCD_SendWordValueToDisplay ", var.VP); //DEBUG_ECHOPAIR(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
@ -256,7 +264,7 @@ void DGUSScreenHandler::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) {
void DGUSScreenHandler::SDPrintingFinished() { void DGUSScreenHandler::SDPrintingFinished() {
if (DGUSAutoTurnOff) { if (DGUSAutoTurnOff) {
while (queue.length) queue.advance(); while(!queue.ring_buffer.empty()) queue.advance();
gcode.process_subcommands_now_P(PSTR("M81")); gcode.process_subcommands_now_P(PSTR("M81"));
} }
GotoScreen(MKSLCD_SCREEN_PrintDone); GotoScreen(MKSLCD_SCREEN_PrintDone);
@ -786,7 +794,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPAIR("QUEUE LEN:", queue.length); DEBUG_ECHOLNPAIR("QUEUE LEN:", queue.length);
if (!print_job_timer.isPaused() && queue.length >= BUFSIZE) if (!print_job_timer.isPaused() && queue.ring_buffer.full(1))
return; return;
char axiscode; char axiscode;
@ -1778,7 +1786,7 @@ void DGUSScreenHandler::DGUS_LanguageDisplay(uint8_t var) {
dgusdisplay.WriteVariable(VP_PrintAcc_Dis, PrintAcc_buf_en, 32, true); dgusdisplay.WriteVariable(VP_PrintAcc_Dis, PrintAcc_buf_en, 32, true);
const char FAN_Speed_buf_en[] = "FAN_Speed"; const char FAN_Speed_buf_en[] = "FAN_Speed";
dgusdisplay.WriteVariable(VP_FAN_Speed_Dis, FAN_Speed_buf_en, 32, true); dgusdisplay.WriteVariable(VP_Fan_Speed_Dis, FAN_Speed_buf_en, 32, true);
const char Printing_buf_en[] = "Printing"; const char Printing_buf_en[] = "Printing";
dgusdisplay.WriteVariable(VP_Printing_Dis, Printing_buf_en, 32, true); dgusdisplay.WriteVariable(VP_Printing_Dis, Printing_buf_en, 32, true);
@ -2033,7 +2041,7 @@ void DGUSScreenHandler::DGUS_LanguageDisplay(uint8_t var) {
dgusdisplay.WriteVariable(VP_PrintAcc_Dis, PrintAcc_buf_ch, 16, true); dgusdisplay.WriteVariable(VP_PrintAcc_Dis, PrintAcc_buf_ch, 16, true);
const uint16_t FAN_Speed_buf_ch[] = { 0xE7B7, 0xC8C9, 0xD9CB, 0xC8B6, 0x2000 }; const uint16_t FAN_Speed_buf_ch[] = { 0xE7B7, 0xC8C9, 0xD9CB, 0xC8B6, 0x2000 };
dgusdisplay.WriteVariable(VP_FAN_Speed_Dis, FAN_Speed_buf_ch, 16, true); dgusdisplay.WriteVariable(VP_Fan_Speed_Dis, FAN_Speed_buf_ch, 16, true);
const uint16_t Printing_buf_ch[] = { 0xF2B4, 0xA1D3, 0xD0D6, 0x2000 }; const uint16_t Printing_buf_ch[] = { 0xF2B4, 0xA1D3, 0xD0D6, 0x2000 };
dgusdisplay.WriteVariable(VP_Printing_Dis, Printing_buf_ch, 16, true); dgusdisplay.WriteVariable(VP_Printing_Dis, Printing_buf_ch, 16, true);

View file

@ -41,9 +41,11 @@ public:
static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
#if 0
static void sendinfoscreen_ch_mks(const uint16_t* line1, const uint16_t* line2, const uint16_t* line3, const uint16_t* line4); static void sendinfoscreen_ch_mks(const uint16_t* line1, const uint16_t* line2, const uint16_t* line3, const uint16_t* line4);
static void sendinfoscreen_en_mks(const char* line1, const char* line2, const char* line3, const char* line4) ; static void sendinfoscreen_en_mks(const char* line1, const char* line2, const char* line3, const char* line4) ;
static void sendinfoscreen_mks(const void* line1, const void* line2, const void* line3, const void* line4,uint16_t language); static void sendinfoscreen_mks(const void* line1, const void* line2, const void* line3, const void* line4,uint16_t language);
#endif
// "M117" Message -- msg is a RAM ptr. // "M117" Message -- msg is a RAM ptr.
static void setstatusmessage(const char* msg); static void setstatusmessage(const char* msg);