Skip to content

Commit bd6eb83

Browse files
committed
🩹 Fix some minor issues
1 parent c484228 commit bd6eb83

File tree

15 files changed

+42
-49
lines changed

15 files changed

+42
-49
lines changed

Marlin/src/HAL/ESP32/HAL.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ uint8_t MarlinHAL::get_reset_source() { return rtc_get_reset_reason(1); }
175175

176176
void MarlinHAL::reboot() { ESP.restart(); }
177177

178-
void _delay_ms(int delay_ms) { delay(delay_ms); }
178+
void _delay_ms(const int ms) { delay(ms); }
179179

180180
// return free memory between end of heap (or end bss) and whatever is current
181181
int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); }

Marlin/src/HAL/SAMD51/HAL.cpp

+29-30
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,27 @@
4747
#endif
4848
#endif
4949

50-
#define GET_TEMP_0_ADC() TERN(HAS_TEMP_ADC_0, PIN_TO_ADC(TEMP_0_PIN), -1)
51-
#define GET_TEMP_1_ADC() TERN(HAS_TEMP_ADC_1, PIN_TO_ADC(TEMP_1_PIN), -1)
52-
#define GET_TEMP_2_ADC() TERN(HAS_TEMP_ADC_2, PIN_TO_ADC(TEMP_2_PIN), -1)
53-
#define GET_TEMP_3_ADC() TERN(HAS_TEMP_ADC_3, PIN_TO_ADC(TEMP_3_PIN), -1)
54-
#define GET_TEMP_4_ADC() TERN(HAS_TEMP_ADC_4, PIN_TO_ADC(TEMP_4_PIN), -1)
55-
#define GET_TEMP_5_ADC() TERN(HAS_TEMP_ADC_5, PIN_TO_ADC(TEMP_5_PIN), -1)
56-
#define GET_TEMP_6_ADC() TERN(HAS_TEMP_ADC_6, PIN_TO_ADC(TEMP_6_PIN), -1)
57-
#define GET_TEMP_7_ADC() TERN(HAS_TEMP_ADC_7, PIN_TO_ADC(TEMP_7_PIN), -1)
58-
#define GET_BED_ADC() TERN(HAS_TEMP_ADC_BED, PIN_TO_ADC(TEMP_BED_PIN), -1)
59-
#define GET_CHAMBER_ADC() TERN(HAS_TEMP_ADC_CHAMBER, PIN_TO_ADC(TEMP_CHAMBER_PIN), -1)
60-
#define GET_PROBE_ADC() TERN(HAS_TEMP_ADC_PROBE, PIN_TO_ADC(TEMP_PROBE_PIN), -1)
61-
#define GET_COOLER_ADC() TERN(HAS_TEMP_ADC_COOLER, PIN_TO_ADC(TEMP_COOLER_PIN), -1)
62-
#define GET_BOARD_ADC() TERN(HAS_TEMP_ADC_BOARD, PIN_TO_ADC(TEMP_BOARD_PIN), -1)
63-
#define GET_SOC_ADC() TERN(HAS_TEMP_ADC_SOC, PIN_TO_ADC(TEMP_SOC_PIN), -1)
64-
#define GET_FILAMENT_WIDTH_ADC() TERN(FILAMENT_WIDTH_SENSOR, PIN_TO_ADC(FILWIDTH_PIN), -1)
65-
#define GET_BUTTONS_ADC() TERN(HAS_ADC_BUTTONS, PIN_TO_ADC(ADC_KEYPAD_PIN), -1)
66-
#define GET_JOY_ADC_X() TERN(HAS_JOY_ADC_X, PIN_TO_ADC(JOY_X_PIN), -1)
67-
#define GET_JOY_ADC_Y() TERN(HAS_JOY_ADC_Y, PIN_TO_ADC(JOY_Y_PIN), -1)
68-
#define GET_JOY_ADC_Z() TERN(HAS_JOY_ADC_Z, PIN_TO_ADC(JOY_Z_PIN), -1)
69-
#define GET_POWERMON_ADC_CURRENT() TERN(POWER_MONITOR_CURRENT, PIN_TO_ADC(POWER_MONITOR_CURRENT_PIN), -1)
70-
#define GET_POWERMON_ADC_VOLTS() TERN(POWER_MONITOR_VOLTAGE, PIN_TO_ADC(POWER_MONITOR_VOLTAGE_PIN), -1)
50+
#define GET_TEMP_0_ADC() TERN(HAS_TEMP_ADC_0, PIN_TO_ADC(TEMP_0_PIN), -1)
51+
#define GET_TEMP_1_ADC() TERN(HAS_TEMP_ADC_1, PIN_TO_ADC(TEMP_1_PIN), -1)
52+
#define GET_TEMP_2_ADC() TERN(HAS_TEMP_ADC_2, PIN_TO_ADC(TEMP_2_PIN), -1)
53+
#define GET_TEMP_3_ADC() TERN(HAS_TEMP_ADC_3, PIN_TO_ADC(TEMP_3_PIN), -1)
54+
#define GET_TEMP_4_ADC() TERN(HAS_TEMP_ADC_4, PIN_TO_ADC(TEMP_4_PIN), -1)
55+
#define GET_TEMP_5_ADC() TERN(HAS_TEMP_ADC_5, PIN_TO_ADC(TEMP_5_PIN), -1)
56+
#define GET_TEMP_6_ADC() TERN(HAS_TEMP_ADC_6, PIN_TO_ADC(TEMP_6_PIN), -1)
57+
#define GET_TEMP_7_ADC() TERN(HAS_TEMP_ADC_7, PIN_TO_ADC(TEMP_7_PIN), -1)
58+
#define GET_BED_ADC() TERN(HAS_TEMP_ADC_BED, PIN_TO_ADC(TEMP_BED_PIN), -1)
59+
#define GET_CHAMBER_ADC() TERN(HAS_TEMP_ADC_CHAMBER, PIN_TO_ADC(TEMP_CHAMBER_PIN), -1)
60+
#define GET_PROBE_ADC() TERN(HAS_TEMP_ADC_PROBE, PIN_TO_ADC(TEMP_PROBE_PIN), -1)
61+
#define GET_COOLER_ADC() TERN(HAS_TEMP_ADC_COOLER, PIN_TO_ADC(TEMP_COOLER_PIN), -1)
62+
#define GET_BOARD_ADC() TERN(HAS_TEMP_ADC_BOARD, PIN_TO_ADC(TEMP_BOARD_PIN), -1)
63+
#define GET_SOC_ADC() TERN(HAS_TEMP_ADC_BOARD, PIN_TO_ADC(TEMP_BOARD_PIN), -1)
64+
#define GET_FILAMENT_WIDTH_ADC() TERN(FILAMENT_WIDTH_SENSOR, PIN_TO_ADC(FILWIDTH_PIN), -1)
65+
#define GET_BUTTONS_ADC() TERN(HAS_ADC_BUTTONS, PIN_TO_ADC(ADC_KEYPAD_PIN), -1)
66+
#define GET_JOY_ADC_X() TERN(HAS_JOY_ADC_X, PIN_TO_ADC(JOY_X_PIN), -1)
67+
#define GET_JOY_ADC_Y() TERN(HAS_JOY_ADC_Y, PIN_TO_ADC(JOY_Y_PIN), -1)
68+
#define GET_JOY_ADC_Z() TERN(HAS_JOY_ADC_Z, PIN_TO_ADC(JOY_Z_PIN), -1)
69+
#define GET_POWERMON_ADC_CURRENT() TERN(POWER_MONITOR_CURRENT, PIN_TO_ADC(POWER_MONITOR_CURRENT_PIN), -1)
70+
#define GET_POWERMON_ADC_VOLTS() TERN(POWER_MONITOR_VOLTAGE, PIN_TO_ADC(POWER_MONITOR_VOLTAGE_PIN), -1)
7171

