Skip to content

Commit

Permalink
fix Y
Browse files Browse the repository at this point in the history
  • Loading branch information
solawc committed Dec 23, 2021
1 parent eda007d commit 943658f
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 62 deletions.
46 changes: 23 additions & 23 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
*
* :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000]
*/
#define BAUDRATE 250000
#define BAUDRATE 115200
//#define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate

/**
Expand Down Expand Up @@ -737,8 +737,8 @@
* details can be tuned in Configuration_adv.h
*/

#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
// #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
// #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber
#define THERMAL_PROTECTION_COOLER // Enable thermal protection for the laser cooling

Expand Down Expand Up @@ -829,9 +829,9 @@
#endif

// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define X_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define I_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define J_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define K_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
Expand Down Expand Up @@ -861,9 +861,9 @@
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
*/
#define X_DRIVER_TYPE A4988
#define Y_DRIVER_TYPE A4988
#define Z_DRIVER_TYPE A4988
// #define X_DRIVER_TYPE A4988
// #define Y_DRIVER_TYPE A4988
// #define Z_DRIVER_TYPE A4988
//#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
Expand All @@ -872,7 +872,7 @@
//#define I_DRIVER_TYPE A4988
//#define J_DRIVER_TYPE A4988
//#define K_DRIVER_TYPE A4988
#define E0_DRIVER_TYPE A4988
// #define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
//#define E3_DRIVER_TYPE A4988
Expand Down Expand Up @@ -927,7 +927,7 @@
* Override with M92
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
*/
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 1600, 400 }
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 }

/**
* Default Max Feed Rate (mm/s)
Expand All @@ -947,7 +947,7 @@
* Override with M201
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
*/
#define DEFAULT_MAX_ACCELERATION { 200, 200, 50, 500 }
#define DEFAULT_MAX_ACCELERATION { 500, 500, 50, 500 }

//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2
#if ENABLED(LIMITED_MAX_ACCEL_EDITING)
Expand Down Expand Up @@ -1030,7 +1030,7 @@
* The probe replaces the Z-MIN endstop and is used for Z homing.
* (Automatically enables USE_PROBE_FOR_Z_HOMING.)
*/
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
// #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

// Force the use of the probe for Z-axis homing
//#define USE_PROBE_FOR_Z_HOMING
Expand Down Expand Up @@ -1087,7 +1087,7 @@
/**
* The BLTouch probe uses a Hall effect sensor and emulates a servo.
*/
//#define BLTOUCH
// #define BLTOUCH

/**
* Touch-MI Probe by hotends.fr
Expand Down Expand Up @@ -1179,11 +1179,11 @@
* | [-] |
* O-- FRONT --+
*/
#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
#define NOZZLE_TO_PROBE_OFFSET { -20, -0.5, -2.8 }

// Most probes should stay away from the edges of the bed, but
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
#define PROBING_MARGIN 10
#define PROBING_MARGIN 30

// X and Y axis travel speed (mm/min) between probes
#define XY_PROBE_FEEDRATE (133*60)
Expand Down Expand Up @@ -1369,16 +1369,16 @@
// @section machine

// The size of the printable area
#define X_BED_SIZE 200
#define Y_BED_SIZE 200
#define X_BED_SIZE 260
#define Y_BED_SIZE 260

// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE
#define Z_MAX_POS 200
#define Z_MAX_POS 330
//#define I_MIN_POS 0
//#define I_MAX_POS 50
//#define J_MIN_POS 0
Expand Down Expand Up @@ -1536,7 +1536,7 @@
*/
//#define AUTO_BED_LEVELING_3POINT
//#define AUTO_BED_LEVELING_LINEAR
//#define AUTO_BED_LEVELING_BILINEAR
// #define AUTO_BED_LEVELING_BILINEAR
//#define AUTO_BED_LEVELING_UBL
//#define MESH_BED_LEVELING

Expand Down Expand Up @@ -1737,7 +1737,7 @@
* - Allows Z homing only when XY positions are known and trusted.
* - If stepper drivers sleep, XY homing may be required again before Z homing.
*/
//#define Z_SAFE_HOMING
// #define Z_SAFE_HOMING

#if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing
Expand Down Expand Up @@ -2664,7 +2664,7 @@
// 480x320, 3.5", FSMC Display From MKS
// Normally used in MKS Robin Nano V1.2
//
//#define MKS_ROBIN_TFT35
// #define MKS_ROBIN_TFT35

//
// 480x272, 4.3", FSMC Display From MKS
Expand Down Expand Up @@ -2752,7 +2752,7 @@
* TFT_ROTATE_270, TFT_ROTATE_270_MIRROR_X, TFT_ROTATE_270_MIRROR_Y,
* TFT_MIRROR_X, TFT_MIRROR_Y, TFT_NO_ROTATION
*/
//#define TFT_ROTATION TFT_NO_ROTATION
#define TFT_ROTATION TFT_ROTATE_180

