Cleanup code and use clang-formatter to improve readabilty.

This commit is contained in:
Knutwurst
2023-06-14 15:11:17 +02:00
parent 1e27c22bdd
commit 9afe777c26
3 changed files with 1972 additions and 1973 deletions

View File

@@ -6,25 +6,25 @@ AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: true
PadOperators: true
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: false
PadOperators: false
@@ -62,16 +62,15 @@ BraceWrapping:
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
IndentBraces: true
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakAfterJavaFieldAnnotations: false
BreakArrays: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
@@ -115,17 +114,17 @@ IncludeCategories:
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: false
IndentAccessModifiers: true
IndentCaseBlocks: true
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentPPDirectives: BeforeHash
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
InsertNewlineAtEOF: false
IndentWidth: 2
IndentWrappedFunctionNames: true
InsertBraces: true
InsertNewlineAtEOF: true
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
@@ -134,15 +133,13 @@ IntegerLiteralSeparator:
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true

File diff suppressed because it is too large Load Diff

View File

@@ -24,11 +24,11 @@
#include "../../../inc/MarlinConfigPre.h"
#include "../../../module/probe.h"
char *itostr2(const uint8_t &x);
char* itostr2(const uint8_t& x);
#ifndef ULTRA_LCD
char *itostr3(const int);
char *ftostr32(const float &);
char* itostr3(const int);
char* ftostr32(const float&);
#endif
#define TFTBUFSIZE 4
@@ -194,48 +194,48 @@ enum AnycubicMediaPauseState {
class AnycubicTouchscreenClass {
public:
AnycubicTouchscreenClass();
public:
AnycubicTouchscreenClass();
void Setup();
void CommandScan();
void FilamentRunout();
void DoFilamentRunoutCheck();
void UserConfirmRequired(const char *);
void SDCardStateChange(bool);
void SDCardError();
void KillTFT();
void OnPrintTimerStarted();
void OnPrintTimerPaused();
void OnPrintTimerStopped();
void Setup();
void CommandScan();
void FilamentRunout();
void DoFilamentRunoutCheck();
void UserConfirmRequired(const char*);
void SDCardStateChange(bool);
void SDCardError();
void KillTFT();
void OnPrintTimerStarted();
void OnPrintTimerPaused();
void OnPrintTimerStopped();
#if BOTH(ANYCUBIC_TFT_DEBUG, KNUTWURST_DGUS2_TFT)
void Command(const char * const command);
void Command(const char* const command);
#endif
#if ENABLED(KNUTWURST_CHIRON)
void LevelingDone();
#endif
private:
char TFTcmdbuffer[TFTBUFSIZE][TFT_MAX_CMD_SIZE];
int TFTbuflen = 0;
int TFTbufindr = 0;
int TFTbufindw = 0;
char serial3_char;
int serial3_count = 0;
char *TFTstrchr_pointer;
char FlagResumFromOutage = 0;
uint8_t tmp_extruder = 0;
uint16_t HeaterCheckCount = 0;
int currentFlowRate = 0;
bool PrintdoneAndPowerOFF = true;
bool powerOFFflag = 0;
xy_uint8_t selectedmeshpoint;
float live_Zoffset;
private:
char TFTcmdbuffer[TFTBUFSIZE][TFT_MAX_CMD_SIZE];
int TFTbuflen = 0;
int TFTbufindr = 0;
int TFTbufindw = 0;
char serial3_char;
int serial3_count = 0;
char* TFTstrchr_pointer;
char FlagResumFromOutage = 0;
uint8_t tmp_extruder = 0;
uint16_t HeaterCheckCount = 0;
int currentFlowRate = 0;
bool PrintdoneAndPowerOFF = true;
bool powerOFFflag = 0;
xy_uint8_t selectedmeshpoint;
float live_Zoffset;
static AnycubicMediaPrintState mediaPrintingState;
static AnycubicMediaPauseState mediaPauseState;
static AnycubicMediaPrintState mediaPrintingState;
static AnycubicMediaPauseState mediaPauseState;
#if defined(POWER_OUTAGE_TEST)
struct OutageDataStruct {
@@ -245,36 +245,35 @@ static AnycubicMediaPauseState mediaPauseState;
float last_bed_temp;
float last_hotend_temp;
long lastSDposition;
}
OutageData;
} OutageData;
#endif
int CodeValueInt();
float CodeValue();
bool CodeSeen(char);
void StartPrint();
void PausePrint();
void ResumePrint();
void StopPrint();
void GetCommandFromTFT();
void CheckHeaterError();
void FilamentChangePause();
void HandleSpecialMenu();
void RenderCurrentFileList();
void RenderSpecialMenu(uint16_t);
void RenderCurrentFolder(uint16_t);
int CodeValueInt();
float CodeValue();
bool CodeSeen(char);
void StartPrint();
void PausePrint();
void ResumePrint();
void StopPrint();
void GetCommandFromTFT();
void CheckHeaterError();
void FilamentChangePause();
void HandleSpecialMenu();
void RenderCurrentFileList();
void RenderSpecialMenu(uint16_t);
void RenderCurrentFolder(uint16_t);
char currentTouchscreenSelection[64];
char currentFileOrDirectory[64];
String flowRateBuffer;
String zOffsetBuffer;
char currentTouchscreenSelection[64];
char currentFileOrDirectory[64];
String flowRateBuffer;
String zOffsetBuffer;
uint8_t SpecialMenu = false;
uint8_t MMLMenu = false;
uint8_t FlowMenu = false;
uint8_t BLTouchMenu = false;
uint8_t LevelMenu = false;
uint8_t CaseLight = true;
uint8_t SpecialMenu = false;
uint8_t MMLMenu = false;
uint8_t FlowMenu = false;
uint8_t BLTouchMenu = false;
uint8_t LevelMenu = false;
uint8_t CaseLight = true;
#if ENABLED(KNUTWURST_MEGA_P_LASER)
typedef struct {