7272
#define IS_ADC_REQUIRED(n) ( \
7373
GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n || GET_TEMP_3_ADC() == n \
@@ -162,10 +162,10 @@ enum ADCIndex {
162162
POWERMON_CURRENT,
163163
#endif
164164
#if GET_POWERMON_ADC_VOLTS() == 0
165-
POWERMON_VOLTS,
165+
POWERMON_VOLTAGE,
166166
#endif
167167

168-
// Use later indexes for ADC index 1
168+
// Indexes for ADC1 after those for ADC0
169169

170170
#if GET_TEMP_0_ADC() == 1
171171
TEMP_0,
@@ -228,9 +228,8 @@ enum ADCIndex {
228228
POWERMON_CURRENT,
229229
#endif
230230
#if GET_POWERMON_ADC_VOLTS() == 1
231-
POWERMON_VOLTS,
231+
POWERMON_VOLTAGE,
232232
#endif
233-
234233
ADC_COUNT
235234
};
236235

@@ -351,10 +350,10 @@ enum ADCIndex {
351350
POWER_MONITOR_CURRENT_PIN,
352351
#endif
353352
#if GET_POWERMON_ADC_VOLTS() == 0
354-
POWER_MONITOR_VOLTS_PIN,
353+
POWER_MONITOR_VOLTAGE_PIN,
355354
#endif
356355

357-
// ADC1 pins
356+
// Pins for ADC1 after ADC0
358357

359358
#if GET_TEMP_0_ADC() == 1
360359
TEMP_0_PIN,
@@ -417,7 +416,7 @@ enum ADCIndex {
417416
POWER_MONITOR_CURRENT_PIN,
418417
#endif
419418
#if GET_POWERMON_ADC_VOLTS() == 1
420-
POWER_MONITOR_VOLTS_PIN,
419+
POWER_MONITOR_VOLTAGE_PIN,
421420
#endif
422421
};
423422

@@ -488,7 +487,7 @@ enum ADCIndex {
488487
{ PIN_TO_INPUTCTRL(POWER_MONITOR_CURRENT_PIN) },
489488
#endif
490489
#if GET_POWERMON_ADC_VOLTS() == 0
491-
{ PIN_TO_INPUTCTRL(POWER_MONITOR_VOLTS_PIN) },
490+
{ PIN_TO_INPUTCTRL(POWER_MONITOR_VOLTAGE_PIN) },
492491
#endif
493492
};
494493

@@ -560,7 +559,7 @@ enum ADCIndex {
560559
{ PIN_TO_INPUTCTRL(POWER_MONITOR_CURRENT_PIN) },
561560
#endif
562561
#if GET_POWERMON_ADC_VOLTS() == 1
563-
{ PIN_TO_INPUTCTRL(POWER_MONITOR_VOLTS_PIN) },
562+
{ PIN_TO_INPUTCTRL(POWER_MONITOR_VOLTAGE_PIN) },
564563
#endif
565564
};
566565

Marlin/src/HAL/STM32F1/HAL.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ enum ADCIndex : uint8_t {
313313
OPTITEM(HAS_JOY_ADC_Y, JOY_Y)
314314
OPTITEM(HAS_JOY_ADC_Z, JOY_Z)
315315
OPTITEM(POWER_MONITOR_CURRENT, POWERMON_CURRENT)
316-
OPTITEM(POWER_MONITOR_VOLTAGE, POWERMON_VOLTS)
316+
OPTITEM(POWER_MONITOR_VOLTAGE, POWERMON_VOLTAGE)
317317
ADC_COUNT
318318
};
319319

@@ -381,7 +381,7 @@ void MarlinHAL::adc_start(const pin_t pin) {
381381
_TCASE(FILAMENT_WIDTH_SENSOR, FILWIDTH_PIN, FILWIDTH)
382382
_TCASE(HAS_ADC_BUTTONS, ADC_KEYPAD_PIN, ADC_KEY)
383383
_TCASE(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN, POWERMON_CURRENT)
384-
_TCASE(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN, POWERMON_VOLTS)
384+
_TCASE(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN, POWERMON_VOLTAGE)
385385
}
386386
adc_result = (adc_results[(int)pin_index] & 0xFFF) >> (12 - HAL_ADC_RESOLUTION); // shift out unused bits
387387
}

Marlin/src/HAL/STM32F1/HAL.h

-2
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ void flashFirmware(const int16_t);
221221
// Memory related
222222
#define __bss_end __bss_end__
223223

224-
void _delay_ms(const int ms);
225-
226224
extern "C" char* _sbrk(int incr);
227225

228226
#pragma GCC diagnostic push

Marlin/src/HAL/STM32F1/onboard_sd.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
* Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech]
66
* Copyright (C) 2015, ChaN, all right reserved.
77
*
8-
* Based on Sprinter and grbl.
9-
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
10-
*
118
* This software is a free software and there is NO WARRANTY.
129
* No restriction on use. You can use, modify and redistribute it for
1310
* personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.

