Skip to content

Commit

Permalink
Preliminary BTT Octopus Support
Browse files Browse the repository at this point in the history
Little fixes
  • Loading branch information
mriscoc committed Jan 13, 2023
1 parent c208664 commit 68791f2
Show file tree
Hide file tree
Showing 51 changed files with 1,014 additions and 435 deletions.
Binary file modified Marlin/lib/proui/gd32f10/libproui_abl.a
Binary file not shown.
Binary file modified Marlin/lib/proui/gd32f10/libproui_mbl.a
Binary file not shown.
Binary file modified Marlin/lib/proui/gd32f10/libproui_ubl.a
Binary file not shown.
Binary file modified Marlin/lib/proui/stm32f1/libproui_abl.a
Binary file not shown.
Binary file modified Marlin/lib/proui/stm32f1/libproui_mbl.a
Binary file not shown.
Binary file modified Marlin/lib/proui/stm32f1/libproui_ubl.a
Binary file not shown.
Binary file modified Marlin/lib/proui/stm32f4/libproui_abl.a
Binary file not shown.
Binary file modified Marlin/lib/proui/stm32f4/libproui_mbl.a
Binary file not shown.
Binary file modified Marlin/lib/proui/stm32f4/libproui_ubl.a
Binary file not shown.
Binary file modified Marlin/lib/proui/stm32g0/libproui_abl.a
Binary file not shown.
Binary file modified Marlin/lib/proui/stm32g0/libproui_mbl.a
Binary file not shown.
Binary file modified Marlin/lib/proui/stm32g0/libproui_ubl.a
Binary file not shown.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/SAMD21/timers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {

}
else if (timer_config[timer_num].type==TimerType::tcc) {

Tcc * const tc = timer_config[timer_num].pTcc;

PM->APBCMASK.reg |= PM_APBCMASK_TCC0;
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@ void setup() {
#if FREEZE_STATE
SET_INPUT_PULLDOWN(FREEZE_PIN);
#else
SET_INPUT_PULLUP(FREEZE_PIN);
#endif
SET_INPUT_PULLUP(FREEZE_PIN);
#endif
#endif

#if HAS_SUICIDE
Expand Down
10 changes: 10 additions & 0 deletions Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -742,3 +742,13 @@
#define _HAS_E_TEMP(N) || TEMP_SENSOR(N)
#define HAS_E_TEMP_SENSOR (0 REPEAT(EXTRUDERS, _HAS_E_TEMP))
#define TEMP_SENSOR_IS_MAX_TC(T) (TEMP_SENSOR(T) == -5 || TEMP_SENSOR(T) == -3 || TEMP_SENSOR(T) == -2)

#define _UI_NONE 0
#define _UI_ORIGIN 101
#define _UI_FYSETC 102
#define _UI_HIPRECY 103
#define _UI_MKS 104
#define _UI_RELOADED 105
#define _UI_IA_CREALITY 106
#define _DGUS_UI_IS(N) || (CAT(_UI_, DGUS_LCD_UI) == CAT(_UI_, N))
#define DGUS_UI_IS(V...) (0 MAP(_DGUS_UI_IS, V))
2 changes: 1 addition & 1 deletion Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class mesh_bed_leveling {
static float get_z_correction(const xy_pos_t &pos) {
const xy_int8_t ind = cell_indexes(pos);
const float x1 = index_to_xpos[ind.x], x2 = index_to_xpos[ind.x+1],
y1 = index_to_xpos[ind.y], y2 = index_to_xpos[ind.y+1],
y1 = index_to_ypos[ind.y], y2 = index_to_ypos[ind.y+1],
z1 = calc_z0(pos.x, x1, z_values[ind.x][ind.y ], x2, z_values[ind.x+1][ind.y ]),
z2 = calc_z0(pos.x, x1, z_values[ind.x][ind.y+1], x2, z_values[ind.x+1][ind.y+1]),
zf = calc_z0(pos.y, y1, z1, y2, z2);
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/feature/bedlevel/ubl/ubl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ void unified_bed_leveling::display_map(const uint8_t map_type) {
IF_DISABLED(ProUIex, constexpr) uint8_t eachsp = 1 + 6 + 1, // [-3.567]
twixt = eachsp * (GRID_MAX_POINTS_X) - 9 * 2; // Leading 4sp, Coordinates 9sp each


const bool human = !(map_type & 0x3), csv = map_type == 1, lcd = map_type == 2, comp = map_type & 0x4;

SERIAL_ECHOPGM("\nBed Topography Report");
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/feature/bedlevel/ubl/ubl.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ class unified_bed_leveling {
return z0;
}
static float get_z_correction(const xy_pos_t &pos) { return get_z_correction(pos.x, pos.y); }

static constexpr float get_z_offset() { return 0.0f; }

#if ProUIex
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
if (resume_position.e < 0) unscaled_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
#ifdef ADVANCED_PAUSE_RESUME_PRIME
if (ADVANCED_PAUSE_RESUME_PRIME != 0)
unscaled_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE));
unscaled_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE));
#endif

// Now all extrusion positions are resumed and ready to be confirmed
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/bedlevel/mbl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void GcodeSuite::G29() {
if (!ui.wait_for_move) {
queue.inject(parser.seen_test('N') ? F("G28" TERN(CAN_SET_LEVELING_AFTER_G28, "L0", "") "\nG29S2") : F("G29S2"));
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart());
TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart());

// Position bed horizontally and Z probe vertically.
#if defined(SAFE_BED_LEVELING_START_X) || defined(SAFE_BED_LEVELING_START_Y) || defined(SAFE_BED_LEVELING_START_Z) \
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 'S': case 'P': case 'R': break; // Invalid S, P, R commands already filtered
#endif

#if ENABLED(DWIN_LCD_PROUI)
#if BOTH(DWIN_LCD_PROUI, HAS_CGCODE)
case 'C' : DWIN_Gcode(parser.codenum); break; // ProUIex Cn: Custom Gcodes
#endif

Expand Down
24 changes: 12 additions & 12 deletions Marlin/src/gcode/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,20 @@ class GCodeParser {
// Float removes 'E' to prevent scientific notation interpretation
static float value_float() {
if (!value_ptr) return 0;
char *e = value_ptr;
for (;;) {
const char c = *e;
if (c == '\0' || c == ' ') break;
if (c == 'E' || c == 'e' || c == 'X' || c == 'x') {
*e = '\0';
const float ret = strtof(value_ptr, nullptr);
*e = c;
return ret;
}
++e;
char *e = value_ptr;
for (;;) {
const char c = *e;
if (c == '\0' || c == ' ') break;
if (c == 'E' || c == 'e' || c == 'X' || c == 'x') {
*e = '\0';
const float ret = strtof(value_ptr, nullptr);
*e = c;
return ret;
}
return strtof(value_ptr, nullptr);
++e;
}
return strtof(value_ptr, nullptr);
}

// Code value as a long or ulong
static int32_t value_long() { return value_ptr ? strtol(value_ptr, nullptr, 10) : 0L; }
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/stats/M75-M78.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ void GcodeSuite::M77() {
#if ENABLED(PRINTCOUNTER)

/**
* M78: Show print statistics
*/
* M78: Show print statistics
*/
void GcodeSuite::M78() {
if (parser.intval('S') == 78) { // "M78 S78" will reset the statistics
print_job_timer.initStats();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2782,7 +2782,7 @@

// User Interface
#if ENABLED(FREEZE_FEATURE) && !PIN_EXISTS(FREEZE) && PIN_EXISTS(KILL)
#define FREEZE_PIN KILL_PIN
#define FREEZE_PIN KILL_PIN
#elif PIN_EXISTS(KILL) && TERN1(FREEZE_FEATURE, KILL_PIN != FREEZE_PIN)
#define HAS_KILL 1
#endif
Expand Down
22 changes: 11 additions & 11 deletions Marlin/src/lcd/e3v2/common/dwin_font.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
*/
#pragma once

typedef uint8_t font_t;
typedef uint8_t fontid_t;

/**
* 3-.0:The font size, 0x00-0x09, corresponds to the font size below:
* 0x00=6*12 0x01=8*16 0x02=10*20 0x03=12*24 0x04=14*28
* 0x05=16*32 0x06=20*40 0x07=24*48 0x08=28*56 0x09=32*64
*/
#define font6x12 (font_t)0x00
#define font8x16 (font_t)0x01
#define font10x20 (font_t)0x02
#define font12x24 (font_t)0x03
#define font14x28 (font_t)0x04
#define font16x32 (font_t)0x05
#define font20x40 (font_t)0x06
#define font24x48 (font_t)0x07
#define font28x56 (font_t)0x08
#define font32x64 (font_t)0x09
#define font6x12 (fontid_t)0x00
#define font8x16 (fontid_t)0x01
#define font10x20 (fontid_t)0x02
#define font12x24 (fontid_t)0x03
#define font14x28 (fontid_t)0x04
#define font16x32 (fontid_t)0x05
#define font20x40 (fontid_t)0x06
#define font24x48 (fontid_t)0x07
#define font28x56 (fontid_t)0x08
#define font32x64 (fontid_t)0x09
8 changes: 4 additions & 4 deletions Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Bed Level Tools for Pro UI
* Extended by: Miguel A. Risco-Castillo (MRISCOC)
* Version: 2.0.0
* Date: 2022/05/23
* Version: 2.1.0
* Date: 2022/08/27
*
* Based on the original work of: Henri-J-Norden
* https://github.com/Jyers/Marlin/pull/126
Expand Down Expand Up @@ -274,6 +274,6 @@ bool BedLevelToolsClass::meshvalidate() {
ui.set_status(msg);
drawing_mesh = false;
}
#endif
#endif // USE_UBL_VIEWER

#endif // DWIN_LCD_PROUI
#endif // DWIN_LCD_PROUI && HAS_LEVELING
4 changes: 2 additions & 2 deletions Marlin/src/lcd/e3v2/proui/bedlevel_tools.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Bed Level Tools for Pro UI
* Extended by: Miguel A. Risco-Castillo (MRISCOC)
* Version: 2.0.0
* Date: 2022/05/23
* Version: 2.1.0
* Date: 2022/08/27
*
* Based on the original work of: Henri-J-Norden
* https://github.com/Jyers/Marlin/pull/126
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

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

#if ENABLED(DWIN_LCD_PROUI)
#if BOTH(DWIN_LCD_PROUI, HAS_CGCODE)

#include "../../../MarlinCore.h" // for wait_for_user
#include "../../../core/types.h"
Expand Down Expand Up @@ -158,4 +158,4 @@ void custom_gcode_report(const bool forReplay/*=true*/) {
#endif
}

#endif
#endif // DWIN_LCD_PROUI && HAS_CGCODE
Loading

0 comments on commit 68791f2

Please sign in to comment.