Skip to content

Commit

Permalink
Merge branch 'mecha-octopus' of https://github.com/Djonker83/Marlin i…
Browse files Browse the repository at this point in the history
…nto mecha-octopus
  • Loading branch information
Djonker83 committed Aug 9, 2024
2 parents 7488312 + 0ec1a54 commit 245416f
Show file tree
Hide file tree
Showing 147 changed files with 2,071 additions and 1,082 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ jobs:

# STM32F4
- ARMED
- BIGTREE_BTT002
- BIGTREE_GTR_V1_0
- BIGTREE_SKR_PRO
- BTT_BTT002
- BTT_GTR_V1_0
- BTT_SKR_PRO
- FLYF407ZG
- FYSETC_S6
- LERDGEK
Expand Down
61 changes: 35 additions & 26 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
*
* Calibration Guides: https://reprap.org/wiki/Calibration
* https://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
* https://web.archive.org/web/20220907014303/https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
* https://web.archive.org/web/20220907014303/sites.google.com/site/repraplogphase/calibration-of-your-reprap
* https://youtu.be/wAL9d7FgInk
* https://teachingtechyt.github.io/calibration.html
*
Expand Down Expand Up @@ -717,6 +717,9 @@
*/
#if ENABLED(MPCTEMP)
#define MPC_AUTOTUNE // Include a method to do MPC auto-tuning (~6.3K bytes of flash)
#if ENABLED(MPC_AUTOTUNE)
//#define MPC_AUTOTUNE_DEBUG // Enable MPC debug logging (~870 bytes of flash)
#endif
#define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1.3K bytes of flash)
#define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash)

Expand Down Expand Up @@ -1464,7 +1467,7 @@
* A lightweight, solenoid-driven probe.
* For information about this sensor https://github.com/bigtreetech/MicroProbe
*
* Also requires: PROBE_ENABLE_DISABLE
* Also requires: PROBE_ENABLE_DISABLE, ENDSTOP_INTERRUPTS_FEATURE if FT_MOTION is enabled.
*/
//#define BIQU_MICROPROBE_V1 // Triggers HIGH
//#define BIQU_MICROPROBE_V2 // Triggers LOW
Expand Down Expand Up @@ -1723,6 +1726,8 @@
#define PROBING_BED_TEMP 50
#endif

// @section stepper drivers

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{ 0:'Low', 1:'High' }
#define X_ENABLE_ON 0
Expand Down Expand Up @@ -1896,6 +1901,8 @@
#endif

/**
* @section filament runout sensors
*
* Filament Runout Sensors
* Mechanical or opto endstops are used to check for the presence of filament.
*
Expand Down Expand Up @@ -2416,11 +2423,11 @@
#define PREHEAT_2_TEMP_HOTEND 240
#define PREHEAT_2_TEMP_BED 110
#define PREHEAT_2_TEMP_CHAMBER 35
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255

// @section motion
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255

/**
* @section nozzle park
*
* Nozzle Park
*
* Park the nozzle at the given XYZ position on idle or G27.
Expand All @@ -2443,6 +2450,8 @@
#endif

/**
* @section nozzle clean
*
* Clean Nozzle Feature
*
* Adds the G12 command to perform a nozzle cleaning process.
Expand Down Expand Up @@ -2603,9 +2612,24 @@
//#include "Configuration_Secure.h" // External file with PASSWORD_DEFAULT_VALUE
#endif

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
// @section media

/**
* SD CARD
*
* SD Card support is disabled by default. If your controller has an SD slot,
* you must uncomment the following option or it won't work.
*/
//#define SDSUPPORT

/**
* SD CARD: ENABLE CRC
*
* Use CRC checks and retries on the SD communication.
*/
#if ENABLED(SDSUPPORT)
//#define SD_CHECK_AND_RETRY
#endif

// @section interface

Expand Down Expand Up @@ -2652,21 +2676,6 @@
*/
#define LCD_INFO_SCREEN_STYLE 0

/**
* SD CARD
*
* SD Card support is disabled by default. If your controller has an SD slot,
* you must uncomment the following option or it won't work.
*/
#define SDSUPPORT

/**
* SD CARD: ENABLE CRC
*
* Use CRC checks and retries on the SD communication.
*/
//#define SD_CHECK_AND_RETRY

