Skip to content

Commit

Permalink
Fix various errors, warnings in example config builds (MarlinFirmware…
Browse files Browse the repository at this point in the history
…#19686)

Co-authored-by: Scott Lahteine <[email protected]>
  • Loading branch information
sjasonsmith and thinkyhead committed Oct 16, 2020
1 parent 8a5c378 commit c6cf3da
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 157 deletions.
8 changes: 3 additions & 5 deletions Marlin/src/gcode/bedlevel/G26.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,9 @@ void GcodeSuite::G26() {
g26_keep_heaters_on = parser.boolval('K');

// Accept 'I' if temperature presets are defined
const uint8_t preset_index = (0
#if PREHEAT_COUNT
+ (parser.seenval('I') ? _MIN(parser.value_byte(), PREHEAT_COUNT - 1) + 1 : 0)
#endif
);
#if PREHEAT_COUNT
const uint8_t preset_index = parser.seenval('I') ? _MIN(parser.value_byte(), PREHEAT_COUNT - 1) + 1 : 0;
#endif

#if HAS_HEATED_BED

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/motion/M290.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void GcodeSuite::M290() {
#else
PSTR("Babystep Z")
#endif
, babystep.axis_total[BS_AXIS_IND(Z_AXIS)]
, babystep.axis_total[BS_TOTAL_IND(Z_AXIS)]
);
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/dogm/dogm_Statusscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@
#undef STATUS_LOGO_WIDTH
#endif

#if (HAS_MULTI_HOTEND && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN)
#if !defined(STATUS_HEATERS_X) && ((HAS_MULTI_HOTEND && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN))
#define _STATUS_HEATERS_X(H,S,N) ((LCD_PIXEL_WIDTH - (H * (S + N)) - (_EXTRA_WIDTH) + (STATUS_LOGO_WIDTH)) / 2)
#if STATUS_HOTEND1_WIDTH
#if HOTENDS > 2
Expand Down
18 changes: 8 additions & 10 deletions Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@

extern lv_group_t * g;
static lv_obj_t * scr;
static lv_obj_t *labelExt1, * labelExt2, * labelFan, * labelZpos, * labelTime;
static lv_obj_t *labelExt1, * labelFan, * labelZpos, * labelTime;
TERN_(HAS_MULTI_EXTRUDER, static lv_obj_t *labelExt2;)
static lv_obj_t *labelPause, * labelStop, * labelOperat;
static lv_obj_t * bar1, *bar1ValueText;
static lv_obj_t * buttonPause, *buttonOperat, *buttonStop;
Expand Down Expand Up @@ -137,9 +138,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
}

void lv_draw_printing(void) {
lv_obj_t *buttonExt1, *buttonExt2, *buttonFanstate, *buttonZpos, *buttonTime;
TERN_(HAS_HEATED_BED, lv_obj_t * buttonBedstate);

disp_state_stack._disp_index = 0;
ZERO(disp_state_stack._disp_state);
disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINTING_UI;
Expand All @@ -162,16 +160,16 @@ void lv_draw_printing(void) {
lv_refr_now(lv_refr_get_disp_refreshing());

// Create image buttons
buttonExt1 = lv_img_create(scr, NULL);
lv_obj_t *buttonExt1 = lv_img_create(scr, NULL);
#if HAS_MULTI_EXTRUDER
buttonExt2 = lv_img_create(scr, NULL);
lv_obj_t *buttonExt2 = lv_img_create(scr, NULL);
#endif
#if HAS_HEATED_BED
buttonBedstate = lv_img_create(scr, NULL);
lv_obj_t *buttonBedstate = lv_img_create(scr, NULL);
#endif
buttonFanstate = lv_img_create(scr, NULL);
buttonTime = lv_img_create(scr, NULL);
buttonZpos = lv_img_create(scr, NULL);
lv_obj_t *buttonFanstate = lv_img_create(scr, NULL);
lv_obj_t *buttonTime = lv_img_create(scr, NULL);
lv_obj_t *buttonZpos = lv_img_create(scr, NULL);
buttonPause = lv_imgbtn_create(scr, NULL);
buttonStop = lv_imgbtn_create(scr, NULL);
buttonOperat = lv_imgbtn_create(scr, NULL);
Expand Down
40 changes: 20 additions & 20 deletions Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,39 +442,39 @@ void lv_encoder_pin_init() {
//static const int8_t encoderDirection = 1;
//static int16_t enc_Direction;
void lv_update_encoder() {
static uint8_t buttons;
static uint32_t encoder_time1;
uint32_t tmpTime, diffTime = 0;
tmpTime = millis();
diffTime = getTickDiff(tmpTime, encoder_time1);
if (diffTime > 50) {

#if ANY_BUTTON(EN1, EN2, ENC, BACK)
#if HAS_ENCODER_WHEEL

uint8_t newbutton = 0;
#if ANY_BUTTON(EN1, EN2, ENC, BACK)

#if BUTTON_EXISTS(EN1)
if (BUTTON_PRESSED(EN1)) newbutton |= EN_A;
#endif
#if BUTTON_EXISTS(EN2)
if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
#endif
#if BUTTON_EXISTS(ENC)
if (BUTTON_PRESSED(ENC)) newbutton |= EN_C;
#endif
#if BUTTON_EXISTS(BACK)
if (BUTTON_PRESSED(BACK)) newbutton |= EN_D;
#endif
uint8_t newbutton = 0;

#if BUTTON_EXISTS(EN1)
if (BUTTON_PRESSED(EN1)) newbutton |= EN_A;
#endif
#if BUTTON_EXISTS(EN2)
if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
#endif
#if BUTTON_EXISTS(ENC)
if (BUTTON_PRESSED(ENC)) newbutton |= EN_C;
#endif
#if BUTTON_EXISTS(BACK)
if (BUTTON_PRESSED(BACK)) newbutton |= EN_D;
#endif

#else
#else

constexpr uint8_t newbutton = 0;
constexpr uint8_t newbutton = 0;

#endif
#endif

buttons = newbutton;

#if HAS_ENCODER_WHEEL
static uint8_t buttons = newbutton;
static uint8_t lastEncoderBits;

#define encrot0 0
Expand Down
Loading

0 comments on commit c6cf3da

Please sign in to comment.