Skip to content

Commit

Permalink
strip whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jun 1, 2023
1 parent 60921e9 commit 340e05f
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 53 deletions.
6 changes: 3 additions & 3 deletions Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void DGUSDisplay::SwitchScreen(DGUS_Screen screen) {
void DGUSDisplay::PlaySound(uint8_t start, uint8_t len, uint8_t volume) {
if (volume == 0) volume = DGUSDisplay::volume;
else volume = map_precise(constrain(volume, 0, 100), 0, 100, 0, 0x40);

if (volume == 0) return;
const uint8_t command[] = { start, len, volume, 0x00 };
Write(0xA0, command, sizeof(command));
Expand Down Expand Up @@ -271,7 +271,7 @@ void DGUSDisplay::ProcessRx() {
if (addr == DGUS_VERSION && dlen == 2) {
gui_version = tmp[3];
os_version = tmp[4];

#ifdef DEBUG_DGUSLCD
DEBUG_ECHO("DGUS version: GUI "); DEBUG_DECIMAL(gui_version);
DEBUG_ECHO("OS "); DEBUG_DECIMAL(os_version);
Expand Down Expand Up @@ -343,7 +343,7 @@ void DGUSDisplay::ProcessRx() {
DEBUG_ECHO("DGUS unknown command "); DEBUG_DECIMAL(command);
DEBUG_EOL();
#endif

rx_datagram_state = DGUS_IDLE;
break;
}
Expand Down
28 changes: 14 additions & 14 deletions Marlin/src/lcd/extui/dgus_e3s1pro/DGUSReturnKeyCodeHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static uint16_t absExtruderTempSave = 0;
static uint16_t absBedTempSave = 0;

static DGUS_Screen GetJogScreenForSavedJogLength()
{
{
DGUS_Screen jogscreen = DGUS_Screen::MOVEAXIS_10;
switch (dgus_screen_handler.config.jogLength)
{
Expand All @@ -73,7 +73,7 @@ static DGUS_Screen GetJogScreenForSavedJogLength()
void DGUSReturnKeyCodeHandler::Command_MenuSelect(DGUS_VP &vp, void *data)
{
DGUS_Data::MenuSelectCommand submenu = (DGUS_Data::MenuSelectCommand)BE16_P(data);

switch (submenu)
{
case DGUS_Data::MenuSelectCommand::Main:
Expand Down Expand Up @@ -109,7 +109,7 @@ void DGUSReturnKeyCodeHandler::Command_MenuSelect(DGUS_VP &vp, void *data)
{
dgus_screen_handler.HomeThenChangeScreen(dgus_screen_handler.GetCurrentScreen());
}

ExtUI::injectCommands(F("M420 S0"));

#if ENABLED(AUTO_BED_LEVELING_UBL)
Expand Down Expand Up @@ -179,7 +179,7 @@ void DGUSReturnKeyCodeHandler::Command_CheckKO(DGUS_VP &vp, void *data)

if (command != DGUS_Data::CheckKOCommand::KO
&& command != DGUS_Data::CheckKOCommand::SDCard_No)
{
{
#ifdef DEBUG_DGUSLCD
DEBUG_ECHO("Command_CheckKO: unknown id "); DEBUG_DECIMAL((uint16_t)command);
DEBUG_EOL();
Expand Down Expand Up @@ -374,14 +374,14 @@ void DGUSReturnKeyCodeHandler::Command_SettingsMenu(DGUS_VP &vp, void *data)
stepper.enable_all_steppers();
}
break;

case DGUS_Data::SettingsMenuCommand::Reset_All_Settings:
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::FACTORYRESET_CONFIRM);
break;

case DGUS_Data::SettingsMenuCommand::FactoryReset_Validate:
ExtUI::injectCommands(F("M502"));

case DGUS_Data::SettingsMenuCommand::FactoryReset_Cancel:
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::CONTROL_DEVICE);
break;
Expand All @@ -391,7 +391,7 @@ void DGUSReturnKeyCodeHandler::Command_SettingsMenu(DGUS_VP &vp, void *data)
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::TEMP);
break;

case DGUS_Data::SettingsMenuCommand::Show_Settings_Device_and_Discard_Temperatures:
case DGUS_Data::SettingsMenuCommand::Show_Settings_Device_and_Discard_Temperatures:
dgus_screen_handler.config.plaExtruderTemp = plaExtruderTempSave;
dgus_screen_handler.config.plaBedTemp = plaBedTempSave;
dgus_screen_handler.config.absExtruderTemp = absExtruderTempSave;
Expand Down Expand Up @@ -559,7 +559,7 @@ void DGUSReturnKeyCodeHandler::Command_AxisIO(DGUS_VP &vp, void *data)
case DGUS_Data::AxisIoCommand::Show_Ready_IO:
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::FEEDRETURN);
break;

default:
#ifdef DEBUG_DGUSLCD
DEBUG_ECHO("Command_AxisIO: unknown id "); DEBUG_DECIMAL((uint16_t)command);
Expand Down Expand Up @@ -611,7 +611,7 @@ void DGUSReturnKeyCodeHandler::Command_AdvancedSettings(DGUS_VP &vp, void *data)
case DGUS_Data::AdvancedSettingsCommand::Show_AdvSettings:
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::CONTROL_DEVICE);
break;

default:
#ifdef DEBUG_DGUSLCD
DEBUG_ECHO("Command_AdvancedSettings: unknown id "); DEBUG_DECIMAL((uint16_t)command);
Expand Down Expand Up @@ -660,7 +660,7 @@ void DGUSReturnKeyCodeHandler::Command_FilelistControl(DGUS_VP &vp, void *data)
case DGUS_Data::FilelistControlCommand::End:
newPage = dgus_sdcard_handler.onLastPage();
break;

default:
#ifdef DEBUG_DGUSLCD
DEBUG_ECHO("Command_FilelistControl: unknown id "); DEBUG_DECIMAL((uint16_t)control);
Expand Down Expand Up @@ -689,11 +689,11 @@ void DGUSReturnKeyCodeHandler::Command_LaserControl(DGUS_VP &vp, void *data)
#if HAS_CUTTER
case DGUS_Data::LaserControlCommand::Mode_Cutter:
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::SW_LASER_TIPS);
break;
break;

case DGUS_Data::LaserControlCommand::Mode_Cutter_Confirm:
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::SW_LASER_TIPS);
break;
break;
#endif

case DGUS_Data::LaserControlCommand::Mode_Change:
Expand All @@ -702,7 +702,7 @@ void DGUSReturnKeyCodeHandler::Command_LaserControl(DGUS_VP &vp, void *data)
#else
dgus_screen_handler.AngryBeeps(2);
#endif

default:
#ifdef DEBUG_DGUSLCD
DEBUG_ECHO("Command_LaserControl: unknown id "); DEBUG_DECIMAL((uint16_t)control);
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/extui/dgus_e3s1pro/DGUSRxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace DGUSRxHandler {
{
feedRate_t maxSpeed = (float)BE16_P(data);
ExtUI::setAxisMaxFeedrate_mm_s(maxSpeed, axis);
}
}
template <typename T, T axis>
void MaxAcceleration(DGUS_VP &vp, void *data)
{
Expand All @@ -53,7 +53,7 @@ namespace DGUSRxHandler {
{
float maxJerk = dgus_display.FromFixedPoint<uint16_t, float, 2>(BE16_P(data));
ExtUI::setAxisMaxJerk_mm_s(maxJerk, axis);
}
}
template <typename T, T axis>
void StepsPerMm(DGUS_VP &vp, void *data)
{
Expand Down Expand Up @@ -103,7 +103,7 @@ namespace DGUSRxHandler {
void Bed_PID_I(DGUS_VP &vp, void *data);
void Bed_PID_D(DGUS_VP &vp, void *data);
#endif // PIDTEMPBED

void Control_SetFanSpeed(DGUS_VP &vp, void *data);
void SDCard_FileSelection(DGUS_VP &vp, void *data);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void DGUS_SDCardHandler::Reset()
currentVirtualPage = 0;

while (!fileList.isAtRootDir())
fileList.upDir();
fileList.upDir();

fileList.refresh();
fileCount = fileList.count();
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/extui/dgus_e3s1pro/DGUSSDCardHandler_Basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void DGUS_SDCardHandler::Reset()
currentPage = DGUS_SDCardHandler::page_t::PAGE_1;

while (!fileList.isAtRootDir())
fileList.upDir();
fileList.upDir();

fileCount = 0;
uint16_t currentSeekPos = 0;
Expand All @@ -53,7 +53,7 @@ void DGUS_SDCardHandler::Reset()
fileCount++;
currentSeekPos++;
}

#ifdef DEBUG_DGUSLCD
DEBUG_ECHO("Reset() :");
DEBUG_DECIMAL(fileCount);
Expand Down Expand Up @@ -90,7 +90,7 @@ void DGUS_SDCardHandler::onPageLoad(DGUS_SDCardHandler::page_t page)
currentFilePos++;
}


#ifdef DEBUG_DGUSLCD
DEBUG_ECHO("onPageLoad() :");
DEBUG_DECIMAL(currentFilePos);
Expand Down
14 changes: 7 additions & 7 deletions Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void DGUSScreenHandler::Loop() {
return;
}

if (ELAPSED(ms, next_beep_ms))
if (ELAPSED(ms, next_beep_ms))
{
next_beep_ms = ms + 300;

Expand Down Expand Up @@ -261,7 +261,7 @@ void DGUSScreenHandler::LoadSettings(const char *buff) {
DEBUG_ECHOLNPGM("invalid DGUS settings, resetting");
SettingsReset();
}

ExtUI::setLevelingActive(config.levelingEnabled);
dgus_display.SetVolume(config.volume);
dgus_display.SetBrightness(config.brightness);
Expand Down Expand Up @@ -326,7 +326,7 @@ void DGUSScreenHandler::LevelingEnd() {
void DGUSScreenHandler::MeshUpdate(const int8_t xpos, const int8_t ypos) {
if (!isLeveling)
return;

currentMeshPointIndex++;
TriggerFullUpdate();
}
Expand Down Expand Up @@ -544,12 +544,12 @@ bool DGUSScreenHandler::SendScreenVPData(DGUS_Screen screen, bool complete_updat
DGUS_VP vp;
if (!DGUS_PopulateVP((DGUS_Addr)addr, &vp)) continue; // Invalid VP
if (!vp.tx_handler) continue; // Nothing to send
if (!complete_update
&& !(vp.flags & VPFLAG_AUTOUPLOAD)
if (!complete_update
&& !(vp.flags & VPFLAG_AUTOUPLOAD)
#ifdef DGUS_SOFTWARE_AUTOSCROLL
&& !(vp.flags & VPFLAG_TXSTRING_AUTOSCROLL)
#endif
)
)
continue; // Unnecessary VP

uint8_t expected_tx = 6 + vp.size; // 6 bytes header + payload.
Expand All @@ -575,7 +575,7 @@ bool DGUSScreenHandler::RefreshVP(DGUS_Addr vpAddr)
if (*list == vpAddr)
{
DGUS_VP vp;
if (!DGUS_PopulateVP((DGUS_Addr)vpAddr, &vp) || !vp.tx_handler)
if (!DGUS_PopulateVP((DGUS_Addr)vpAddr, &vp) || !vp.tx_handler)
return false;

vp.tx_handler(vp);
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DGUSScreenHandler {
static eeprom_data_t config;
static uint16_t currentMeshPointIndex;
static bool isLeveling;

static char homeStatusMessage[128];

private:
Expand Down Expand Up @@ -135,7 +135,7 @@ class DGUSScreenHandler {
static void StartPrintFromSD(const char* const filename);
static void SetStatusMessage(FSTR_P msg, const millis_t duration=DGUS_STATUS_EXPIRATION_MS);
static void SetStatusMessage(const char* msg, const millis_t duration=DGUS_STATUS_EXPIRATION_MS);

static DGUS_Screen GetCurrentScreen();
static void HomeThenChangeScreen(DGUS_Screen screen);
static void TriggerScreenChange(DGUS_Screen screen);
Expand All @@ -157,4 +157,4 @@ class DGUSScreenHandler {
static bool RefreshVP(DGUS_Addr vpAddr);
};

extern DGUSScreenHandler dgus_screen_handler;
extern DGUSScreenHandler dgus_screen_handler;
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus_e3s1pro/DGUSSetupHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ bool DGUSSetupHandler::SDCardPrepare()
dgus_display.EnableControl(DGUS_Screen::FILE1, DGUSDisplay::DGUS_ControlType::RETURN_KEY_CODE, DGUS_Control::FILE1_Settings);
}
#endif

dgus_sdcard_handler.onPageLoad(DGUS_SCREEN_TO_PAGE(dgus_screen_handler.GetCurrentScreen()));
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/dgus_e3s1pro/DGUSTxHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ void DGUSTxHandler::ExtraToString(DGUS_VP &vp) {
else
stringStart += dgus_screen_handler.GetScrollIndex();

dgus_display.WriteString((uint16_t)vp.addr,
stringStart,
dgus_display.WriteString((uint16_t)vp.addr,
stringStart,
vp.size, true, false, false);
}
else
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/dgus_e3s1pro/DGUSTxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ namespace DGUSTxHandler {
void Bed_PID_P(DGUS_VP &vp);
void Bed_PID_I(DGUS_VP &vp);
void Bed_PID_D(DGUS_VP &vp);
#endif // PIDTEMPBED
#endif // PIDTEMPBED

void PrintRemainingHours(DGUS_VP &);
void PrintRemainingMinutes(DGUS_VP &);
void PrintPercentage(DGUS_VP &);
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/extui/dgus_e3s1pro/config/DGUS_Data.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace DGUS_Data {

// RX constants

enum class Language : uint16_t
enum class Language : uint16_t
{
Chinese_Simplified = 1,
English,
Expand All @@ -38,7 +38,7 @@ namespace DGUS_Data {
Portuguese,
Russian,
Turkish,

// Compatibility with LCD_LANGUAGE
zh_CN = Chinese_Simplified,
en = English,
Expand All @@ -51,7 +51,7 @@ namespace DGUS_Data {
ru = Russian,
tr = Turkish,

Default =
Default =
#ifdef DGUS_E3S1PRO_LANGUAGE
DGUS_E3S1PRO_LANGUAGE
#else
Expand Down
18 changes: 9 additions & 9 deletions Marlin/src/lcd/extui/dgus_e3s1pro/definition/DGUS_VPList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,23 @@ const uint16_t DGUS_ZERO = 0;
nullptr, DGUSTxHandler::ExtraToString)

const struct DGUS_VP vp_list[] PROGMEM = {
VP_HELPER_TX_AUTO( DGUS_Addr::BOOT_Logo,
nullptr,
VP_HELPER_TX_AUTO( DGUS_Addr::BOOT_Logo,
nullptr,
&DGUSTxHandler::BootAnimation),
VP_HELPER_RX( DGUS_Addr::CMD_MenuSelect,
VP_HELPER_RX( DGUS_Addr::CMD_MenuSelect,
&DGUSReturnKeyCodeHandler::Command_MenuSelect),
VP_HELPER_RX( DGUS_Addr::CMD_Adjust,
VP_HELPER_RX( DGUS_Addr::CMD_Adjust,
&DGUSReturnKeyCodeHandler::Command_Adjust),
VP_HELPER_WORD( DGUS_Addr::MAIN_PrintSpeedPercentage,
VPFLAG_AUTOUPLOAD,
nullptr,
&DGUSRxHandler::PrintSpeedPercentage,
&DGUSTxHandler::PrintSpeedPercentage),
VP_HELPER_RX( DGUS_Addr::CMD_CheckKO,
VP_HELPER_RX( DGUS_Addr::CMD_CheckKO,
&DGUSReturnKeyCodeHandler::Command_CheckKO),
VP_HELPER_RX( DGUS_Addr::CMD_StopPause,
VP_HELPER_RX( DGUS_Addr::CMD_StopPause,
&DGUSReturnKeyCodeHandler::Command_StopPause),
VP_HELPER_RX( DGUS_Addr::CMD_CheckOK,
VP_HELPER_RX( DGUS_Addr::CMD_CheckOK,
&DGUSReturnKeyCodeHandler::Command_CheckOK),
VP_HELPER_TX_AUTO( DGUS_Addr::MAIN_Icon_Percentage, nullptr,
&DGUSTxHandler::PrintPercentage),
Expand Down Expand Up @@ -475,7 +475,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
VP_HELPER_TX_AUTO( DGUS_Addr::LANGUAGE_Icon_Turkish,
(void*)DGUS_Data::Language::Turkish,
&DGUSTxHandler::EnableIfLanguageMatchesExtra),

VP_HELPER( DGUS_Addr::INFO_Model,
DGUS_INFOSTRING_LEN,
VPFLAG_TXSTRING_AUTOSCROLL,
Expand All @@ -488,7 +488,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
VP_EXTRA_TO_STR(DGUS_MARLINVERSION),
nullptr,
DGUSTxHandler::ExtraToString),
//already set in the screen memory:
//already set in the screen memory:
/*
VP_HELPER(DGUS_Addr::INFO_Screen_Version,
DGUS_INFOSTRING_LEN,
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

namespace ExtUI {

void onStartup() {
dgus_screen_handler.Init();
void onStartup() {
dgus_screen_handler.Init();
}

void onIdle() {
Expand Down

0 comments on commit 340e05f

Please sign in to comment.