Marlin/src/inc/Conditionals_adv.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@
12561256
* currently HAL.h must be included ahead of pins.h.
12571257
*/
12581258
#if LCD_IS_SERIAL_HOST && !defined(LCD_SERIAL_PORT)
1259-
#if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1, AQUILA_V101)
1259+
#if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_MINI_E3_V3_0_1, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1, AQUILA_V101)
12601260
#define LCD_SERIAL_PORT 1
12611261
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V423, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO)
12621262
#define LCD_SERIAL_PORT 2

Marlin/src/inc/Warnings.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@
707707
/**
708708
* Maple environment
709709
*/
710-
#ifdef __STM32F1__
710+
#if defined(__STM32F1__) && DISABLED(NO_MAPLE_WARNING)
711711
#warning "Maple build environments are deprecated. Please use a non-Maple build environment. Report issues to the Marlin Firmware project."
712712
#endif
713713

Marlin/src/lcd/e3v2/common/encoder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ typedef enum {
4545
ENCODER_DIFF_ENTER = 3 // click
4646
} EncoderState;
4747

48-
#define ENCODER_WAIT_MS 20
48+
#define ENCODER_WAIT_MS TERN(DWIN_LCD_PROUI, 10, 20)
4949

5050
// Encoder initialization
5151
void encoderConfiguration();

Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void dwinWriteToMem(uint8_t mem, uint16_t addr, uint16_t length, uint8_t *data)
127127
dwinWord(i, addr + indx); // start address of the data block
128128
++i;
129129
for (uint8_t j = 0; j < i; ++j) { LCD_SERIAL.write(dwinSendBuf[j]); delayMicroseconds(1); } // Buf header
130-
for (uint16_t j = indx; j <= indx + to_send - 1; j++) LCD_SERIAL.write(*(data + j)); delayMicroseconds(1); // write block of data
130+
for (uint16_t j = indx; j <= indx + to_send - 1; j++) { LCD_SERIAL.write(*(data + j)); delayMicroseconds(1); } // write block of data
131131
for (uint8_t j = 0; j < 4; ++j) { LCD_SERIAL.write(dwinBufTail[j]); delayMicroseconds(1); }
132132
block++;
133133
pending -= to_send;

Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222