//=============================================================================
//============================ Other Controllers ============================
Expand Down
14 changes: 7 additions & 7 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@
*
* [1] On AVR an interrupt-capable pin is best for UHS3 compatibility.
*/
#define USB_FLASH_DRIVE_SUPPORT
// #define USB_FLASH_DRIVE_SUPPORT
#if ENABLED(USB_FLASH_DRIVE_SUPPORT)
/**
* USB Host Shield Library
Expand All @@ -1508,7 +1508,7 @@
/**
* Native USB Host supported by some boards (USB OTG)
*/
#define USE_OTG_USB_HOST
// #define USE_OTG_USB_HOST

#if DISABLED(USE_OTG_USB_HOST)
#define USB_CS_PIN SDSS
Expand Down Expand Up @@ -1550,7 +1550,7 @@
//#define NO_SD_DETECT

// Multiple volume support - EXPERIMENTAL.
#define MULTI_VOLUME
// #define MULTI_VOLUME
#if ENABLED(MULTI_VOLUME)
#define VOLUME_SD_ONBOARD 1
#define VOLUME_USB_FLASH_DRIVE 2
Expand Down Expand Up @@ -1950,10 +1950,10 @@
* the probe to be unable to reach any points.
*/
#if PROBE_SELECTED && !IS_KINEMATIC
//#define PROBING_MARGIN_LEFT PROBING_MARGIN
//#define PROBING_MARGIN_RIGHT PROBING_MARGIN
//#define PROBING_MARGIN_FRONT PROBING_MARGIN
//#define PROBING_MARGIN_BACK PROBING_MARGIN
#define PROBING_MARGIN_LEFT PROBING_MARGIN
#define PROBING_MARGIN_RIGHT PROBING_MARGIN
#define PROBING_MARGIN_FRONT PROBING_MARGIN
#define PROBING_MARGIN_BACK PROBING_MARGIN
#endif

#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/tft/tft_fsmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void TFT_FSMC::Init() {
DMAtx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
DMAtx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
DMAtx.Init.Mode = DMA_NORMAL;
DMAtx.Init.Priority = DMA_PRIORITY_HIGH;
DMAtx.Init.Priority = DMA_PRIORITY_VERY_HIGH;

LCD = (LCD_CONTROLLER_TypeDef *)controllerAddress;
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/STM32/timers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
#define MCU_STEP_TIMER 16
#define MCU_TEMP_TIMER 17
#elif defined(STM32F1xx)
#define MCU_STEP_TIMER 4
#define MCU_TEMP_TIMER 2
#define MCU_STEP_TIMER 4 // 4
#define MCU_TEMP_TIMER 2 // 2
#elif defined(STM32F401xC) || defined(STM32F401xE)
#define MCU_STEP_TIMER 9
#define MCU_TEMP_TIMER 10
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/feature/bedlevel/bedlevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) {
planner.unapply_leveling(current_position);
if (DEBUGGING(LEVELING)) DEBUG_POS("...Now ON", current_position);
}

sync_plan_position();
}
}
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,4 +549,5 @@ void GcodeSuite::G28() {
L64xxManager.set_param((L64XX_axis_t)cv, L6470_ABS_POS, stepper.position(L64XX_axis_xref[cv]));
}
#endif
// set_bed_leveling_enabled(true);
}
4 changes: 2 additions & 2 deletions Marlin/src/gcode/control/M993_M994.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void GcodeSuite::M993() {

uint8_t buf[1024];
uint32_t addr = 0;
W25QXX.init(SPI_QUARTER_SPEED);
W25QXX.init(SPI_FULL_SPEED);
SERIAL_ECHOPGM("Save SPI Flash");
while (addr < SPI_FLASH_SIZE) {
W25QXX.SPI_FLASH_BufferRead(buf, addr, COUNT(buf));
Expand Down Expand Up @@ -71,7 +71,7 @@ void GcodeSuite::M994() {

uint8_t buf[1024];
uint32_t addr = 0;
W25QXX.init(SPI_QUARTER_SPEED);
W25QXX.init(SPI_FULL_SPEED);
W25QXX.SPI_FLASH_BulkErase();
SERIAL_ECHOPGM("Load SPI Flash");
while (addr < SPI_FLASH_SIZE) {
Expand Down
12 changes: 9 additions & 3 deletions Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
if (uiCfg.curTempType == 0) {
int16_t max_target;
thermalManager.temp_hotend[uiCfg.extruderIndex].target += uiCfg.stepHeat;
if (uiCfg.extruderIndex == 0)
max_target = HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1);
#ifdef WATCH_TEMP_INCREASE
if (uiCfg.extruderIndex == 0){
max_target = HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1);

}
else {
#if HAS_MULTI_HOTEND
max_target = HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1);
Expand All @@ -75,14 +78,17 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
if (thermalManager.degTargetHotend(uiCfg.extruderIndex) > max_target)
thermalManager.setTargetHotend(max_target, uiCfg.extruderIndex);
thermalManager.start_watching_hotend(uiCfg.extruderIndex);
#endif
}
else {
#if HAS_HEATED_BED
constexpr int16_t max_target = BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1);
thermalManager.temp_bed.target += uiCfg.stepHeat;
#ifdef WATCH_BED_TEMP_INCREASE
constexpr int16_t max_target = BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1);
if (thermalManager.degTargetBed() > max_target)
thermalManager.setTargetBed(max_target);
thermalManager.start_watching_bed();
#endif
#endif
}
disp_desire_temp();
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void disp_Limit_ok() {
lv_obj_set_style(limit_info, &limit_style);
lv_label_set_text(limit_info, "Limit:ok");
}

