Skip to content

Commit af16dfe

Browse files
Update - codacy and scripts fixes
1 parent e235eec commit af16dfe

File tree

11 files changed

+278
-246
lines changed

11 files changed

+278
-246
lines changed

Marlin/_Bootscreen.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
2020

2121
#if !defined(CUSTOM_BOOTSCREEN_ANIMATED)
22-
//*/ if machine is Voxelab Aquila add ( / ) to first in line and remove ( / ) from next block
22+
// Aquila block
23+
//*/ if machine is Voxelab Aquila add ( / ) to start of line and remove ( / ) from start of next block
2324
const unsigned char custom_start_bmp[] PROGMEM = {
2425
#if !CUSTOM_BOOTSCREEN_ALTERNATE
2526
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
@@ -119,8 +120,11 @@ const unsigned char custom_start_bmp[] PROGMEM = {
119120
#endif
120121
};
121122
//*/
123+
122124
// ----------------------------------------------------------------
123-
/*/ if machine is Ender add ( / ) to first in line and remove ( / ) from previous block
125+
126+
// Ender block
127+
/*/ if machine is Ender add ( / ) to start of line and remove ( / ) from start of previous block
124128
const unsigned char custom_start_bmp[] PROGMEM = {
125129
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
126130
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

buildroot/share/PlatformIO/scripts/SAMD21_minitronics20.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
env = pioutil.env
1111

1212
mf = env["MARLIN_FEATURES"]
13-
rx_Buf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
14-
tx_Buf = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0"
13+
RXBUF = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
14+
TXBUF = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0"
1515

16-
serialBuf = str(max(int(rx_Buf), int(tx_Buf), 350))
16+
serialBuf = str(max(int(RXBUF), int(TXBUF), 350))
1717

1818
build_flags = env.get("BUILD_FLAGS")
1919
env.Replace(BUILD_FLAGS=build_flags)

buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
env = pioutil.env
1111

1212
mf = env["MARLIN_FEATURES"]
13-
rx_Buf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
14-
tx_Buf = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0"
13+
RXBUF = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
14+
TXBUF = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0"
1515

16-
serialBuf = str(max(int(rx_Buf), int(tx_Buf), 350))
16+
serialBuf = str(max(int(RXBUF), int(TXBUF), 350))
1717

1818
build_flags = env.get("BUILD_FLAGS")
1919
build_flags.append("-DSERIAL_BUFFER_SIZE=" + serialBuf)

buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ def tryAddFlag(name, value):
5353
mf = env["MARLIN_FEATURES"]
5454

5555
# Get the largest defined buffer sizes for RX or TX, using defaults for undefined
56-
rx_Buf = getBufferSize("RX", 128)
57-
tx_Buf = getBufferSize("TX", 64)
56+
RXBUF = getBufferSize("RX", 128)
57+
TXBUF = getBufferSize("TX", 64)
5858

5959
# Provide serial buffer sizes to the stm32duino platform
60-
tryAddFlag("SERIAL_RX_BUFFER_SIZE", rx_Buf)
61-
tryAddFlag("SERIAL_TX_BUFFER_SIZE", tx_Buf)
62-
tryAddFlag("USART_RX_BUF_SIZE", rx_Buf)
63-
tryAddFlag("USART_TX_BUF_SIZE", tx_Buf)
60+
tryAddFlag("SERIAL_RX_BUFFER_SIZE", RXBUF)
61+
tryAddFlag("SERIAL_TX_BUFFER_SIZE", TXBUF)
62+
tryAddFlag("USART_RX_BUF_SIZE", RXBUF)
63+
tryAddFlag("USART_TX_BUF_SIZE", TXBUF)

buildroot/share/dwin/bin/DWIN_ICO.py

Lines changed: 111 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def splitFile(self, filename, outDir):
7878
def _parseHeader(self, infile):
7979
maxEntries = 256
8080
count = 0
81-
#icon_nums = _iconNames.keys()
81+
#icon_nums = _icon_names.keys()
8282
while count < maxEntries:
8383
rawBytes = infile.read(16)
8484
entry = Entry()
@@ -105,7 +105,7 @@ def _splitEntryData(self, infile, outDir):
105105
if entry.length == 0:
106106
count += 1
107107
continue
108-
outfilename = os.path.join(outDir, "%03d-ICON_%s.jpg" % (count, _iconNames.get(count, "UNKNOWN")))
108+
outfilename = os.path.join(outDir, "%03d-ICON_%s.jpg" % (count, _icon_names.get(count, "UNKNOWN")))
109109
with open(outfilename, "wb") as outfile:
110110
infile.seek(entry.offset)
111111
blob = infile.read(entry.length)
@@ -254,113 +254,113 @@ def serialize(self):
254254
0, 0, 0, 0, 0)
255255
return rawdata
256256

257-
_iconNames = {
258-
0: "LOGO_Creality",
259-
1: "Print_0",
260-
2: "Print_1",
261-
3: "Prepare_0",
262-
4: "Prepare_1",
263-
5: "Control_0",
264-
6: "Control_1",
265-
7: "Leveling_0",
266-
8: "Leveling_1",
267-
9: "HotendTemp",
268-
10: "BedTemp",
269-
11: "Speed",
270-
12: "Zoffset",
271-
13: "Back",
272-
14: "File",
273-
15: "PrintTime",
274-
16: "RemainTime",
275-
17: "Setup_0",
276-
18: "Setup_1",
277-
19: "Pause_0",
278-
20: "Pause_1",
279-
21: "Continue_0",
280-
22: "Continue_1",
281-
23: "Stop_0",
282-
24: "Stop_1",
283-
25: "Bar",
284-
26: "More",
285-
27: "Axis",
286-
28: "CloseMotor",
287-
29: "Homing",
288-
30: "SetHome",
289-
31: "PLAPreheat",
290-
32: "ABSPreheat",
291-
33: "Cool",
292-
34: "Language",
293-
35: "MoveX",
294-
36: "MoveY",
295-
37: "MoveZ",
296-
38: "Extruder",
297-
# Skip 39
298-
40: "Temperature",
299-
41: "Motion",
300-
42: "WriteEEPROM",
301-
43: "ReadEEPROM",
302-
44: "ResetEEPROM",
303-
45: "Info",
304-
46: "SetEndTemp",
305-
47: "SetBedTemp",
306-
48: "FanSpeed",
307-
49: "SetPLAPreheat",
308-
50: "SetABSPreheat",
309-
51: "MaxSpeed",
310-
52: "MaxAccelerated",
311-
53: "MaxJerk",
312-
54: "Step",
313-
55: "PrintSize",
314-
56: "Version",
315-
57: "Contact",
316-
58: "StockConfiguraton",
317-
59: "MaxSpeedX",
318-
60: "MaxSpeedY",
319-
61: "MaxSpeedZ",
320-
62: "MaxSpeedE",
321-
63: "MaxAccX",
322-
64: "MaxAccY",
323-
65: "MaxAccZ",
324-
66: "MaxAccE",
325-
67: "MaxSpeedJerkX",
326-
68: "MaxSpeedJerkY",
327-
69: "MaxSpeedJerkZ",
328-
70: "MaxSpeedJerkE",
329-
71: "StepX",
330-
72: "StepY",
331-
73: "StepZ",
332-
74: "StepE",
333-
75: "Setspeed",
334-
76: "SetZOffset",
335-
77: "Rectangle",
336-
78: "BLTouch",
337-
79: "TempTooLow",
338-
80: "AutoLeveling",
339-
81: "TempTooHigh",
340-
82: "NoTips_C",
341-
83: "NoTips_E",
342-
84: "Continue_C",
343-
85: "Continue_E",
344-
86: "Cancel_C",
345-
87: "Cancel_E",
346-
88: "Confirm_C",
347-
89: "Confirm_E",
348-
90: "Info_0",
349-
91: "Info_1",
350-
#92: "DegreesC",
351-
93: "Printer_0",
352-
#94: "Printer_1",
353-
200: "Checkbox_F",
354-
201: "Checkbox_T",
355-
202: "Fade",
356-
203: "Mesh",
357-
204: "Tilt",
358-
205: "Brightness",
359-
206: "Probe",
360-
249: "AxisD",
361-
250: "AxisBR",
362-
251: "AxisTR",
363-
252: "AxisBL",
364-
253: "AxisTL",
365-
254: "AxisC"
257+
_icon_names = {
258+
0: "LOGO_Creality",
259+
1: "Print_0",
260+
2: "Print_1",
261+
3: "Prepare_0",
262+
4: "Prepare_1",
263+
5: "Control_0",
264+
6: "Control_1",
265+
7: "Leveling_0",
266+
8: "Leveling_1",
267+
9: "HotendTemp",
268+
10: "BedTemp",
269+
11: "Speed",
270+
12: "Zoffset",
271+
13: "Back",
272+
14: "File",
273+
15: "PrintTime",
274+
16: "RemainTime",
275+
17: "Setup_0",
276+
18: "Setup_1",
277+
19: "Pause_0",
278+
20: "Pause_1",
279+
21: "Continue_0",
280+
22: "Continue_1",
281+
23: "Stop_0",
282+
24: "Stop_1",
283+
25: "Bar",
284+
26: "More",
285+
27: "Axis",
286+
28: "CloseMotor",
287+
29: "Homing",
288+
30: "SetHome",
289+
31: "PLAPreheat",
290+
32: "ABSPreheat",
291+
33: "Cool",
292+
34: "Language",
293+
35: "MoveX",
294+
36: "MoveY",
295+
37: "MoveZ",
296+
38: "Extruder",
297+
# Skip 39
298+
40: "Temperature",
299+
41: "Motion",
300+
42: "WriteEEPROM",
301+
43: "ReadEEPROM",
302+
44: "ResetEEPROM",
303+
45: "Info",
304+
46: "SetEndTemp",
305+
47: "SetBedTemp",
306+
48: "FanSpeed",
307+
49: "SetPLAPreheat",
308+
50: "SetABSPreheat",
309+
51: "MaxSpeed",
310+
52: "MaxAccelerated",
311+
53: "MaxJerk",
312+
54: "Step",
313+
55: "PrintSize",
314+
56: "Version",
315+
57: "Contact",
316+
58: "StockConfiguraton",
317+
59: "MaxSpeedX",
318+
60: "MaxSpeedY",
319+
61: "MaxSpeedZ",
320+
62: "MaxSpeedE",
321+
63: "MaxAccX",
322+
64: "MaxAccY",
323+
65: "MaxAccZ",
324+
66: "MaxAccE",
325+
67: "MaxSpeedJerkX",
326+
68: "MaxSpeedJerkY",
327+
69: "MaxSpeedJerkZ",
328+
70: "MaxSpeedJerkE",
329+
71: "StepX",
330+
72: "StepY",
331+
73: "StepZ",
332+
74: "StepE",
333+
75: "Setspeed",
334+
76: "SetZOffset",
335+
77: "Rectangle",
336+
78: "BLTouch",
337+
79: "TempTooLow",
338+
80: "AutoLeveling",
339+
81: "TempTooHigh",
340+
82: "NoTips_C",
341+
83: "NoTips_E",
342+
84: "Continue_C",
343+
85: "Continue_E",
344+
86: "Cancel_C",
345+
87: "Cancel_E",
346+
88: "Confirm_C",
347+
89: "Confirm_E",
348+
90: "Info_0",
349+
91: "Info_1",
350+
#92: "DegreesC",
351+
93: "Printer_0",
352+
#94: "Printer_1",
353+
200: "Checkbox_F",
354+
201: "Checkbox_T",
355+
202: "Fade",
356+
203: "Mesh",
357+
204: "Tilt",
358+
205: "Brightness",
359+
206: "Probe",
360+
249: "AxisD",
361+
250: "AxisBR",
362+
251: "AxisTR",
363+
252: "AxisBL",
364+
253: "AxisTL",
365+
254: "AxisC"
366366
}

buildroot/share/scripts/MarlinBinaryProtocol.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,18 +438,38 @@ def copy(self, filename, dest_filename, compression, dummy):
438438
self.write(data[start:end])
439439
kibs = (((i + 1) * block_size) / 1024) / (millis() + 1 - start_time) * 1000
440440
if (i / blocks) >= dump_pctg:
441-
print("\r{0:2.0f}% {1:4.2f}KiB/s {2} Errors: {3}".format((i / blocks) * 100, kibs, "[{0:4.2f}KiB/s]".format(kibs * cratio) if compression else "", self.protocol.errors), end="")
441+
print(
442+
"\r{0:2.0f}% {1:4.2f}KiB/s {2} Errors: {3}".format(
443+
(i / blocks) * 100, kibs,
444+
"[{0:4.2f}KiB/s]".format(kibs * cratio) if compression else "",
445+
self.protocol.errors
446+
),
447+
end=""
448+
)
442449
dump_pctg += 0.1
443450
if self.protocol.errors > 0:
444451
# Dump last status (errors may not be visible)
445-
print("\r{0:2.0f}% {1:4.2f}KiB/s {2} Errors: {3} - Aborting...".format((i / blocks) * 100, kibs, "[{0:4.2f}KiB/s]".format(kibs * cratio) if compression else "", self.protocol.errors), end="")
452+
print(
453+
"\r{0:2.0f}% {1:4.2f}KiB/s {2} Errors: {3} - Aborting...".format(
454+
(i / blocks) * 100, kibs,
455+
"[{0:4.2f}KiB/s]".format(kibs * cratio) if compression else "",
456+
self.protocol.errors
457+
),
458+
end=""
459+
)
446460
print("") # New line to break the transfer speed line
447461
self.close()
448462
print("Transfer aborted due to protocol errors")
449463
#raise Exception("Transfer aborted due to protocol errors")
450464
return False
451-
print("\r{0:2.0f}% {1:4.2f}KiB/s {2} Errors: {3}".format(100, kibs, "[{0:4.2f}KiB/s]".format(kibs * cratio) if compression else "", self.protocol.errors)) # No one likes transfers finishing at 99.8%
452-
465+
# No one likes transfers finishing at 99.8%
466+
print(
467+
"\r{0:2.0f}% {1:4.2f}KiB/s {2} Errors: {3}".format(
468+
100, kibs,
469+
"[{0:4.2f}KiB/s]".format(kibs * cratio) if compression else "",
470+
self.protocol.errors
471+
)
472+
)
453473
if not self.close():
454474
print("Transfer failed")
455475
return False

configurations/Voxelab Aquila HC32/C2/Default/_Bootscreen.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
2020

2121
#if !defined(CUSTOM_BOOTSCREEN_ANIMATED)
22-
//*/ if machine is Voxelab Aquila add ( / ) to first in line and remove ( / ) from next block
22+
// Aquila block
23+
//*/ if machine is Voxelab Aquila add ( / ) to start of line and remove ( / ) from start of next block
2324
const unsigned char custom_start_bmp[] PROGMEM = {
2425
#if !CUSTOM_BOOTSCREEN_ALTERNATE
2526
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
@@ -119,8 +120,11 @@ const unsigned char custom_start_bmp[] PROGMEM = {
119120
#endif
120121
};
121122
//*/
123+
122124
// ----------------------------------------------------------------
123-
/*/ if machine is Ender add ( / ) to first in line and remove ( / ) from previous block
125+
126+
// Ender block
127+
/*/ if machine is Ender add ( / ) to start of line and remove ( / ) from start of previous block
124128
const unsigned char custom_start_bmp[] PROGMEM = {
125129
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
126130
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

configurations/Voxelab Aquila HC32/C2/MM/_Bootscreen.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
2020

2121
#if !defined(CUSTOM_BOOTSCREEN_ANIMATED)
22-
//*/ if machine is Voxelab Aquila add ( / ) to first in line and remove ( / ) from next block
22+
// Aquila block
23+
//*/ if machine is Voxelab Aquila add ( / ) to start of line and remove ( / ) from start of next block
2324
const unsigned char custom_start_bmp[] PROGMEM = {
2425
#if !CUSTOM_BOOTSCREEN_ALTERNATE
2526
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
@@ -119,8 +120,11 @@ const unsigned char custom_start_bmp[] PROGMEM = {
119120
#endif
120121
};
121122
//*/
123+
122124
// ----------------------------------------------------------------
123-
/*/ if machine is Ender add ( / ) to first in line and remove ( / ) from previous block
125+
126+
// Ender block
127+
/*/ if machine is Ender add ( / ) to start of line and remove ( / ) from start of previous block
124128
const unsigned char custom_start_bmp[] PROGMEM = {
125129
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
126130
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0 commit comments

Comments
 (0)