/**
* LCD Menu Items
*
Expand Down Expand Up @@ -2795,7 +2804,7 @@

//
// Original RADDS LCD Display+Encoder+SDCardReader
// https://web.archive.org/web/20200719145306/http://doku.radds.org/dokumentation/lcd-display/
// https://web.archive.org/web/20200719145306/doku.radds.org/dokumentation/lcd-display/
//
//#define RADDS_DISPLAY

Expand Down Expand Up @@ -2861,7 +2870,7 @@

//
// Elefu RA Board Control Panel
// https://web.archive.org/web/20140823033947/http://www.elefu.com/index.php?route=product/product&product_id=53
// https://web.archive.org/web/20140823033947/www.elefu.com/index.php?route=product/product&product_id=53
//
//#define RA_CONTROL_PANEL

Expand Down Expand Up @@ -2993,7 +3002,7 @@

//
// Cartesio UI
// https://web.archive.org/web/20180605050442/http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
// https://web.archive.org/web/20180605050442/mauk.cc/webshop/cartesio-shop/electronics/user-interface
//
//#define CARTESIO_UI

Expand Down
4 changes: 2 additions & 2 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -3443,7 +3443,7 @@
/**
* Step on both rising and falling edge signals (as with a square wave).
*/
//#define EDGE_STEPPING
#define EDGE_STEPPING
/**
* Enable M122 debugging command for TMC stepper drivers.
Expand Down Expand Up @@ -3525,7 +3525,7 @@
//#define PHOTOGRAPH_PIN 23

// Canon Hack Development Kit
// https://web.archive.org/web/20200920094805/https://captain-slow.dk/2014/03/09/3d-printing-timelapses/
// https://web.archive.org/web/20200920094805/captain-slow.dk/2014/03/09/3d-printing-timelapses/
//#define CHDK_PIN 4

// Optional second move with delay to trigger the camera shutter
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2024-07-19"
//#define STRING_DISTRIBUTION_DATE "2024-08-07"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* Logical Pin: 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45
* Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7
* The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
* Logical pins 46-47 aren't supported by Teensyduino, but are supported below as E2 and E3
*/

#include "../fastio.h"
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/core/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@
#define STR_SOFT_MIN " Min: "
#define STR_SOFT_MAX " Max: "

#define STR_SAVED_POS "Position saved"
#define STR_RESTORING_POS "Restoring position"
#define STR_SAVED_POSITION "Saved position #"
#define STR_RESTORING_POSITION "Restoring position #"
#define STR_INVALID_POS_SLOT "Invalid slot. Total: "
#define STR_DONE "Done."

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

// Macros for bit masks
#undef _BV
#define _BV(n) (1<<(n))
#define _BV(b) (1 << (b))
#define TEST(n,b) (!!((n)&_BV(b)))
#define SET_BIT_TO(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0)
#ifndef SBI
Expand Down
88 changes: 71 additions & 17 deletions Marlin/src/core/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,36 +159,90 @@ template <class L, class R> struct IF<true, L, R> { typedef L type; };
#define FI FORCE_INLINE

// Define types based on largest bit width stored value required
#define bits_t(W) typename IF<((W)> 16), uint32_t, typename IF<((W)> 8), uint16_t, uint8_t>::type>::type
#define bits_t(W) typename IF<((W)> 32), uint64_t, typename IF<((W)> 16), uint32_t, typename IF<((W)>8), uint16_t, uint8_t>::type>::type>::type
#define uvalue_t(V) typename IF<((V)>65535), uint32_t, typename IF<((V)>255), uint16_t, uint8_t>::type>::type
#define value_t(V) typename IF<((V)>32767), int32_t, typename IF<((V)>127), int16_t, int8_t>::type>::type

// General Flags for some number of states
// Define a template for a bit field of N bits, using the smallest type that can hold N bits
template<size_t N, bool UseArray = (N > 64)>
struct Flags;

// Flag bits for <= 64 states
template<size_t N>
struct Flags {
struct Flags<N, false> {
typedef bits_t(N) flagbits_t;
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1; } N8;
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1; } N16;
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1,
b16:1, b17:1, b18:1, b19:1, b20:1, b21:1, b22:1, b23:1, b24:1, b25:1, b26:1, b27:1, b28:1, b29:1, b30:1, b31:1; } N32;
union {
flagbits_t b;
typename IF<(N>16), N32, typename IF<(N>8), N16, N8>::type>::type flag;
flagbits_t b;

class BitProxy {
public:
BitProxy(flagbits_t& data, int bit) : data_(data), bit_(bit) {}

BitProxy& operator=(const bool value) {
if (value)
data_ |= (flagbits_t(1) << bit_);
else
data_ &= ~(flagbits_t(1) << bit_);
return *this;
}

operator bool() const { return bool(data_ & (flagbits_t(1) << bit_)); }

private:
flagbits_t& data_;
uint8_t bit_;
};

FI void reset() { b = 0; }
FI void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
FI void set(const int n) { b |= (flagbits_t)_BV(n); }
FI void clear(const int n) { b &= ~(flagbits_t)_BV(n); }
FI bool test(const int n) const { return TEST(b, n); }
FI bool operator[](const int n) { return test(n); }
FI void set(const int n) { b |= (flagbits_t(1) << n); }
FI void clear(const int n) { b &= ~(flagbits_t(1) << n); }
FI bool test(const int n) const { return bool(b & (flagbits_t(1) << n)); }
FI BitProxy operator[](const int n) { return BitProxy(b, n); }
FI bool operator[](const int n) const { return test(n); }
FI int size() const { return sizeof(b); }
FI operator bool() const { return b; }
FI operator bool() const { return b != 0; }
};