void disp_Limit_error() {
limit_style.text.color.full = 0xF800;
lv_obj_set_style(limit_info, &limit_style);
Expand Down
5 changes: 5 additions & 0 deletions Marlin/src/lcd/extui/mks_ui/draw_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,13 @@ void lv_draw_set() {
#if HAS_LANG_SELECT_SCREEN
lv_big_button_create(mks_ui.src_main, "F:/bmp_language.bin", set_menu.language, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_LANGUAGE);
#endif

#if ENABLED(MKS_WIFI_MODULE)
#ifndef USE_NEW_LVGL_CONF
lv_big_button_create(scr, "F:/bmp_wifi.bin", set_menu.wifi, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_WIFI);
#else
lv_big_button_create(mks_ui.src_main, "F:/bmp_wifi.bin", set_menu.wifi, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_WIFI);
#endif
#endif
lv_big_button_create(mks_ui.src_main, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_RETURN);
#endif
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/lcd/extui/mks_ui/draw_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ void ui_cfg_init() {
void update_spi_flash() {
uint8_t command_buf[512];

W25QXX.init(SPI_QUARTER_SPEED);
W25QXX.init(SPI_FULL_SPEED);
// read back the gcode command before erase spi flash
W25QXX.SPI_FLASH_BufferRead((uint8_t *)&command_buf, GCODE_COMMAND_ADDR, sizeof(command_buf));
W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR);
Expand All @@ -248,7 +248,7 @@ void update_spi_flash() {
void update_gcode_command(int addr, uint8_t *s) {
uint8_t command_buf[512];

W25QXX.init(SPI_QUARTER_SPEED);
W25QXX.init(SPI_FULL_SPEED);
// read back the gcode command before erase spi flash
W25QXX.SPI_FLASH_BufferRead((uint8_t *)&command_buf, GCODE_COMMAND_ADDR, sizeof(command_buf));
W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR);
Expand All @@ -265,7 +265,7 @@ void update_gcode_command(int addr, uint8_t *s) {
}

void get_gcode_command(int addr, uint8_t *d) {
W25QXX.init(SPI_QUARTER_SPEED);
W25QXX.init(SPI_FULL_SPEED);
W25QXX.SPI_FLASH_BufferRead((uint8_t *)d, addr, 100);
}

Expand Down Expand Up @@ -629,7 +629,7 @@ char *creat_title_text() {
}
SPI_TFT.tftio.WriteSequence((uint16_t*)bmp_public_buf, 200);
#if HAS_BAK_VIEW_IN_FLASH
W25QXX.init(SPI_QUARTER_SPEED);
W25QXX.init(SPI_FULL_SPEED);
if (row < 20) W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35 + row * 4096);
W25QXX.SPI_FLASH_BufferWrite(bmp_public_buf, BAK_VIEW_ADDR_TFT35 + row * 400, 400);
#endif
Expand Down Expand Up @@ -674,7 +674,7 @@ char *creat_title_text() {
void draw_default_preview(int xpos_pixel, int ypos_pixel, uint8_t sel) {
int index;
int y_off = 0;
W25QXX.init(SPI_QUARTER_SPEED);
W25QXX.init(SPI_FULL_SPEED);
for (index = 0; index < 10; index++) { // 200*200
#if HAS_BAK_VIEW_IN_FLASH
if (sel == 1) {
Expand All @@ -692,7 +692,7 @@ char *creat_title_text() {

y_off++;
}
W25QXX.init(SPI_QUARTER_SPEED);
W25QXX.init(SPI_FULL_SPEED);
}

void disp_pre_gcode(int xpos_pixel, int ypos_pixel) {
Expand Down
Loading

0 comments on commit 943658f

Please sign in to comment.