2323
/**
24-
* lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp
24+
* lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp
2525
*/
2626

2727
#include "../../../inc/MarlinConfigPre.h"

Marlin/src/lcd/menu/menu_bed_leveling.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
//
139139
void _lcd_level_bed_moving() {
140140
if (ui.should_draw()) {
141-
MString<9> msg;
141+
MString<10> msg;
142142
msg.setf(F(" %i / %u"), int(manual_probe_index + 1), total_probe_points);
143143
MenuItem_static::draw(LCD_HEIGHT / 2, GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), SS_CENTER, msg);
144144
}

Marlin/src/pins/stm32f1/pins_CREALITY_V521.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135

136136
#define FAN0_PIN PB14 // FAN
137137
#define FAN1_PIN PB12 // FAN
138-
#define FAN_SOFT_PWM
138+
#define FAN_SOFT_PWM_REQUIRED
139139

140140
//
141141
// SD Card

Marlin/src/pins/stm32f4/pins_TRONXY_V10.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
#define FAN2_PIN PG9 // FAN2
158158
#define FAN3_PIN PF10 // FAN3
159159
#define CONTROLLER_FAN_PIN PD7 // BOARD FAN
160-
#define FAN_SOFT_PWM
160+
#define FAN_SOFT_PWM_REQUIRED
161161

162162
//
163163
// Laser / Spindle

buildroot/share/sublime/MarlinFirmware.sublime-project

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"ensure_newline_at_eof_on_save": true,
3131
"tab_size": 2,
3232
"translate_tabs_to_spaces": true,
33-
"trim_trailing_white_space_on_save": true
33+
"trim_trailing_white_space_on_save": true,
34+
"uncrustify_config" : "${project_dir}/../extras/uncrustify.cfg"
3435
}
3536
}

ini/stm32f1-maple.ini

-2
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,6 @@ build_flags = ${STM32F1_maple.build_flags} -DTEMP_TIMER_CHAN=4
399399
board_build.address = 0x08007000
400400
board_build.ldscript = sovol.ld
401401
board_build.rename = firmware-{date}-{time}.bin
402-
extra_scripts = ${STM32F1_maple.extra_scripts}
403-
buildroot/share/PlatformIO/scripts/custom_board.py
404402
debug_tool = jlink
405403
upload_protocol = jlink
406404

0 commit comments

Comments
 (0)