// Flag bits for more than 64 states
template<size_t N>
struct Flags<N, true> {
uint8_t bitmask[(N+7)>>3];
// Proxy class for handling bit assignment
class BitProxy {
public:
BitProxy(uint8_t data[], int n) : data_(data[n >> 3]), bit_(n & 7) {}

// Assignment operator
BitProxy& operator=(const bool value) {
if (value)
data_ |= _BV(bit_);
else
data_ &= ~_BV(bit_);
return *this;
}

// Conversion operator to bool
operator bool() const { return TEST(data_, bit_); }

private:
uint8_t& data_;
uint8_t bit_;
};

FI void reset() { for (uint8_t b = 0; b < sizeof(bitmask); ++b) bitmask[b] = 0; }
FI void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
FI void set(const int n) { bitmask[n >> 3] |= _BV(n & 7); }
FI void clear(const int n) { bitmask[n >> 3] &= ~_BV(n & 7); }
FI bool test(const int n) const { return TEST(bitmask[n >> 3], n & 7); }
FI BitProxy operator[](const int n) { return BitProxy(bitmask, n); }
FI bool operator[](const int n) const { return test(n); }
FI int size() const { return sizeof(bitmask); }
FI operator bool() const { for (uint8_t b : bitmask) if (b) return true; return false; }
};

// Specialization for a single bool flag
template<>
struct Flags<1> {
struct Flags<1, false> {
bool b;
FI void reset() { b = false; }
FI void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
Expand Down Expand Up @@ -218,7 +272,7 @@ typedef struct {
FI bool operator[](const int n) { return flags[n]; }
FI bool operator[](const int n) const { return flags[n]; }
FI int size() const { return sizeof(flags); }
FI operator bool() const { return flags; }
FI operator bool() const { return (bool)flags; }
} AxisFlags;

//
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/feature/binary_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ class SDFileTransferProtocol {
transfer_timeout = millis() + TIMEOUT;
switch (static_cast<FileTransfer>(packet_type)) {
case FileTransfer::QUERY:
SERIAL_ECHOPGM("PFT:version:", VERSION_MAJOR, ".", VERSION_MINOR, ".", VERSION_PATCH);
SERIAL_ECHO(F("PFT:version:"), VERSION_MAJOR, C('.'), VERSION_MINOR, C('.'), VERSION_PATCH);
#if ENABLED(BINARY_STREAM_COMPRESSION)
SERIAL_ECHOLNPGM(":compression:heatshrink,", HEATSHRINK_STATIC_WINDOW_BITS, ",", HEATSHRINK_STATIC_LOOKAHEAD_BITS);
SERIAL_ECHOLN(F(":compression:heatshrink,"), HEATSHRINK_STATIC_WINDOW_BITS, C(','), HEATSHRINK_STATIC_LOOKAHEAD_BITS);
#else
SERIAL_ECHOLNPGM(":compression:none");
#endif
Expand Down Expand Up @@ -322,7 +322,7 @@ class BinaryStream {
if (packet.header.checksum == packet.header_checksum) {
// The SYNC control packet is a special case in that it doesn't require the stream sync to be correct
if (static_cast<Protocol>(packet.header.protocol()) == Protocol::CONTROL && static_cast<ProtocolControl>(packet.header.type()) == ProtocolControl::SYNC) {
SERIAL_ECHOLNPGM("ss", sync, ",", buffer_size, ",", VERSION_MAJOR, ".", VERSION_MINOR, ".", VERSION_PATCH);
SERIAL_ECHOLN(F("ss"), sync, C(','), buffer_size, C(','), VERSION_MAJOR, C('.'), VERSION_MINOR, C('.'), VERSION_PATCH);
stream_state = StreamState::PACKET_RESET;
break;
}
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/gcode/bedlevel/G26.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
*
* L # Layer Layer height. (Height of nozzle above bed) If not specified .20mm will be used.
*
* O # Ooooze How much your nozzle will Ooooze filament while getting in position to print. This
* is over kill, but using this parameter will let you get the very first 'circle' perfect
* so you have a trophy to peel off of the bed and hang up to show how perfectly you have your
* Mesh calibrated. If not specified, a filament length of .3mm is assumed.
* O # Ooze How much your nozzle will Ooooze filament while getting in position to print. If not
* specified, a filament length of .3mm is assumed. This might be overkill, but this
* parameter ensures the very first 'circle' is perfect (providing an ideal trophy to hang
* up to show off your perfectly calibrated Mesh).
*
* P # Prime Prime the nozzle with specified length of filament. If this parameter is not
* given, no prime action will take place. If the parameter specifies an amount, that much
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/bedlevel/G42.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* F<feedrate> : Feedrate in mm/min
* I<index> : X axis point index
* J<index> : Y axis point index
* P<bool> : Flag to put the prove at the given point
* P : Flag to put the probe at the given point
*/
void GcodeSuite::G42() {
if (MOTION_CONDITIONS) {
Expand All @@ -58,7 +58,7 @@ void GcodeSuite::G42() {
if (hasJ) destination.y = bedlevel.get_mesh_y(iy);

#if HAS_PROBE_XY_OFFSET
if (parser.boolval('P')) {
if (parser.seen_test('P')) {
if (hasI) destination.x -= probe.offset_xy.x;
if (hasJ) destination.y -= probe.offset_xy.y;
}
Expand Down
Loading

0 comments on commit 245416f

Please sign in to comment.