Skip to content

Commit

Permalink
Fix SD SPI Speed override, FTDI mesh edit (#20657)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
  • Loading branch information
InsanityAutomation and thinkyhead authored Jan 4, 2021
1 parent 63448f3 commit 6b45867
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
5 changes: 0 additions & 5 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1045,11 +1045,6 @@
#define INVERT_E_DIR false
#endif

// Fallback SPI Speed for SD
#if ENABLED(SDSUPPORT) && !defined(SD_SPI_SPEED)
#define SD_SPI_SPEED SPI_FULL_SPEED
#endif

/**
* This setting is also used by M109 when trying to calculate
* a ballpark safe margin to prevent wait-forever situation.
Expand Down
5 changes: 5 additions & 0 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2708,6 +2708,11 @@
#endif
#endif

// Fallback SPI Speed for SD
#if ENABLED(SDSUPPORT) && !defined(SD_SPI_SPEED)
#define SD_SPI_SPEED SPI_FULL_SPEED
#endif

// Defined here to catch the above defines
#if ENABLED(SDCARD_SORT_ALPHA) && (FOLDER_SORTING || ENABLED(SDSORT_GCODE))
#define HAS_FOLDER_SORTING 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "../config.h"

#if BOTH(TOUCH_UI_FTDI_EVE, AUTO_BED_LEVELING_UBL)
#if BOTH(TOUCH_UI_FTDI_EVE, HAS_MESH)

#include "screens.h"
#include "screen_data.h"
Expand Down Expand Up @@ -309,25 +309,14 @@ void BedMeshScreen::onMeshUpdate(const int8_t, const int8_t, const float) {
onRefresh();
}

bool BedMeshScreen::isMeshComplete(ExtUI::bed_mesh_t data) {
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) {
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) {
if (isnan(data[x][y])) {
return false;
}
}
}
return true;
}

void BedMeshScreen::onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t state) {
switch (state) {
case ExtUI::MESH_START:
screen_data.BedMesh.count = 0;
screen_data.BedMesh.message = screen_data.BedMesh.MSG_NONE;
break;
case ExtUI::MESH_FINISH:
if (screen_data.BedMesh.count == GRID_MAX_POINTS && isMeshComplete(ExtUI::getMeshArray()))
if (screen_data.BedMesh.count == GRID_MAX_POINTS && ExtUI::getMeshValid())
screen_data.BedMesh.message = screen_data.BedMesh.MSG_MESH_COMPLETE;
else
screen_data.BedMesh.message = screen_data.BedMesh.MSG_MESH_INCOMPLETE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ class StepsScreen : public BaseNumericAdjustmentScreen, public CachedScreen<STEP
static float getHightlightedValue();
static void drawHighlightedPointValue();
static void drawMesh(int16_t x, int16_t y, int16_t w, int16_t h, ExtUI::bed_mesh_t data, uint8_t opts, float autoscale_max = 0.1);
static bool isMeshComplete(ExtUI::bed_mesh_t data);

public:
static void onMeshUpdate(const int8_t x, const int8_t y, const float val);
Expand Down

0 comments on commit 6b45867

Please sign in to comment.