Skip to content

Commit

Permalink
⛙ Merge w/Marlin
Browse files Browse the repository at this point in the history
  • Loading branch information
classicrocker883 committed Oct 3, 2024
2 parents 1f6d0ed + 11046b2 commit 8a275d9
Show file tree
Hide file tree
Showing 78 changed files with 621 additions and 185 deletions.
2 changes: 1 addition & 1 deletion Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@
#define FTM_SHAPING_DEFAULT_FREQ_X 37.0f // (Hz) Default peak frequency used by input shapers
#define FTM_SHAPING_DEFAULT_FREQ_Y 37.0f // (Hz) Default peak frequency used by input shapers
#define FTM_LINEAR_ADV_DEFAULT_ENA false // Default linear advance enable (true) or disable (false)
#define FTM_LINEAR_ADV_DEFAULT_K 0 // Default linear advance gain, integer value. (Acceleration-based scaling factor.)
#define FTM_LINEAR_ADV_DEFAULT_K 0.0f // Default linear advance gain. (Acceleration-based scaling factor.)
#define FTM_SHAPING_ZETA_X 0.1f // Zeta used by input shapers for X axis
#define FTM_SHAPING_ZETA_Y 0.1f // Zeta used by input shapers for Y axis

Expand Down
1 change: 1 addition & 0 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
#define BOARD_BTT_MANTA_M5P_V1_0 4004 // BigTreeTech Manta M5P V1.0 (STM32G0B1RE)
#define BOARD_BTT_MANTA_M8P_V1_0 4005 // BigTreeTech Manta M8P V1.0 (STM32G0B1VE)
#define BOARD_BTT_MANTA_M8P_V1_1 4006 // BigTreeTech Manta M8P V1.1 (STM32G0B1VE)
#define BOARD_BTT_SKRAT_V1_0 4007 // BigTreeTech SKRat V1.0 (STM32G0B1VE)

//
// STM32 ARM Cortex-M3
Expand Down
26 changes: 9 additions & 17 deletions Marlin/src/feature/e_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ extern bool wait_for_user, wait_for_heatup;
#endif

void EmergencyParser::update(EmergencyParser::State &state, const uint8_t c) {
auto uppercase = [](char c) {
return TERN0(GCODE_CASE_INSENSITIVE, WITHIN(c, 'a', 'z')) ? c + 'A' - 'a' : c;
};

switch (state) {
case EP_RESET:
switch (c) {
switch (uppercase(c)) {
case ' ': case '\n': case '\r': break;
case 'N': state = EP_N; break;
case 'M': state = EP_M; break;
Expand All @@ -81,7 +85,7 @@ void EmergencyParser::update(EmergencyParser::State &state, const uint8_t c) {
break;

case EP_N:
switch (c) {
switch (uppercase(c)) {
case '0' ... '9':
case '-': case ' ': break;
case 'M': state = EP_M; break;
Expand Down Expand Up @@ -152,20 +156,8 @@ void EmergencyParser::update(EmergencyParser::State &state, const uint8_t c) {
#endif

#if ENABLED(EP_BABYSTEPPING)
case EP_M2:
switch (c) {
case '9': state = EP_M29; break;
default: state = EP_IGNORE;
}
break;

case EP_M29:
switch (c) {
case '3': state = EP_M293; break;
case '4': state = EP_M294; break;
default: state = EP_IGNORE;
}
break;
case EP_M2: state = (c == '9') ? EP_M29 : EP_IGNORE; break;
case EP_M29: state = (c == '3') ? EP_M293 : (c == '4') ? EP_M294 : EP_IGNORE; break;
#endif

#if ENABLED(HOST_PROMPT_SUPPORT)
Expand All @@ -174,7 +166,7 @@ void EmergencyParser::update(EmergencyParser::State &state, const uint8_t c) {
case EP_M87: state = (c == '6') ? EP_M876 : EP_IGNORE; break;

case EP_M876:
switch (c) {
switch (uppercase(c)) {
case ' ': break;
case 'S': state = EP_M876S; break;
default: state = EP_IGNORE; break;
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/gcode/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ void GCodeParser::parse(char *p) {
reset(); // No codes to report

auto uppercase = [](char c) {
if (TERN0(GCODE_CASE_INSENSITIVE, WITHIN(c, 'a', 'z')))
c += 'A' - 'a';
return c;
return TERN0(GCODE_CASE_INSENSITIVE, WITHIN(c, 'a', 'z')) ? c + 'A' - 'a' : c;
};

// Skip spaces
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class GCodeParser {
#if ENABLED(GCODE_CASE_INSENSITIVE)
FORCE_INLINE static char* strgchr(char *p, char g) {
auto uppercase = [](char c) {
return c + (WITHIN(c, 'a', 'z') ? 'A' - 'a' : 0);
return TERN0(GCODE_CASE_INSENSITIVE, WITHIN(c, 'a', 'z')) ? c + 'A' - 'a' : c;
};
const char d = uppercase(g);
for (char cc; (cc = uppercase(*p)); p++) if (cc == d) return p;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals-2-LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@
#if !HAS_MARLINUI_HD44780
#undef LCD_INFO_SCREEN_STYLE
#endif
#if NONE(HAS_MARLINUI_U8GLIB, HAS_TFT_LVGL_UI, DGUS_LCD_UI_E3S1PRO)
#if NONE(HAS_MARLINUI_U8GLIB, HAS_TFT_LVGL_UI, TFT_COLOR_UI, DGUS_LCD_UI_E3S1PRO)
#undef LCD_LANGUAGE
#endif
#if DISABLED(MPC_AUTOTUNE)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ void menu_move() {
#if HAS_EXTRUDERS
EDIT_ITEM(bool, MSG_LINEAR_ADVANCE, &c.linearAdvEna);
if (c.linearAdvEna || ENABLED(FT_MOTION_NO_MENU_TOGGLE))
EDIT_ITEM(float42_52, MSG_ADVANCE_K, &c.linearAdvK, 0, 10);
EDIT_ITEM(float62, MSG_ADVANCE_K, &c.linearAdvK, 0.0f, 1000.0f);
#endif
}
END_MENU();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/ft_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ void FTMotion::makeVector() {
#if HAS_EXTRUDERS
if (cfg.linearAdvEna) {
float dedt_adj = (traj.e[makeVector_batchIdx] - e_raw_z1) * (FTM_FS);
if (ratio.e > 0.0f) dedt_adj += accel_k * cfg.linearAdvK;
if (ratio.e > 0.0f) dedt_adj += accel_k * cfg.linearAdvK * 0.0001f;

e_raw_z1 = traj.e[makeVector_batchIdx];
e_advanced_z1 += dedt_adj * (FTM_TS);
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@
#include "stm32g0/pins_BTT_MANTA_M8P_V1_0.h" // STM32G0 env:STM32G0B1VE_btt
#elif MB(BTT_MANTA_M8P_V1_1)
#include "stm32g0/pins_BTT_MANTA_M8P_V1_1.h" // STM32G0 env:STM32G0B1VE_btt
#elif MB(BTT_SKRAT_V1_0)
#include "stm32g0/pins_BTT_SKRAT_V1_0.h" // STM32G0 env:STM32G0B1VE_btt env:STM32G0B1VE_btt_xfer

//
// STM32 ARM Cortex-M0
Expand Down
Loading

0 comments on commit 8a275d9

Please sign in to comment.