Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding
This commit is contained in:
+20
-8
@@ -260,15 +260,19 @@
|
||||
//===========================================================================
|
||||
|
||||
/**
|
||||
* Here are some standard links for getting your machine calibrated:
|
||||
* Here are some useful links to help get your machine configured and calibrated:
|
||||
*
|
||||
* https://reprap.org/wiki/Calibration
|
||||
* https://youtu.be/wAL9d7FgInk
|
||||
* http://calculator.josefprusa.cz
|
||||
* https://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
|
||||
* https://www.thingiverse.com/thing:5573
|
||||
* https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
|
||||
* https://www.thingiverse.com/thing:298812
|
||||
* Example Configs: https://github.com/MarlinFirmware/Configurations/branches/all
|
||||
*
|
||||
* Průša Calculator: https://blog.prusaprinters.org/calculator_3416/
|
||||
*
|
||||
* Calibration Guides: https://reprap.org/wiki/Calibration
|
||||
* https://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
|
||||
* https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
|
||||
* https://youtu.be/wAL9d7FgInk
|
||||
*
|
||||
* Calibration Objects: https://www.thingiverse.com/thing:5573
|
||||
* https://www.thingiverse.com/thing:1278865
|
||||
*/
|
||||
|
||||
//===========================================================================
|
||||
@@ -3026,6 +3030,14 @@
|
||||
//
|
||||
//#define REPRAP_DISCOUNT_SMART_CONTROLLER
|
||||
|
||||
//
|
||||
// GT2560 (YHCB2004) LCD Display
|
||||
//
|
||||
// Requires Testato, Koepel softwarewire library and
|
||||
// Andriy Golovnya's LiquidCrystal_AIP31068 library.
|
||||
//
|
||||
//#define YHCB2004
|
||||
|
||||
//
|
||||
// Original RADDS LCD Display+Encoder+SDCardReader
|
||||
// http://doku.radds.org/dokumentation/lcd-display/
|
||||
|
||||
@@ -566,7 +566,7 @@ ISR(SERIAL_REGNAME(USART, SERIAL_PORT, _UDRE_vect)) {
|
||||
MarlinSerial<MarlinSerialCfg<SERIAL_PORT>>::_tx_udr_empty_irq();
|
||||
}
|
||||
|
||||
// Because of the template definition above, it's required to instantiate the template to have all method generated
|
||||
// Because of the template definition above, it's required to instantiate the template to have all methods generated
|
||||
template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT> >;
|
||||
MSerialT customizedSerial1(MSerialT::HasEmergencyParser);
|
||||
|
||||
|
||||
@@ -102,11 +102,18 @@ uint16_t HAL_adc_get_result() {
|
||||
return HAL_adc_result;
|
||||
}
|
||||
|
||||
// Forward the default serial port
|
||||
DefaultSerial MSerial(false, Serial);
|
||||
|
||||
DefaultSerial1 MSerial1(false, Serial1);
|
||||
DefaultSerial2 MSerial2(false, Serial2);
|
||||
DefaultSerial3 MSerial3(false, Serial3);
|
||||
// Forward the default serial ports
|
||||
#if ANY_SERIAL_IS(0)
|
||||
DefaultSerial MSerial(false, Serial);
|
||||
#endif
|
||||
#if ANY_SERIAL_IS(1)
|
||||
DefaultSerial1 MSerial1(false, Serial1);
|
||||
#endif
|
||||
#if ANY_SERIAL_IS(2)
|
||||
DefaultSerial2 MSerial2(false, Serial2);
|
||||
#endif
|
||||
#if ANY_SERIAL_IS(3)
|
||||
DefaultSerial3 MSerial3(false, Serial3);
|
||||
#endif
|
||||
|
||||
#endif // ARDUINO_ARCH_SAM
|
||||
|
||||
@@ -37,12 +37,12 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "../../core/serial_hook.h"
|
||||
typedef ForwardSerial0Type< decltype(Serial) > DefaultSerial;
|
||||
extern DefaultSerial MSerial;
|
||||
|
||||
typedef ForwardSerial0Type< decltype(Serial) > DefaultSerial;
|
||||
typedef ForwardSerial0Type< decltype(Serial1) > DefaultSerial1;
|
||||
typedef ForwardSerial0Type< decltype(Serial2) > DefaultSerial2;
|
||||
typedef ForwardSerial0Type< decltype(Serial3) > DefaultSerial3;
|
||||
extern DefaultSerial MSerial;
|
||||
extern DefaultSerial1 MSerial1;
|
||||
extern DefaultSerial2 MSerial2;
|
||||
extern DefaultSerial3 MSerial3;
|
||||
|
||||
@@ -25,8 +25,21 @@
|
||||
#include <wiring_private.h>
|
||||
|
||||
#ifdef ADAFRUIT_GRAND_CENTRAL_M4
|
||||
DefaultSerial MSerial(false, Serial);
|
||||
DefaultSerial1 MSerial1(false, Serial1);
|
||||
#if ANY_SERIAL_IS(-1)
|
||||
DefaultSerial MSerial(false, Serial);
|
||||
#endif
|
||||
#if ANY_SERIAL_IS(0)
|
||||
DefaultSerial1 MSerial1(false, Serial1);
|
||||
#endif
|
||||
#if ANY_SERIAL_IS(1)
|
||||
DefaultSerial2 MSerial2(false, Serial2);
|
||||
#endif
|
||||
#if ANY_SERIAL_IS(2)
|
||||
DefaultSerial3 MSerial3(false, Serial3);
|
||||
#endif
|
||||
#if ANY_SERIAL_IS(3)
|
||||
DefaultSerial4 MSerial4(false, Serial4);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
|
||||
@@ -33,9 +33,15 @@
|
||||
|
||||
// Serial ports
|
||||
typedef ForwardSerial0Type< decltype(Serial) > DefaultSerial;
|
||||
extern DefaultSerial MSerial;
|
||||
typedef ForwardSerial0Type< decltype(Serial1) > DefaultSerial1;
|
||||
typedef ForwardSerial0Type< decltype(Serial2) > DefaultSerial2;
|
||||
typedef ForwardSerial0Type< decltype(Serial3) > DefaultSerial3;
|
||||
typedef ForwardSerial0Type< decltype(Serial4) > DefaultSerial4;
|
||||
extern DefaultSerial MSerial;
|
||||
extern DefaultSerial1 MSerial1;
|
||||
extern DefaultSerial2 MSerial2;
|
||||
extern DefaultSerial3 MSerial3;
|
||||
extern DefaultSerial4 MSerial4;
|
||||
|
||||
// MYSERIAL0 required before MarlinSerial includes!
|
||||
|
||||
|
||||
@@ -106,12 +106,14 @@
|
||||
}
|
||||
|
||||
#if ENABLED(MARLIN_DEV_MODE)
|
||||
void dump_delay_accuracy_check()
|
||||
{
|
||||
auto report_call_time = [](PGM_P const name, const uint32_t cycles, const uint32_t total, const bool do_flush=true) {
|
||||
void dump_delay_accuracy_check() {
|
||||
auto report_call_time = [](PGM_P const name, PGM_P const unit, const uint32_t cycles, const uint32_t total, const bool do_flush=true) {
|
||||
SERIAL_ECHOPGM("Calling ");
|
||||
serialprintPGM(name);
|
||||
SERIAL_ECHOLNPAIR(" for ", cycles, "cycles took: ", total, "cycles");
|
||||
SERIAL_ECHOLNPAIR(" for ", cycles);
|
||||
serialprintPGM(unit);
|
||||
SERIAL_ECHOLNPAIR(" took: ", total);
|
||||
serialprintPGM(unit);
|
||||
if (do_flush) SERIAL_FLUSH();
|
||||
};
|
||||
|
||||
@@ -123,41 +125,41 @@
|
||||
constexpr uint32_t testValues[] = { 1, 5, 10, 20, 50, 100, 150, 200, 350, 500, 750, 1000 };
|
||||
for (auto i : testValues) {
|
||||
s = micros(); DELAY_US(i); e = micros();
|
||||
report_call_time(PSTR("delay"), i, e - s);
|
||||
report_call_time(PSTR("delay"), PSTR("us"), i, e - s);
|
||||
}
|
||||
|
||||
if (HW_REG(_DWT_CTRL)) {
|
||||
for (auto i : testValues) {
|
||||
s = HW_REG(_DWT_CYCCNT); DELAY_CYCLES(i); e = HW_REG(_DWT_CYCCNT);
|
||||
report_call_time(PSTR("delay"), i, e - s);
|
||||
report_call_time(PSTR("runtime delay"), PSTR("cycles"), i, e - s);
|
||||
}
|
||||
|
||||
// Measure the delay to call a real function compared to a function pointer
|
||||
s = HW_REG(_DWT_CYCCNT); delay_dwt(1); e = HW_REG(_DWT_CYCCNT);
|
||||
report_call_time(PSTR("delay_dwt"), 1, e - s);
|
||||
report_call_time(PSTR("delay_dwt"), PSTR("cycles"), 1, e - s);
|
||||
|
||||
static PGMSTR(dcd, "DELAY_CYCLES directly ");
|
||||
|
||||
s = HW_REG(_DWT_CYCCNT); DELAY_CYCLES( 1); e = HW_REG(_DWT_CYCCNT);
|
||||
report_call_time(dcd, 1, e - s, false);
|
||||
report_call_time(dcd, PSTR("cycles"), 1, e - s, false);
|
||||
|
||||
s = HW_REG(_DWT_CYCCNT); DELAY_CYCLES( 5); e = HW_REG(_DWT_CYCCNT);
|
||||
report_call_time(dcd, 5, e - s, false);
|
||||
report_call_time(dcd, PSTR("cycles"), 5, e - s, false);
|
||||
|
||||
s = HW_REG(_DWT_CYCCNT); DELAY_CYCLES(10); e = HW_REG(_DWT_CYCCNT);
|
||||
report_call_time(dcd, 10, e - s, false);
|
||||
report_call_time(dcd, PSTR("cycles"), 10, e - s, false);
|
||||
|
||||
s = HW_REG(_DWT_CYCCNT); DELAY_CYCLES(20); e = HW_REG(_DWT_CYCCNT);
|
||||
report_call_time(dcd, 20, e - s, false);
|
||||
report_call_time(dcd, PSTR("cycles"), 20, e - s, false);
|
||||
|
||||
s = HW_REG(_DWT_CYCCNT); DELAY_CYCLES(50); e = HW_REG(_DWT_CYCCNT);
|
||||
report_call_time(dcd, 50, e - s, false);
|
||||
report_call_time(dcd, PSTR("cycles"), 50, e - s, false);
|
||||
|
||||
s = HW_REG(_DWT_CYCCNT); DELAY_CYCLES(100); e = HW_REG(_DWT_CYCCNT);
|
||||
report_call_time(dcd, 100, e - s, false);
|
||||
report_call_time(dcd, PSTR("cycles"), 100, e - s, false);
|
||||
|
||||
s = HW_REG(_DWT_CYCCNT); DELAY_CYCLES(200); e = HW_REG(_DWT_CYCCNT);
|
||||
report_call_time(dcd, 200, e - s, false);
|
||||
report_call_time(dcd, PSTR("cycles"), 200, e - s, false);
|
||||
}
|
||||
}
|
||||
#endif // MARLIN_DEV_MODE
|
||||
|
||||
@@ -327,7 +327,7 @@
|
||||
#define BOARD_LONGER3D_LK 4034 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
|
||||
#define BOARD_CCROBOT_MEEB_3DP 4035 // ccrobot-online.com MEEB_3DP (STM32F103RC)
|
||||
#define BOARD_CHITU3D_V5 4036 // Chitu3D TronXY X5SA V5 Board
|
||||
#define BOARD_CHITU3D_V6 4037 // Chitu3D TronXY X5SA V5 Board
|
||||
#define BOARD_CHITU3D_V6 4037 // Chitu3D TronXY X5SA V6 Board
|
||||
#define BOARD_CREALITY_V4 4038 // Creality v4.x (STM32F103RE)
|
||||
#define BOARD_CREALITY_V427 4039 // Creality v4.2.7 (STM32F103RE)
|
||||
#define BOARD_CREALITY_V4210 4040 // Creality v4.2.10 (STM32F103RE) as found in the CR-30
|
||||
|
||||
@@ -62,6 +62,7 @@ typedef int8_t serial_index_t;
|
||||
#define SERIAL_ALL 0x7F
|
||||
#if HAS_MULTI_SERIAL
|
||||
#define _PORT_REDIRECT(n,p) REMEMBER(n,multiSerial.portMask,p)
|
||||
#define _PORT_RESTORE(n,p) RESTORE(n)
|
||||
#define SERIAL_ASSERT(P) if(multiSerial.portMask!=(P)){ debugger(); }
|
||||
#ifdef SERIAL_CATCHALL
|
||||
typedef MultiSerial<decltype(MYSERIAL), decltype(SERIAL_CATCHALL), 0> SerialOutputT;
|
||||
@@ -72,6 +73,7 @@ typedef int8_t serial_index_t;
|
||||
#define SERIAL_IMPL multiSerial
|
||||
#else
|
||||
#define _PORT_REDIRECT(n,p) NOOP
|
||||
#define _PORT_RESTORE(n) NOOP
|
||||
#define SERIAL_ASSERT(P) NOOP
|
||||
#define SERIAL_IMPL MYSERIAL0
|
||||
#endif
|
||||
@@ -79,6 +81,7 @@ typedef int8_t serial_index_t;
|
||||
#define SERIAL_OUT(WHAT, V...) (void)SERIAL_IMPL.WHAT(V)
|
||||
|
||||
#define PORT_REDIRECT(p) _PORT_REDIRECT(1,p)
|
||||
#define PORT_RESTORE() _PORT_RESTORE(1)
|
||||
#define SERIAL_PORTMASK(P) _BV(P)
|
||||
|
||||
//
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#endif
|
||||
|
||||
// flushTX is not implemented in all HAL, so use SFINAE to call the method where it is.
|
||||
CALL_IF_EXISTS_IMPL(void, flushTX );
|
||||
CALL_IF_EXISTS_IMPL(void, flushTX);
|
||||
CALL_IF_EXISTS_IMPL(bool, connected, true);
|
||||
|
||||
// In order to catch usage errors in code, we make the base to encode number explicit
|
||||
@@ -42,14 +42,14 @@ enum class PrintBase {
|
||||
Bin = 2
|
||||
};
|
||||
|
||||
// A simple forward struct that prevent the compiler to select print(double, int) as a default overload for any type different than
|
||||
// A simple forward struct that prevent the compiler to select print(double, int) as a default overload for any type different than
|
||||
// double or float. For double or float, a conversion exists so the call will be transparent
|
||||
struct EnsureDouble {
|
||||
double a;
|
||||
FORCE_INLINE operator double() { return a; }
|
||||
// If the compiler breaks on ambiguity here, it's likely because you're calling print(X, base) with X not a double or a float, and a
|
||||
// base that's not one of PrintBase's value. This exact code is made to detect such error, you NEED to set a base explicitely like this:
|
||||
// SERIAL_PRINT(v, PrintBase::Hex)
|
||||
// SERIAL_PRINT(v, PrintBase::Hex)
|
||||
FORCE_INLINE EnsureDouble(double a) : a(a) {}
|
||||
FORCE_INLINE EnsureDouble(float a) : a(a) {}
|
||||
};
|
||||
@@ -147,13 +147,13 @@ struct SerialBase {
|
||||
else write('0');
|
||||
}
|
||||
void printNumber(signed long n, const uint8_t base) {
|
||||
if (base == 10 && n < 0) {
|
||||
if (base == 10 && n < 0) {
|
||||
n = -n; // This works because all platforms Marlin's builds on are using 2-complement encoding for negative number
|
||||
// On such CPU, changing the sign of a number is done by inverting the bits and adding one, so if n = 0x80000000 = -2147483648 then
|
||||
// -n = 0x7FFFFFFF + 1 => 0x80000000 = 2147483648 (if interpreted as unsigned) or -2147483648 if interpreted as signed.
|
||||
// On non 2-complement CPU, there would be no possible representation for 2147483648.
|
||||
write('-');
|
||||
}
|
||||
write('-');
|
||||
}
|
||||
printNumber((unsigned long)n , base);
|
||||
}
|
||||
|
||||
|
||||
@@ -287,9 +287,7 @@ void MMU2::mmu_loop() {
|
||||
else if (WITHIN(cmd, MMU_CMD_F0, MMU_CMD_F4)) {
|
||||
// filament type
|
||||
int filament = cmd - MMU_CMD_F0;
|
||||
DEBUG_ECHOPAIR("MMU <= F", filament, " ");
|
||||
DEBUG_ECHO_F(cmd_arg, DEC);
|
||||
DEBUG_EOL();
|
||||
DEBUG_ECHOLNPAIR("MMU <= F", filament, " ", cmd_arg);
|
||||
tx_printf_P(PSTR("F%d %d\n"), filament, cmd_arg);
|
||||
state = 3; // wait for response
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
};
|
||||
#endif
|
||||
|
||||
do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * home_dir(Y_AXIS), fr_mm_s);
|
||||
do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * Y_HOME_DIR, fr_mm_s);
|
||||
|
||||
endstops.validate_homing_move();
|
||||
|
||||
|
||||
@@ -53,14 +53,10 @@ void GcodeSuite::M118() {
|
||||
}
|
||||
|
||||
#if HAS_MULTI_SERIAL
|
||||
const int8_t old_serial = multiSerial.portMask;
|
||||
if (WITHIN(port, 0, NUM_SERIAL))
|
||||
multiSerial.portMask = port ? _BV(port - 1) : SERIAL_ALL;
|
||||
PORT_REDIRECT(WITHIN(port, 0, NUM_SERIAL) ? (port ? _BV(port - 1) : SERIAL_ALL) : multiSerial.portMask);
|
||||
#endif
|
||||
|
||||
if (hasE) SERIAL_ECHO_START();
|
||||
if (hasA) SERIAL_ECHOPGM("//");
|
||||
SERIAL_ECHOLN(p);
|
||||
|
||||
TERN_(HAS_MULTI_SERIAL, multiSerial.portMask = old_serial);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,10 @@
|
||||
|
||||
#define MINIPANEL
|
||||
|
||||
#elif ENABLED(YHCB2004)
|
||||
|
||||
#define IS_ULTIPANEL 1
|
||||
|
||||
#elif ENABLED(CARTESIO_UI)
|
||||
|
||||
#define DOGLCD
|
||||
@@ -818,22 +822,6 @@
|
||||
#define TOTAL_PROBING MULTIPLE_PROBING
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(PREHEAT_BEFORE_PROBING)
|
||||
#ifndef PROBING_NOZZLE_TEMP
|
||||
#define PROBING_NOZZLE_TEMP 0
|
||||
#endif
|
||||
#ifndef PROBING_BED_TEMP
|
||||
#define PROBING_BED_TEMP 0
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(PREHEAT_BEFORE_LEVELING)
|
||||
#ifndef LEVELING_NOZZLE_TEMP
|
||||
#define LEVELING_NOZZLE_TEMP 0
|
||||
#endif
|
||||
#ifndef LEVELING_BED_TEMP
|
||||
#define LEVELING_BED_TEMP 0
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
// Clear probe pin settings when no probe is selected
|
||||
#undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
|
||||
|
||||
@@ -2296,8 +2296,6 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#if 1 < 0 \
|
||||
+ ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
|
||||
+ ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
|
||||
+ ENABLED(ULTIPANEL) \
|
||||
+ ENABLED(ULTRA_LCD) \
|
||||
+ (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \
|
||||
+ (ENABLED(MINIPANEL) && NONE(MKS_MINI_12864, ENDER2_STOCKDISPLAY)) \
|
||||
+ (ENABLED(MKS_MINI_12864) && DISABLED(MKS_LCD12864)) \
|
||||
@@ -2346,6 +2344,9 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
+ ENABLED(U8GLIB_SH1106_EINSTART) \
|
||||
+ ENABLED(ULTI_CONTROLLER) \
|
||||
+ ENABLED(ULTIMAKERCONTROLLER) \
|
||||
+ ENABLED(ULTIPANEL) \
|
||||
+ ENABLED(ULTRA_LCD) \
|
||||
+ ENABLED(YHCB2004) \
|
||||
+ ENABLED(ZONESTAR_LCD)
|
||||
#error "Please select only one LCD controller option."
|
||||
#endif
|
||||
@@ -3239,6 +3240,12 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
#undef _PIN_CONFLICT
|
||||
#endif
|
||||
|
||||
#if ENABLED(COOLANT_MIST) && !PIN_EXISTS(COOLANT_MIST)
|
||||
#error "COOLANT_MIST requires COOLANT_MIST_PIN to be defined."
|
||||
#elif ENABLED(COOLANT_FLOOD) && !PIN_EXISTS(COOLANT_FLOOD)
|
||||
#error "COOLANT_FLOOD requires COOLANT_FLOOD_PIN to be defined."
|
||||
#endif
|
||||
|
||||
#if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
|
||||
#error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD."
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* version was tagged.
|
||||
*/
|
||||
#ifndef STRING_DISTRIBUTION_DATE
|
||||
#define STRING_DISTRIBUTION_DATE "2021-02-10"
|
||||
#define STRING_DISTRIBUTION_DATE "2021-02-19"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -93,6 +93,10 @@
|
||||
|
||||
LCD_CLASS lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
|
||||
|
||||
#elif ENABLED(YHCB2004)
|
||||
|
||||
LCD_CLASS lcd(YHCB2004_CLK, 20, 4, YHCB2004_MOSI, YHCB2004_MISO); // CLK, cols, rows, MOSI, MISO
|
||||
|
||||
#else
|
||||
|
||||
// Standard direct-connected LCD implementations
|
||||
|
||||
@@ -90,6 +90,11 @@
|
||||
#include <LiquidCrystal_I2C.h>
|
||||
#define LCD_CLASS LiquidCrystal_I2C
|
||||
|
||||
#elif ENABLED(YHCB2004)
|
||||
|
||||
#include <LiquidCrystal_AIP31068_SPI.h>
|
||||
#define LCD_CLASS LiquidCrystal_AIP31068_SPI
|
||||
|
||||
#else
|
||||
|
||||
// Standard directly connected LCD implementations
|
||||
|
||||
+70
-80
@@ -45,86 +45,6 @@
|
||||
#define ENCODER_PHASE_3 1
|
||||
#endif
|
||||
|
||||
#if EITHER(HAS_DIGITAL_BUTTONS, DWIN_CREALITY_LCD)
|
||||
|
||||
// Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes)
|
||||
#define BLEN_A 0
|
||||
#define BLEN_B 1
|
||||
|
||||
#define EN_A _BV(BLEN_A)
|
||||
#define EN_B _BV(BLEN_B)
|
||||
|
||||
#define _BUTTON_PRESSED(BN) !READ(BTN_##BN)
|
||||
|
||||
#if BUTTON_EXISTS(ENC) || HAS_TOUCH_BUTTONS
|
||||
#define BLEN_C 2
|
||||
#define EN_C _BV(BLEN_C)
|
||||
#endif
|
||||
|
||||
#if ENABLED(LCD_I2C_VIKI)
|
||||
|
||||
#include <LiquidTWI2.h>
|
||||
|
||||
#define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
|
||||
|
||||
// button and encoder bit positions within 'buttons'
|
||||
#define B_LE (BUTTON_LEFT << B_I2C_BTN_OFFSET) // The remaining normalized buttons are all read via I2C
|
||||
#define B_UP (BUTTON_UP << B_I2C_BTN_OFFSET)
|
||||
#define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET)
|
||||
#define B_DW (BUTTON_DOWN << B_I2C_BTN_OFFSET)
|
||||
#define B_RI (BUTTON_RIGHT << B_I2C_BTN_OFFSET)
|
||||
|
||||
#if BUTTON_EXISTS(ENC) // The pause/stop/restart button is connected to BTN_ENC when used
|
||||
#define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name
|
||||
#define BUTTON_CLICK() (buttons & (B_MI|B_RI|B_ST)) // Pause/stop also acts as click until a proper pause/stop is implemented.
|
||||
#else
|
||||
#define BUTTON_CLICK() (buttons & (B_MI|B_RI))
|
||||
#endif
|
||||
|
||||
// I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
|
||||
|
||||
#elif ENABLED(LCD_I2C_PANELOLU2)
|
||||
|
||||
#if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin
|
||||
|
||||
#define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
|
||||
|
||||
#define B_MI (PANELOLU2_ENCODER_C << B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later
|
||||
|
||||
#define BUTTON_CLICK() (buttons & B_MI)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#undef BUTTON_EXISTS
|
||||
#define BUTTON_EXISTS(...) false
|
||||
|
||||
// Dummy button, never pressed
|
||||
#define _BUTTON_PRESSED(BN) false
|
||||
|
||||
// Shift register bits correspond to buttons:
|
||||
#define BL_LE 7 // Left
|
||||
#define BL_UP 6 // Up
|
||||
#define BL_MI 5 // Middle
|
||||
#define BL_DW 4 // Down
|
||||
#define BL_RI 3 // Right
|
||||
#define BL_ST 2 // Red Button
|
||||
#define B_LE _BV(BL_LE)
|
||||
#define B_UP _BV(BL_UP)
|
||||
#define B_MI _BV(BL_MI)
|
||||
#define B_DW _BV(BL_DW)
|
||||
#define B_RI _BV(BL_RI)
|
||||
#define B_ST _BV(BL_ST)
|
||||
|
||||
#ifndef BUTTON_CLICK
|
||||
#define BUTTON_CLICK() (buttons & (B_MI|B_ST))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if IS_RRW_KEYPAD
|
||||
#define BTN_OFFSET 0 // Bit offset into buttons for shift register values
|
||||
|
||||
@@ -155,6 +75,76 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if EITHER(HAS_DIGITAL_BUTTONS, DWIN_CREALITY_LCD)
|
||||
// Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes)
|
||||
#define BLEN_A 0
|
||||
#define BLEN_B 1
|
||||
|
||||
#define EN_A _BV(BLEN_A)
|
||||
#define EN_B _BV(BLEN_B)
|
||||
|
||||
#define _BUTTON_PRESSED(BN) !READ(BTN_##BN)
|
||||
|
||||
#if BUTTON_EXISTS(ENC) || HAS_TOUCH_BUTTONS
|
||||
#define BLEN_C 2
|
||||
#define EN_C _BV(BLEN_C)
|
||||
#endif
|
||||
|
||||
#if ENABLED(LCD_I2C_VIKI)
|
||||
#include <LiquidTWI2.h>
|
||||
#define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
|
||||
|
||||
// button and encoder bit positions within 'buttons'
|
||||
#define B_LE (BUTTON_LEFT << B_I2C_BTN_OFFSET) // The remaining normalized buttons are all read via I2C
|
||||
#define B_UP (BUTTON_UP << B_I2C_BTN_OFFSET)
|
||||
#define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET)
|
||||
#define B_DW (BUTTON_DOWN << B_I2C_BTN_OFFSET)
|
||||
#define B_RI (BUTTON_RIGHT << B_I2C_BTN_OFFSET)
|
||||
|
||||
#if BUTTON_EXISTS(ENC) // The pause/stop/restart button is connected to BTN_ENC when used
|
||||
#define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name
|
||||
#define BUTTON_CLICK() (buttons & (B_MI|B_RI|B_ST)) // Pause/stop also acts as click until a proper pause/stop is implemented.
|
||||
#else
|
||||
#define BUTTON_CLICK() (buttons & (B_MI|B_RI))
|
||||
#endif
|
||||
|
||||
// I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
|
||||
|
||||
#elif ENABLED(LCD_I2C_PANELOLU2)
|
||||
#if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin
|
||||
#define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
|
||||
|
||||
#define B_MI (PANELOLU2_ENCODER_C << B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later
|
||||
|
||||
#define BUTTON_CLICK() (buttons & B_MI)
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#undef BUTTON_EXISTS
|
||||
#define BUTTON_EXISTS(...) false
|
||||
|
||||
// Dummy button, never pressed
|
||||
#define _BUTTON_PRESSED(BN) false
|
||||
|
||||
// Shift register bits correspond to buttons:
|
||||
#define BL_LE 7 // Left
|
||||
#define BL_UP 6 // Up
|
||||
#define BL_MI 5 // Middle
|
||||
#define BL_DW 4 // Down
|
||||
#define BL_RI 3 // Right
|
||||
#define BL_ST 2 // Red Button
|
||||
#define B_LE _BV(BL_LE)
|
||||
#define B_UP _BV(BL_UP)
|
||||
#define B_MI _BV(BL_MI)
|
||||
#define B_DW _BV(BL_DW)
|
||||
#define B_RI _BV(BL_RI)
|
||||
#define B_ST _BV(BL_ST)
|
||||
|
||||
#ifndef BUTTON_CLICK
|
||||
#define BUTTON_CLICK() (buttons & (B_MI|B_ST))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EN_A
|
||||
#define EN_A 0
|
||||
#endif
|
||||
|
||||
+479
-398
File diff suppressed because it is too large
Load Diff
@@ -236,7 +236,7 @@ extern millis_t dwin_heat_time;
|
||||
typedef struct {
|
||||
TERN_(HAS_HOTEND, int16_t E_Temp = 0);
|
||||
TERN_(HAS_HEATED_BED, int16_t Bed_Temp = 0);
|
||||
TERN_(HAS_PREHEAT, int16_t Fan_speed = 0);
|
||||
TERN_(HAS_FAN, int16_t Fan_speed = 0);
|
||||
int16_t print_speed = 100;
|
||||
float Max_Feedspeed = 0;
|
||||
float Max_Acceleration = 0;
|
||||
@@ -270,10 +270,7 @@ typedef struct {
|
||||
#if HAS_LEVELING
|
||||
bool leveling_offset_flag:1;
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
AxisEnum feedspeed_axis;
|
||||
#endif
|
||||
AxisEnum acc_axis, jerk_axis, step_axis;
|
||||
AxisEnum feedspeed_axis, acc_axis, jerk_axis, step_axis;
|
||||
} HMI_Flag_t;
|
||||
|
||||
extern HMI_value_t HMI_ValueStruct;
|
||||
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
static inline uint32_t _calculated_remaining_time() {
|
||||
const duration_t elapsed = print_job_timer.duration();
|
||||
const progress_t progress = _get_progress();
|
||||
return elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
|
||||
return progress ? elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress : 0;
|
||||
}
|
||||
#if ENABLED(USE_M73_REMAINING_TIME)
|
||||
static uint32_t remaining_time;
|
||||
|
||||
@@ -42,8 +42,9 @@ struct AutoReporter {
|
||||
const millis_t ms = millis();
|
||||
if (ELAPSED(ms, next_report_ms)) {
|
||||
next_report_ms = ms + SEC_TO_MS(report_interval);
|
||||
TERN_(HAS_MULTI_SERIAL, PORT_REDIRECT(report_port_mask));
|
||||
PORT_REDIRECT(report_port_mask);
|
||||
Helper::report();
|
||||
//PORT_RESTORE();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ enum EndstopEnum : char {
|
||||
Z4_MIN, Z4_MAX
|
||||
};
|
||||
|
||||
#define X_ENDSTOP (X_HOME_DIR < 0 ? X_MIN : X_MAX)
|
||||
#define X_ENDSTOP (x_home_dir(active_extruder) < 0 ? X_MIN : X_MAX)
|
||||
#define Y_ENDSTOP (Y_HOME_DIR < 0 ? Y_MIN : Y_MAX)
|
||||
#define Z_ENDSTOP (Z_HOME_DIR < 0 ? TERN(HOMING_Z_WITH_PROBE, Z_MIN, Z_MIN_PROBE) : Z_MAX)
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@ FORCE_INLINE void set_all_unhomed() { axis_homed = axis_tr
|
||||
FORCE_INLINE void set_duplication_enabled(const bool dupe) { extruder_duplication_enabled = dupe; }
|
||||
#endif
|
||||
|
||||
FORCE_INLINE int x_home_dir(const uint8_t) { return home_dir(X_AXIS); }
|
||||
FORCE_INLINE int x_home_dir(const uint8_t) { return X_HOME_DIR; }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1690,13 +1690,15 @@ bool Planner::_buffer_steps(const xyze_long_t &target
|
||||
, feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters
|
||||
) {
|
||||
|
||||
// If we are cleaning, do not accept queuing of movements
|
||||
if (cleaning_buffer_counter) return false;
|
||||
|
||||
// Wait for the next available block
|
||||
uint8_t next_buffer_head;
|
||||
block_t * const block = get_next_free_block(next_buffer_head);
|
||||
|
||||
// If we are cleaning, do not accept queuing of movements
|
||||
// This must be after get_next_free_block() because it calls idle()
|
||||
// where cleaning_buffer_counter can be changed
|
||||
if (cleaning_buffer_counter) return false;
|
||||
|
||||
// Fill the block with the specified movement
|
||||
if (!_populate_block(block, false, target
|
||||
#if HAS_POSITION_FLOAT
|
||||
|
||||
+45
-14
@@ -327,30 +327,61 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
|
||||
|
||||
#if EITHER(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
|
||||
|
||||
#if ENABLED(PREHEAT_BEFORE_PROBING)
|
||||
#ifndef PROBING_NOZZLE_TEMP
|
||||
#define PROBING_NOZZLE_TEMP 0
|
||||
#endif
|
||||
#ifndef PROBING_BED_TEMP
|
||||
#define PROBING_BED_TEMP 0
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(PREHEAT_BEFORE_LEVELING)
|
||||
#ifndef LEVELING_NOZZLE_TEMP
|
||||
#define LEVELING_NOZZLE_TEMP 0
|
||||
#endif
|
||||
#ifndef LEVELING_BED_TEMP
|
||||
#define LEVELING_BED_TEMP 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Do preheating as required before leveling or probing
|
||||
* Do preheating as required before leveling or probing.
|
||||
* - If a preheat input is higher than the current target, raise the target temperature.
|
||||
* - If a preheat input is higher than the current temperature, wait for stabilization.
|
||||
*/
|
||||
void Probe::preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp) {
|
||||
#if PROBING_NOZZLE_TEMP || LEVELING_NOZZLE_TEMP
|
||||
#if HAS_HOTEND && (PROBING_NOZZLE_TEMP || LEVELING_NOZZLE_TEMP)
|
||||
#define WAIT_FOR_NOZZLE_HEAT
|
||||
#endif
|
||||
#if PROBING_BED_TEMP || LEVELING_BED_TEMP
|
||||
#if HAS_HEATED_BED && (PROBING_BED_TEMP || LEVELING_BED_TEMP)
|
||||
#define WAIT_FOR_BED_HEAT
|
||||
#endif
|
||||
const uint16_t hotendPreheat = TERN0(WAIT_FOR_NOZZLE_HEAT, thermalManager.degHotend(0) < hotend_temp) ? hotend_temp : 0,
|
||||
bedPreheat = TERN0(WAIT_FOR_BED_HEAT, thermalManager.degBed() < bed_temp) ? bed_temp : 0;
|
||||
|
||||
DEBUG_ECHOPGM("Preheating ");
|
||||
if (hotendPreheat) {
|
||||
DEBUG_ECHOPAIR("hotend (", hotendPreheat, ") ");
|
||||
if (bedPreheat) DEBUG_ECHOPGM("and ");
|
||||
}
|
||||
if (bedPreheat) DEBUG_ECHOPAIR("bed (", bedPreheat, ") ");
|
||||
|
||||
#if ENABLED(WAIT_FOR_NOZZLE_HEAT)
|
||||
const uint16_t hotendPreheat = hotend_temp > thermalManager.degTargetHotend(0) ? hotend_temp : 0;
|
||||
if (hotendPreheat) {
|
||||
DEBUG_ECHOPAIR("hotend (", hotendPreheat, ")");
|
||||
thermalManager.setTargetHotend(hotendPreheat, 0);
|
||||
}
|
||||
#elif ENABLED(WAIT_FOR_BED_HEAT)
|
||||
constexpr uint16_t hotendPreheat = 0;
|
||||
#endif
|
||||
|
||||
#if ENABLED(WAIT_FOR_BED_HEAT)
|
||||
const uint16_t bedPreheat = bed_temp > thermalManager.degTargetBed() ? bed_temp : 0;
|
||||
if (bedPreheat) {
|
||||
if (hotendPreheat) DEBUG_ECHOPGM(" and ");
|
||||
DEBUG_ECHOPAIR("bed (", bedPreheat, ")");
|
||||
thermalManager.setTargetBed(bedPreheat);
|
||||
}
|
||||
#endif
|
||||
|
||||
DEBUG_EOL();
|
||||
|
||||
TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotendPreheat) thermalManager.setTargetHotend(hotendPreheat, 0));
|
||||
TERN_(WAIT_FOR_BED_HEAT, if (bedPreheat) thermalManager.setTargetBed(bedPreheat));
|
||||
TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotendPreheat) thermalManager.wait_for_hotend(0));
|
||||
TERN_(WAIT_FOR_BED_HEAT, if (bedPreheat) thermalManager.wait_for_bed_heating());
|
||||
TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotend_temp > thermalManager.degHotend(0) + (TEMP_WINDOW)) thermalManager.wait_for_hotend(0));
|
||||
TERN_(WAIT_FOR_BED_HEAT, if (bed_temp > thermalManager.degBed() + (TEMP_BED_WINDOW)) thermalManager.wait_for_bed_heating());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+50
-61
@@ -47,19 +47,22 @@ void scara_set_axis_is_at_home(const AxisEnum axis) {
|
||||
|
||||
#if ENABLED(MORGAN_SCARA)
|
||||
// MORGAN_SCARA uses arm angles for AB home position
|
||||
// SERIAL_ECHOLNPAIR("homeposition A:", homeposition.a, " B:", homeposition.b);
|
||||
//DEBUG_ECHOLNPAIR("homeposition A:", homeposition.a, " B:", homeposition.b);
|
||||
inverse_kinematics(homeposition);
|
||||
forward_kinematics_SCARA(delta.a, delta.b);
|
||||
current_position[axis] = cartes[axis];
|
||||
#else
|
||||
// MP_SCARA uses a Cartesian XY home position
|
||||
// SERIAL_ECHOPGM("homeposition");
|
||||
// SERIAL_ECHOLNPAIR_P(SP_X_LBL, homeposition.x, SP_Y_LBL, homeposition.y);
|
||||
current_position[axis] = homeposition[axis];
|
||||
//DEBUG_ECHOPGM("homeposition");
|
||||
//DEBUG_ECHOLNPAIR_P(SP_X_LBL, homeposition.x, SP_Y_LBL, homeposition.y);
|
||||
delta.a = SCARA_OFFSET_THETA1;
|
||||
delta.b = SCARA_OFFSET_THETA2;
|
||||
forward_kinematics_SCARA(delta.a, delta.b);
|
||||
current_position[axis] = cartes[axis];
|
||||
#endif
|
||||
|
||||
// SERIAL_ECHOPGM("Cartesian");
|
||||
// SERIAL_ECHOLNPAIR_P(SP_X_LBL, current_position.x, SP_Y_LBL, current_position.y);
|
||||
//DEBUG_ECHOPGM("Cartesian");
|
||||
//DEBUG_ECHOLNPAIR_P(SP_X_LBL, current_position.x, SP_Y_LBL, current_position.y);
|
||||
update_software_endstops(axis);
|
||||
}
|
||||
}
|
||||
@@ -75,14 +78,14 @@ void forward_kinematics_SCARA(const float &a, const float &b) {
|
||||
|
||||
const float a_sin = sin(RADIANS(a)) * L1,
|
||||
a_cos = cos(RADIANS(a)) * L1,
|
||||
b_sin = sin(RADIANS(b)) * L2,
|
||||
b_cos = cos(RADIANS(b)) * L2;
|
||||
b_sin = sin(RADIANS(b + TERN0(MP_SCARA, a))) * L2,
|
||||
b_cos = cos(RADIANS(b + TERN0(MP_SCARA, a))) * L2;
|
||||
|
||||
cartes.set(a_cos + b_cos + scara_offset.x, // theta
|
||||
a_sin + b_sin + scara_offset.y); // theta+phi
|
||||
a_sin + b_sin + scara_offset.y); // phi
|
||||
|
||||
/*
|
||||
SERIAL_ECHOLNPAIR(
|
||||
DEBUG_ECHOLNPAIR(
|
||||
"SCARA FK Angle a=", a,
|
||||
" b=", b,
|
||||
" a_sin=", a_sin,
|
||||
@@ -90,74 +93,60 @@ void forward_kinematics_SCARA(const float &a, const float &b) {
|
||||
" b_sin=", b_sin,
|
||||
" b_cos=", b_cos
|
||||
);
|
||||
SERIAL_ECHOLNPAIR(" cartes (X,Y) = "(cartes.x, ", ", cartes.y, ")");
|
||||
DEBUG_ECHOLNPAIR(" cartes (X,Y) = "(cartes.x, ", ", cartes.y, ")");
|
||||
//*/
|
||||
}
|
||||
|
||||
/**
|
||||
* SCARA Inverse Kinematics. Results in 'delta'.
|
||||
*
|
||||
* See https://reprap.org/forum/read.php?185,283327
|
||||
*
|
||||
* Maths and first version by QHARLEY.
|
||||
* Integrated into Marlin and slightly restructured by Joachim Cerny.
|
||||
*/
|
||||
void inverse_kinematics(const xyz_pos_t &raw) {
|
||||
float C2, S2, SK1, SK2, THETA, PSI;
|
||||
|
||||
#if ENABLED(MORGAN_SCARA)
|
||||
/**
|
||||
* Morgan SCARA Inverse Kinematics. Results in 'delta'.
|
||||
*
|
||||
* See https://reprap.org/forum/read.php?185,283327
|
||||
*
|
||||
* Maths and first version by QHARLEY.
|
||||
* Integrated into Marlin and slightly restructured by Joachim Cerny.
|
||||
*/
|
||||
float C2, S2, SK1, SK2, THETA, PSI;
|
||||
// Translate SCARA to standard XY with scaling factor
|
||||
const xy_pos_t spos = raw - scara_offset;
|
||||
|
||||
// Translate SCARA to standard XY with scaling factor
|
||||
const xy_pos_t spos = raw - scara_offset;
|
||||
const float H2 = HYPOT2(spos.x, spos.y);
|
||||
if (L1 == L2)
|
||||
C2 = H2 / L1_2_2 - 1;
|
||||
else
|
||||
C2 = (H2 - (L1_2 + L2_2)) / (2.0f * L1 * L2);
|
||||
|
||||
const float H2 = HYPOT2(spos.x, spos.y);
|
||||
if (L1 == L2)
|
||||
C2 = H2 / L1_2_2 - 1;
|
||||
else
|
||||
C2 = (H2 - (L1_2 + L2_2)) / (2.0f * L1 * L2);
|
||||
LIMIT(C2, -1, 1);
|
||||
|
||||
S2 = SQRT(1.0f - sq(C2));
|
||||
S2 = SQRT(1.0f - sq(C2));
|
||||
|
||||
// Unrotated Arm1 plus rotated Arm2 gives the distance from Center to End
|
||||
SK1 = L1 + L2 * C2;
|
||||
// Unrotated Arm1 plus rotated Arm2 gives the distance from Center to End
|
||||
SK1 = L1 + L2 * C2;
|
||||
|
||||
// Rotated Arm2 gives the distance from Arm1 to Arm2
|
||||
SK2 = L2 * S2;
|
||||
// Rotated Arm2 gives the distance from Arm1 to Arm2
|
||||
SK2 = L2 * S2;
|
||||
|
||||
// Angle of Arm1 is the difference between Center-to-End angle and the Center-to-Elbow
|
||||
THETA = ATAN2(SK1, SK2) - ATAN2(spos.x, spos.y);
|
||||
// Angle of Arm1 is the difference between Center-to-End angle and the Center-to-Elbow
|
||||
THETA = ATAN2(SK1, SK2) - ATAN2(spos.x, spos.y);
|
||||
|
||||
// Angle of Arm2
|
||||
PSI = ATAN2(S2, C2);
|
||||
// Angle of Arm2
|
||||
PSI = ATAN2(S2, C2);
|
||||
|
||||
delta.set(DEGREES(THETA), DEGREES(THETA + PSI), raw.z);
|
||||
delta.set(DEGREES(THETA), DEGREES(PSI + TERN0(MORGAN_SCARA, THETA)), raw.z);
|
||||
|
||||
/*
|
||||
DEBUG_POS("SCARA IK", raw);
|
||||
DEBUG_POS("SCARA IK", delta);
|
||||
SERIAL_ECHOLNPAIR(" SCARA (x,y) ", sx, ",", sy, " C2=", C2, " S2=", S2, " Theta=", THETA, " Phi=", PHI);
|
||||
//*/
|
||||
|
||||
#else // MP_SCARA
|
||||
|
||||
const float x = raw.x, y = raw.y, c = HYPOT(x, y),
|
||||
THETA3 = ATAN2(y, x),
|
||||
THETA1 = THETA3 + ACOS((sq(c) + sq(L1) - sq(L2)) / (2.0f * c * L1)),
|
||||
THETA2 = THETA3 - ACOS((sq(c) + sq(L2) - sq(L1)) / (2.0f * c * L2));
|
||||
|
||||
delta.set(DEGREES(THETA1), DEGREES(THETA2), raw.z);
|
||||
|
||||
/*
|
||||
DEBUG_POS("SCARA IK", raw);
|
||||
DEBUG_POS("SCARA IK", delta);
|
||||
SERIAL_ECHOLNPAIR(" SCARA (x,y) ", x, ",", y," Theta1=", THETA1, " Theta2=", THETA2);
|
||||
//*/
|
||||
|
||||
#endif // MP_SCARA
|
||||
/*
|
||||
DEBUG_POS("SCARA IK", raw);
|
||||
DEBUG_POS("SCARA IK", delta);
|
||||
DEBUG_ECHOLNPAIR(" SCARA (x,y) ", sx, ",", sy, " C2=", C2, " S2=", S2, " Theta=", THETA, " Psi=", PSI);
|
||||
//*/
|
||||
}
|
||||
|
||||
void scara_report_positions() {
|
||||
SERIAL_ECHOLNPAIR("SCARA Theta:", planner.get_axis_position_degrees(A_AXIS), " Psi+Theta:", planner.get_axis_position_degrees(B_AXIS));
|
||||
SERIAL_ECHOLNPAIR(
|
||||
"SCARA Theta:", planner.get_axis_position_degrees(A_AXIS),
|
||||
" Psi" TERN_(MORGAN_SCARA, "+Theta") ":", planner.get_axis_position_degrees(B_AXIS)
|
||||
);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
|
||||
@@ -197,23 +197,23 @@
|
||||
* EXP2 EXP1
|
||||
*/
|
||||
|
||||
#define EXPA1_03_PIN P1_23
|
||||
#define EXPA1_04_PIN P1_22
|
||||
#define EXPA1_05_PIN P1_21
|
||||
#define EXPA1_06_PIN P1_20
|
||||
#define EXPA1_07_PIN P1_19
|
||||
#define EXPA1_08_PIN P1_18
|
||||
#define EXPA1_09_PIN P0_28
|
||||
#define EXPA1_10_PIN P1_30
|
||||
#define EXP1_03_PIN P1_23
|
||||
#define EXP1_04_PIN P1_22
|
||||
#define EXP1_05_PIN P1_21
|
||||
#define EXP1_06_PIN P1_20
|
||||
#define EXP1_07_PIN P1_19
|
||||
#define EXP1_08_PIN P1_18
|
||||
#define EXP1_09_PIN P0_28
|
||||
#define EXP1_10_PIN P1_30
|
||||
|
||||
#define EXPA2_03_PIN -1
|
||||
#define EXPA2_04_PIN P1_31
|
||||
#define EXPA2_05_PIN P0_18
|
||||
#define EXPA2_06_PIN P3_25
|
||||
#define EXPA2_07_PIN P0_16
|
||||
#define EXPA2_08_PIN P3_26
|
||||
#define EXPA2_09_PIN P0_15
|
||||
#define EXPA2_10_PIN P0_17
|
||||
#define EXP2_03_PIN -1
|
||||
#define EXP2_04_PIN P1_31
|
||||
#define EXP2_05_PIN P0_18
|
||||
#define EXP2_06_PIN P3_25
|
||||
#define EXP2_07_PIN P0_16
|
||||
#define EXP2_08_PIN P3_26
|
||||
#define EXP2_09_PIN P0_15
|
||||
#define EXP2_10_PIN P0_17
|
||||
|
||||
#if HAS_WIRED_LCD
|
||||
#if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING)
|
||||
@@ -243,25 +243,25 @@
|
||||
* LCD LCD
|
||||
*/
|
||||
|
||||
#define LCD_PINS_RS EXPA1_03_PIN
|
||||
#define LCD_PINS_RS EXP1_03_PIN
|
||||
|
||||
#define BTN_EN1 EXPA1_06_PIN
|
||||
#define BTN_EN2 EXPA1_04_PIN
|
||||
#define BTN_ENC EXPA1_08_PIN
|
||||
#define BTN_EN1 EXP1_06_PIN
|
||||
#define BTN_EN2 EXP1_04_PIN
|
||||
#define BTN_ENC EXP1_08_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_05_PIN
|
||||
#define LCD_PINS_D4 EXPA1_07_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_05_PIN
|
||||
#define LCD_PINS_D4 EXP1_07_PIN
|
||||
|
||||
#elif ENABLED(CR10_STOCKDISPLAY)
|
||||
|
||||
#define LCD_PINS_RS EXPA1_04_PIN
|
||||
#define LCD_PINS_RS EXP1_04_PIN
|
||||
|
||||
#define BTN_EN1 EXPA1_08_PIN
|
||||
#define BTN_EN2 EXPA1_06_PIN
|
||||
#define BTN_ENC EXPA1_09_PIN // (58) open-drain
|
||||
#define BTN_EN1 EXP1_08_PIN
|
||||
#define BTN_EN2 EXP1_06_PIN
|
||||
#define BTN_ENC EXP1_09_PIN // (58) open-drain
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_03_PIN
|
||||
#define LCD_PINS_D4 EXPA1_05_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_03_PIN
|
||||
#define LCD_PINS_D4 EXP1_05_PIN
|
||||
|
||||
#elif HAS_ADC_BUTTONS
|
||||
|
||||
@@ -270,60 +270,60 @@
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS EXPA2_08_PIN
|
||||
#define TFTGLCD_CS EXP2_08_PIN
|
||||
#endif
|
||||
|
||||
#define SD_DETECT_PIN EXPA2_04_PIN
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
|
||||
#else // !CR10_STOCKDISPLAY
|
||||
|
||||
#define LCD_PINS_RS EXPA1_07_PIN
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
|
||||
#define BTN_EN1 EXPA2_08_PIN // (31) J3-2 & AUX-4
|
||||
#define BTN_EN2 EXPA2_06_PIN // (33) J3-4 & AUX-4
|
||||
#define BTN_ENC EXPA1_09_PIN // (58) open-drain
|
||||
#define BTN_EN1 EXP2_08_PIN // (31) J3-2 & AUX-4
|
||||
#define BTN_EN2 EXP2_06_PIN // (33) J3-4 & AUX-4
|
||||
#define BTN_ENC EXP1_09_PIN // (58) open-drain
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_08_PIN
|
||||
#define LCD_PINS_D4 EXPA1_06_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
|
||||
#define LCD_SDSS EXPA2_07_PIN // (16) J3-7 & AUX-4
|
||||
#define SD_DETECT_PIN EXPA2_04_PIN // (49) (NOT 5V tolerant)
|
||||
#define LCD_SDSS EXP2_07_PIN // (16) J3-7 & AUX-4
|
||||
#define SD_DETECT_PIN EXP2_04_PIN // (49) (NOT 5V tolerant)
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#define DOGLCD_CS EXPA1_08_PIN
|
||||
#define DOGLCD_A0 EXPA1_07_PIN
|
||||
#define DOGLCD_SCK EXPA2_09_PIN
|
||||
#define DOGLCD_MOSI EXPA2_05_PIN
|
||||
#define DOGLCD_CS EXP1_08_PIN
|
||||
#define DOGLCD_A0 EXP1_07_PIN
|
||||
#define DOGLCD_SCK EXP2_09_PIN
|
||||
#define DOGLCD_MOSI EXP2_05_PIN
|
||||
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
|
||||
#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
|
||||
// results in LCD soft SPI mode 3, SD soft SPI mode 0
|
||||
|
||||
#define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
#define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
|
||||
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
||||
#ifndef RGB_LED_R_PIN
|
||||
#define RGB_LED_R_PIN EXPA1_05_PIN
|
||||
#define RGB_LED_R_PIN EXP1_05_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_G_PIN
|
||||
#define RGB_LED_G_PIN EXPA1_04_PIN
|
||||
#define RGB_LED_G_PIN EXP1_04_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_B_PIN
|
||||
#define RGB_LED_B_PIN EXPA1_03_PIN
|
||||
#define RGB_LED_B_PIN EXP1_03_PIN
|
||||
#endif
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
#define NEOPIXEL_PIN EXPA1_05_PIN
|
||||
#define NEOPIXEL_PIN EXP1_05_PIN
|
||||
#endif
|
||||
|
||||
#else // !FYSETC_MINI_12864
|
||||
|
||||
#if ENABLED(MKS_MINI_12864)
|
||||
|
||||
#define DOGLCD_CS EXPA1_05_PIN
|
||||
#define DOGLCD_A0 EXPA1_04_PIN
|
||||
#define DOGLCD_SCK EXPA2_09_PIN
|
||||
#define DOGLCD_MOSI EXPA2_05_PIN
|
||||
#define DOGLCD_CS EXP1_05_PIN
|
||||
#define DOGLCD_A0 EXP1_04_PIN
|
||||
#define DOGLCD_SCK EXP2_09_PIN
|
||||
#define DOGLCD_MOSI EXP2_05_PIN
|
||||
|
||||
#elif ENABLED(ENDER2_STOCKDISPLAY)
|
||||
|
||||
@@ -339,21 +339,21 @@
|
||||
* EXP1
|
||||
*/
|
||||
|
||||
#define BTN_EN1 EXPA1_08_PIN
|
||||
#define BTN_EN2 EXPA1_06_PIN
|
||||
#define BTN_ENC EXPA1_09_PIN
|
||||
#define DOGLCD_CS EXPA1_04_PIN
|
||||
#define DOGLCD_A0 EXPA1_05_PIN
|
||||
#define DOGLCD_SCK EXPA1_10_PIN
|
||||
#define DOGLCD_MOSI EXPA1_03_PIN
|
||||
#define BTN_EN1 EXP1_08_PIN
|
||||
#define BTN_EN2 EXP1_06_PIN
|
||||
#define BTN_ENC EXP1_09_PIN
|
||||
#define DOGLCD_CS EXP1_04_PIN
|
||||
#define DOGLCD_A0 EXP1_05_PIN
|
||||
#define DOGLCD_SCK EXP1_10_PIN
|
||||
#define DOGLCD_MOSI EXP1_03_PIN
|
||||
#define FORCE_SOFT_SPI
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
#endif
|
||||
|
||||
#if IS_ULTIPANEL
|
||||
#define LCD_PINS_D5 EXPA1_05_PIN
|
||||
#define LCD_PINS_D6 EXPA1_04_PIN
|
||||
#define LCD_PINS_D7 EXPA1_03_PIN
|
||||
#define LCD_PINS_D5 EXP1_05_PIN
|
||||
#define LCD_PINS_D6 EXP1_04_PIN
|
||||
#define LCD_PINS_D7 EXP1_03_PIN
|
||||
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
|
||||
@@ -376,7 +376,7 @@
|
||||
#endif
|
||||
|
||||
#if SD_CONNECTION_IS(LCD)
|
||||
#define SD_SS_PIN EXPA2_07_PIN
|
||||
#define SD_SS_PIN EXP2_07_PIN
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -243,29 +243,29 @@
|
||||
* EXP2 EXP1
|
||||
*/
|
||||
|
||||
#define EXPA1_03_PIN P1_23
|
||||
#define EXPA1_04_PIN P1_22
|
||||
#define EXPA1_05_PIN P1_21
|
||||
#define EXPA1_06_PIN P1_20
|
||||
#define EXPA1_07_PIN P1_19
|
||||
#define EXPA1_08_PIN P1_18
|
||||
#define EXPA1_09_PIN P0_28
|
||||
#define EXPA1_10_PIN P1_30
|
||||
#define EXP1_03_PIN P1_23
|
||||
#define EXP1_04_PIN P1_22
|
||||
#define EXP1_05_PIN P1_21
|
||||
#define EXP1_06_PIN P1_20
|
||||
#define EXP1_07_PIN P1_19
|
||||
#define EXP1_08_PIN P1_18
|
||||
#define EXP1_09_PIN P0_28
|
||||
#define EXP1_10_PIN P1_30
|
||||
|
||||
#define EXPA2_03_PIN -1
|
||||
#define EXPA2_04_PIN P1_31
|
||||
#define EXPA2_05_PIN P0_18
|
||||
#define EXPA2_06_PIN P3_25
|
||||
#define EXPA2_07_PIN P0_16
|
||||
#define EXPA2_08_PIN P3_26
|
||||
#define EXPA2_09_PIN P0_15
|
||||
#define EXPA2_10_PIN P0_17
|
||||
#define EXP2_03_PIN -1
|
||||
#define EXP2_04_PIN P1_31
|
||||
#define EXP2_05_PIN P0_18
|
||||
#define EXP2_06_PIN P3_25
|
||||
#define EXP2_07_PIN P0_16
|
||||
#define EXP2_08_PIN P3_26
|
||||
#define EXP2_09_PIN P0_15
|
||||
#define EXP2_10_PIN P0_17
|
||||
|
||||
//
|
||||
// SD Connection
|
||||
//
|
||||
#if SD_CONNECTION_IS(LCD)
|
||||
#define SD_SS_PIN EXPA2_07_PIN
|
||||
#define SD_SS_PIN EXP2_07_PIN
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -282,12 +282,12 @@
|
||||
#if ENABLED(DWIN_CREALITY_LCD)
|
||||
|
||||
// RET6 DWIN ENCODER LCD
|
||||
#define BTN_ENC P1_20
|
||||
#define BTN_EN1 P1_23
|
||||
#define BTN_EN2 P1_22
|
||||
#define BTN_ENC P1_20
|
||||
#define BTN_EN1 P1_23
|
||||
#define BTN_EN2 P1_22
|
||||
|
||||
#ifndef BEEPER_PIN
|
||||
#define BEEPER_PIN P1_21
|
||||
#define BEEPER_PIN P1_21
|
||||
#undef SPEAKER
|
||||
#endif
|
||||
|
||||
@@ -315,15 +315,15 @@
|
||||
* LCD LCD
|
||||
*/
|
||||
|
||||
#define LCD_PINS_RS EXPA1_07_PIN
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
|
||||
#define BTN_EN1 EXPA1_05_PIN
|
||||
#define BTN_EN2 EXPA1_04_PIN
|
||||
#define BTN_ENC EXPA1_10_PIN
|
||||
#define BTN_EN1 EXP1_05_PIN
|
||||
#define BTN_EN2 EXP1_04_PIN
|
||||
#define BTN_ENC EXP1_10_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_08_PIN
|
||||
#define LCD_PINS_D4 EXPA1_06_PIN
|
||||
#define BEEPER_PIN EXPA1_03_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
#define BEEPER_PIN EXP1_03_PIN
|
||||
|
||||
#elif ENABLED(ANET_FULL_GRAPHICS_LCD)
|
||||
#error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. Comment out this line to continue."
|
||||
@@ -349,26 +349,26 @@
|
||||
* LCD LCD
|
||||
*/
|
||||
|
||||
#define LCD_PINS_RS EXPA1_03_PIN
|
||||
#define LCD_PINS_RS EXP1_03_PIN
|
||||
|
||||
#define BTN_EN1 EXPA1_06_PIN
|
||||
#define BTN_EN2 EXPA1_04_PIN
|
||||
#define BTN_ENC EXPA1_08_PIN
|
||||
#define BTN_EN1 EXP1_06_PIN
|
||||
#define BTN_EN2 EXP1_04_PIN
|
||||
#define BTN_ENC EXP1_08_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_05_PIN
|
||||
#define LCD_PINS_D4 EXPA1_07_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_05_PIN
|
||||
#define LCD_PINS_D4 EXP1_07_PIN
|
||||
|
||||
#define BEEPER_PIN EXPA1_10_PIN
|
||||
#define BEEPER_PIN EXP1_10_PIN
|
||||
|
||||
#elif ENABLED(CR10_STOCKDISPLAY)
|
||||
#define BTN_ENC EXPA1_09_PIN // (58) open-drain
|
||||
#define LCD_PINS_RS EXPA1_04_PIN
|
||||
#define BTN_ENC EXP1_09_PIN // (58) open-drain
|
||||
#define LCD_PINS_RS EXP1_04_PIN
|
||||
|
||||
#define BTN_EN1 EXPA1_08_PIN
|
||||
#define BTN_EN2 EXPA1_06_PIN
|
||||
#define BTN_EN1 EXP1_08_PIN
|
||||
#define BTN_EN2 EXP1_06_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_03_PIN
|
||||
#define LCD_PINS_D4 EXPA1_05_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_03_PIN
|
||||
#define LCD_PINS_D4 EXP1_05_PIN
|
||||
|
||||
#elif ENABLED(ENDER2_STOCKDISPLAY)
|
||||
|
||||
@@ -383,36 +383,36 @@
|
||||
* EXP1
|
||||
*/
|
||||
|
||||
#define BTN_EN1 EXPA1_08_PIN
|
||||
#define BTN_EN2 EXPA1_06_PIN
|
||||
#define BTN_ENC EXPA1_09_PIN
|
||||
#define BTN_EN1 EXP1_08_PIN
|
||||
#define BTN_EN2 EXP1_06_PIN
|
||||
#define BTN_ENC EXP1_09_PIN
|
||||
|
||||
#define DOGLCD_CS EXPA1_04_PIN
|
||||
#define DOGLCD_A0 EXPA1_05_PIN
|
||||
#define DOGLCD_SCK EXPA1_10_PIN
|
||||
#define DOGLCD_MOSI EXPA1_03_PIN
|
||||
#define DOGLCD_CS EXP1_04_PIN
|
||||
#define DOGLCD_A0 EXP1_05_PIN
|
||||
#define DOGLCD_SCK EXP1_10_PIN
|
||||
#define DOGLCD_MOSI EXP1_03_PIN
|
||||
#define FORCE_SOFT_SPI
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
|
||||
#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
|
||||
#define TFT_CS_PIN EXPA1_04_PIN
|
||||
#define TFT_A0_PIN EXPA1_03_PIN
|
||||
#define TFT_DC_PIN EXPA1_03_PIN
|
||||
#define TFT_MISO_PIN EXPA2_10_PIN
|
||||
#define TFT_BACKLIGHT_PIN EXPA1_08_PIN
|
||||
#define TFT_RESET_PIN EXPA1_07_PIN
|
||||
#define TFT_CS_PIN EXP1_04_PIN
|
||||
#define TFT_A0_PIN EXP1_03_PIN
|
||||
#define TFT_DC_PIN EXP1_03_PIN
|
||||
#define TFT_MISO_PIN EXP2_10_PIN
|
||||
#define TFT_BACKLIGHT_PIN EXP1_08_PIN
|
||||
#define TFT_RESET_PIN EXP1_07_PIN
|
||||
|
||||
#define LCD_USE_DMA_SPI
|
||||
|
||||
#define TOUCH_INT_PIN EXPA1_05_PIN
|
||||
#define TOUCH_CS_PIN EXPA1_06_PIN
|
||||
#define TOUCH_INT_PIN EXP1_05_PIN
|
||||
#define TOUCH_CS_PIN EXP1_06_PIN
|
||||
#define TOUCH_BUTTONS_HW_SPI
|
||||
#define TOUCH_BUTTONS_HW_SPI_DEVICE 1
|
||||
|
||||
// SPI 1
|
||||
#define SD_SCK_PIN EXPA2_09_PIN
|
||||
#define SD_MISO_PIN EXPA2_10_PIN
|
||||
#define SD_MOSI_PIN EXPA2_05_PIN
|
||||
#define SD_SCK_PIN EXP2_09_PIN
|
||||
#define SD_MISO_PIN EXP2_10_PIN
|
||||
#define SD_MOSI_PIN EXP2_05_PIN
|
||||
|
||||
// Disable any LCD related PINs config
|
||||
#define LCD_PINS_ENABLE -1
|
||||
@@ -423,72 +423,72 @@
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS EXPA2_08_PIN
|
||||
#define TFTGLCD_CS EXP2_08_PIN
|
||||
#endif
|
||||
|
||||
#define SD_DETECT_PIN EXPA2_04_PIN
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
|
||||
#else
|
||||
|
||||
#define BTN_ENC EXPA1_09_PIN // (58) open-drain
|
||||
#define LCD_PINS_RS EXPA1_07_PIN
|
||||
#define BTN_ENC EXP1_09_PIN // (58) open-drain
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
|
||||
#define BTN_EN1 EXPA2_08_PIN // (31) J3-2 & AUX-4
|
||||
#define BTN_EN2 EXPA2_06_PIN // (33) J3-4 & AUX-4
|
||||
#define BTN_EN1 EXP2_08_PIN // (31) J3-2 & AUX-4
|
||||
#define BTN_EN2 EXP2_06_PIN // (33) J3-4 & AUX-4
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_08_PIN
|
||||
#define LCD_PINS_D4 EXPA1_06_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
|
||||
#define LCD_SDSS EXPA2_07_PIN // (16) J3-7 & AUX-4
|
||||
#define LCD_SDSS EXP2_07_PIN // (16) J3-7 & AUX-4
|
||||
|
||||
#if SD_CONNECTION_IS(LCD)
|
||||
#define SD_DETECT_PIN EXPA2_04_PIN // (49) (NOT 5V tolerant)
|
||||
#define SD_DETECT_PIN EXP2_04_PIN // (49) (NOT 5V tolerant)
|
||||
#endif
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#define DOGLCD_CS EXPA1_08_PIN
|
||||
#define DOGLCD_A0 EXPA1_07_PIN
|
||||
#define DOGLCD_SCK EXPA2_09_PIN
|
||||
#define DOGLCD_MOSI EXPA2_05_PIN
|
||||
#define DOGLCD_CS EXP1_08_PIN
|
||||
#define DOGLCD_A0 EXP1_07_PIN
|
||||
#define DOGLCD_SCK EXP2_09_PIN
|
||||
#define DOGLCD_MOSI EXP2_05_PIN
|
||||
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
|
||||
#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
|
||||
// results in LCD soft SPI mode 3, SD soft SPI mode 0
|
||||
|
||||
#define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
#define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
|
||||
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
||||
#ifndef RGB_LED_R_PIN
|
||||
#define RGB_LED_R_PIN EXPA1_05_PIN
|
||||
#define RGB_LED_R_PIN EXP1_05_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_G_PIN
|
||||
#define RGB_LED_G_PIN EXPA1_04_PIN
|
||||
#define RGB_LED_G_PIN EXP1_04_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_B_PIN
|
||||
#define RGB_LED_B_PIN EXPA1_03_PIN
|
||||
#define RGB_LED_B_PIN EXP1_03_PIN
|
||||
#endif
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
#define NEOPIXEL_PIN EXPA1_05_PIN
|
||||
#define NEOPIXEL_PIN EXP1_05_PIN
|
||||
#endif
|
||||
|
||||
#else // !FYSETC_MINI_12864
|
||||
|
||||
#if ENABLED(MKS_MINI_12864)
|
||||
#define DOGLCD_CS EXPA1_05_PIN
|
||||
#define DOGLCD_A0 EXPA1_04_PIN
|
||||
#define DOGLCD_SCK EXPA2_09_PIN
|
||||
#define DOGLCD_MOSI EXPA2_05_PIN
|
||||
#define DOGLCD_CS EXP1_05_PIN
|
||||
#define DOGLCD_A0 EXP1_04_PIN
|
||||
#define DOGLCD_SCK EXP2_09_PIN
|
||||
#define DOGLCD_MOSI EXP2_05_PIN
|
||||
#define FORCE_SOFT_SPI
|
||||
#endif
|
||||
|
||||
#if IS_ULTIPANEL
|
||||
#define LCD_PINS_D5 EXPA1_05_PIN
|
||||
#define LCD_PINS_D6 EXPA1_04_PIN
|
||||
#define LCD_PINS_D7 EXPA1_03_PIN
|
||||
#define LCD_PINS_D5 EXP1_05_PIN
|
||||
#define LCD_PINS_D6 EXP1_04_PIN
|
||||
#define LCD_PINS_D7 EXP1_03_PIN
|
||||
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
#define BTN_ENC_EN EXPA1_03_PIN // Detect the presence of the encoder
|
||||
#define BTN_ENC_EN EXP1_03_PIN // Detect the presence of the encoder
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -143,46 +143,46 @@
|
||||
*/
|
||||
|
||||
// M1 on Driver Expansion Module
|
||||
#define E2_STEP_PIN EXPA2_05_PIN
|
||||
#define E2_DIR_PIN EXPA2_06_PIN
|
||||
#define E2_ENABLE_PIN EXPA2_04_PIN
|
||||
#define E2_STEP_PIN EXP2_05_PIN
|
||||
#define E2_DIR_PIN EXP2_06_PIN
|
||||
#define E2_ENABLE_PIN EXP2_04_PIN
|
||||
#if !EXP_MOT_USE_EXP2_ONLY
|
||||
#define E2_DIAG_PIN EXPA1_06_PIN
|
||||
#define E2_CS_PIN EXPA1_05_PIN
|
||||
#define E2_DIAG_PIN EXP1_06_PIN
|
||||
#define E2_CS_PIN EXP1_05_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E2_SERIAL_TX_PIN EXPA1_05_PIN
|
||||
#define E2_SERIAL_RX_PIN EXPA1_05_PIN
|
||||
#define E2_SERIAL_TX_PIN EXP1_05_PIN
|
||||
#define E2_SERIAL_RX_PIN EXP1_05_PIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// M2 on Driver Expansion Module
|
||||
#define E3_STEP_PIN EXPA2_08_PIN
|
||||
#define E3_DIR_PIN EXPA2_07_PIN
|
||||
#define E3_STEP_PIN EXP2_08_PIN
|
||||
#define E3_DIR_PIN EXP2_07_PIN
|
||||
#if !EXP_MOT_USE_EXP2_ONLY
|
||||
#define E3_ENABLE_PIN EXPA1_03_PIN
|
||||
#define E3_DIAG_PIN EXPA1_08_PIN
|
||||
#define E3_CS_PIN EXPA1_07_PIN
|
||||
#define E3_ENABLE_PIN EXP1_03_PIN
|
||||
#define E3_DIAG_PIN EXP1_08_PIN
|
||||
#define E3_CS_PIN EXP1_07_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E3_SERIAL_TX_PIN EXPA1_07_PIN
|
||||
#define E3_SERIAL_RX_PIN EXPA1_07_PIN
|
||||
#define E3_SERIAL_TX_PIN EXP1_07_PIN
|
||||
#define E3_SERIAL_RX_PIN EXP1_07_PIN
|
||||
#endif
|
||||
#else
|
||||
#define E3_ENABLE_PIN EXPA2_04_PIN
|
||||
#define E3_ENABLE_PIN EXP2_04_PIN
|
||||
#endif
|
||||
|
||||
// M3 on Driver Expansion Module
|
||||
#define E4_STEP_PIN EXPA2_10_PIN
|
||||
#define E4_DIR_PIN EXPA2_09_PIN
|
||||
#define E4_STEP_PIN EXP2_10_PIN
|
||||
#define E4_DIR_PIN EXP2_09_PIN
|
||||
#if !EXP_MOT_USE_EXP2_ONLY
|
||||
#define E4_ENABLE_PIN EXPA1_04_PIN
|
||||
#define E4_DIAG_PIN EXPA1_10_PIN
|
||||
#define E4_CS_PIN EXPA1_09_PIN
|
||||
#define E4_ENABLE_PIN EXP1_04_PIN
|
||||
#define E4_DIAG_PIN EXP1_10_PIN
|
||||
#define E4_CS_PIN EXP1_09_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E4_SERIAL_TX_PIN EXPA1_09_PIN
|
||||
#define E4_SERIAL_RX_PIN EXPA1_09_PIN
|
||||
#define E4_SERIAL_TX_PIN EXP1_09_PIN
|
||||
#define E4_SERIAL_RX_PIN EXP1_09_PIN
|
||||
#endif
|
||||
#else
|
||||
#define E4_ENABLE_PIN EXPA2_04_PIN
|
||||
#define E4_ENABLE_PIN EXP2_04_PIN
|
||||
#endif
|
||||
|
||||
#endif // HAS_BTT_EXP_MOT
|
||||
|
||||
@@ -190,51 +190,51 @@
|
||||
* EXP
|
||||
*/
|
||||
|
||||
#define EXPA1_03_PIN P0_18
|
||||
#define EXPA1_04_PIN P0_17
|
||||
#define EXPA1_05_PIN P0_15
|
||||
#define EXPA1_06_PIN P0_20
|
||||
#define EXPA1_07_PIN -1
|
||||
#define EXPA1_08_PIN P0_19
|
||||
#define EXPA1_09_PIN P0_16
|
||||
#define EXPA1_10_PIN P2_08
|
||||
#define EXP1_03_PIN P0_18
|
||||
#define EXP1_04_PIN P0_17
|
||||
#define EXP1_05_PIN P0_15
|
||||
#define EXP1_06_PIN P0_20
|
||||
#define EXP1_07_PIN -1
|
||||
#define EXP1_08_PIN P0_19
|
||||
#define EXP1_09_PIN P0_16
|
||||
#define EXP1_10_PIN P2_08
|
||||
|
||||
#if HAS_WIRED_LCD
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
|
||||
#define BEEPER_PIN EXPA1_10_PIN
|
||||
#define BEEPER_PIN EXP1_10_PIN
|
||||
|
||||
#define BTN_EN1 EXPA1_08_PIN
|
||||
#define BTN_EN2 EXPA1_06_PIN
|
||||
#define BTN_ENC EXPA1_09_PIN
|
||||
#define BTN_EN1 EXP1_08_PIN
|
||||
#define BTN_EN2 EXP1_06_PIN
|
||||
#define BTN_ENC EXP1_09_PIN
|
||||
|
||||
#define LCD_PINS_RS EXPA1_04_PIN
|
||||
#define LCD_PINS_ENABLE EXPA1_03_PIN
|
||||
#define LCD_PINS_D4 EXPA1_05_PIN
|
||||
#define LCD_PINS_RS EXP1_04_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_03_PIN
|
||||
#define LCD_PINS_D4 EXP1_05_PIN
|
||||
|
||||
#elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!
|
||||
|
||||
#error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_E3_TURBO.h' for details. Comment out this line to continue."
|
||||
|
||||
#define LCD_PINS_RS EXPA1_05_PIN
|
||||
#define LCD_PINS_ENABLE EXPA1_09_PIN
|
||||
#define LCD_PINS_D4 EXPA1_04_PIN
|
||||
#define LCD_PINS_D5 EXPA1_06_PIN
|
||||
#define LCD_PINS_D6 EXPA1_08_PIN
|
||||
#define LCD_PINS_D7 EXPA1_10_PIN
|
||||
#define LCD_PINS_RS EXP1_05_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_09_PIN
|
||||
#define LCD_PINS_D4 EXP1_04_PIN
|
||||
#define LCD_PINS_D5 EXP1_06_PIN
|
||||
#define LCD_PINS_D6 EXP1_08_PIN
|
||||
#define LCD_PINS_D7 EXP1_10_PIN
|
||||
#define ADC_KEYPAD_PIN P1_23 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!
|
||||
|
||||
#elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
|
||||
|
||||
#define BTN_EN1 EXPA1_08_PIN
|
||||
#define BTN_EN2 EXPA1_06_PIN
|
||||
#define BTN_ENC EXPA1_09_PIN
|
||||
#define BTN_EN1 EXP1_08_PIN
|
||||
#define BTN_EN2 EXP1_06_PIN
|
||||
#define BTN_ENC EXP1_09_PIN
|
||||
|
||||
#define DOGLCD_CS EXPA1_04_PIN
|
||||
#define DOGLCD_A0 EXPA1_05_PIN
|
||||
#define DOGLCD_SCK EXPA1_10_PIN
|
||||
#define DOGLCD_MOSI EXPA1_03_PIN
|
||||
#define DOGLCD_CS EXP1_04_PIN
|
||||
#define DOGLCD_A0 EXP1_05_PIN
|
||||
#define DOGLCD_SCK EXP1_10_PIN
|
||||
#define DOGLCD_MOSI EXP1_03_PIN
|
||||
#define FORCE_SOFT_SPI
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* GT2560 RevB + GT2560 V3.0 + GT2560 V3.1 + GT2560 V4.0 pin assignment
|
||||
* Geeetech GT2560 RevB + GT2560 3.0/3.1 + GT2560 4.0/4.1 pin assignments
|
||||
*/
|
||||
|
||||
#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
|
||||
@@ -30,13 +30,13 @@
|
||||
#endif
|
||||
|
||||
#ifndef BOARD_INFO_NAME
|
||||
#define BOARD_INFO_NAME "GT2560 V3.0"
|
||||
#define BOARD_INFO_NAME "GT2560 RevB/3.x/4.x"
|
||||
#endif
|
||||
|
||||
//
|
||||
// Servos
|
||||
//
|
||||
#define SERVO0_PIN 11 //13 untested 3Dtouch
|
||||
#define SERVO0_PIN 11 // 13 untested 3Dtouch
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
@@ -142,7 +142,10 @@
|
||||
#define SDSS 53
|
||||
#define LED_PIN 13 // Use 6 (case light) for external LED. 13 is internal (yellow) LED.
|
||||
#define PS_ON_PIN 12
|
||||
#define SUICIDE_PIN 54 // This pin must be enabled at boot to keep power flowing
|
||||
|
||||
#if NUM_RUNOUT_SENSORS < 3
|
||||
#define SUICIDE_PIN 54 // This pin must be enabled at boot to keep power flowing
|
||||
#endif
|
||||
|
||||
#ifndef CASE_LIGHT_PIN
|
||||
#define CASE_LIGHT_PIN 6 // 21
|
||||
@@ -153,26 +156,48 @@
|
||||
//
|
||||
#define BEEPER_PIN 18
|
||||
|
||||
#ifndef LCD_PINS_RS
|
||||
#define LCD_PINS_RS 20
|
||||
#endif
|
||||
#ifndef LCD_PINS_ENABLE
|
||||
#define LCD_PINS_ENABLE 17
|
||||
#endif
|
||||
#ifndef LCD_PINS_D4
|
||||
#define LCD_PINS_D4 16
|
||||
#endif
|
||||
#ifndef LCD_PINS_D5
|
||||
#define LCD_PINS_D5 21
|
||||
#endif
|
||||
#ifndef LCD_PINS_D6
|
||||
#define LCD_PINS_D6 5
|
||||
#endif
|
||||
#ifndef LCD_PINS_D7
|
||||
#define LCD_PINS_D7 36
|
||||
#if ENABLED(YHCB2004)
|
||||
#ifndef YHCB2004_CLK
|
||||
#define YHCB2004_CLK 5
|
||||
#endif
|
||||
#ifndef YHCB2004_MOSI
|
||||
#define YHCB2004_MOSI 21
|
||||
#endif
|
||||
#ifndef YHCB2004_MISO
|
||||
#define YHCB2004_MISO 36
|
||||
#endif
|
||||
#elif HAS_WIRED_LCD
|
||||
#ifndef LCD_PINS_RS
|
||||
#define LCD_PINS_RS 20
|
||||
#endif
|
||||
#ifndef LCD_PINS_ENABLE
|
||||
#define LCD_PINS_ENABLE 17
|
||||
#endif
|
||||
#ifndef LCD_PINS_D4
|
||||
#define LCD_PINS_D4 16
|
||||
#endif
|
||||
#ifndef LCD_PINS_D5
|
||||
#define LCD_PINS_D5 21
|
||||
#endif
|
||||
#ifndef LCD_PINS_D6
|
||||
#define LCD_PINS_D6 5
|
||||
#endif
|
||||
#ifndef LCD_PINS_D7
|
||||
#define LCD_PINS_D7 36
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_NEWPANEL
|
||||
#if ENABLED(YHCB2004)
|
||||
#ifndef BTN_EN1
|
||||
#define BTN_EN1 16
|
||||
#endif
|
||||
#ifndef BTN_EN2
|
||||
#define BTN_EN2 17
|
||||
#endif
|
||||
#ifndef BTN_ENC
|
||||
#define BTN_ENC 19
|
||||
#endif
|
||||
#elif IS_NEWPANEL
|
||||
#ifndef BTN_EN1
|
||||
#define BTN_EN1 42
|
||||
#endif
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Geeetech A20M pin assignment
|
||||
* Geeetech A20M board pin assignments
|
||||
*/
|
||||
|
||||
#define LCD_PINS_RS 5
|
||||
@@ -30,7 +30,7 @@
|
||||
#define LCD_PINS_D4 21
|
||||
#define LCD_PINS_D7 6
|
||||
|
||||
#define SPEAKER // The speaker can produce tones
|
||||
#define SPEAKER // The speaker can produce tones
|
||||
|
||||
#if IS_NEWPANEL
|
||||
#define BTN_EN1 16
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/*****************************************************************
|
||||
* GT2560 V3.0 pin assignment (for Mecreator 2)
|
||||
*****************************************************************/
|
||||
/**
|
||||
* Geeetech GT2560 V 3.0 board pin assignments (for Mecreator 2)
|
||||
*/
|
||||
|
||||
#define BOARD_INFO_NAME "GT2560 V3.0 (MC2)"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* HJC2560-C Rev2.x pin assignments
|
||||
* Geeetech HJC2560-C Rev 2.x board pin assignments
|
||||
*/
|
||||
|
||||
#if NOT_TARGET(__AVR_ATmega2560__)
|
||||
|
||||
@@ -252,6 +252,8 @@
|
||||
#include "mega/pins_WANHAO_ONEPLUS.h" // ATmega2560 env:mega2560
|
||||
#elif MB(OVERLORD)
|
||||
#include "mega/pins_OVERLORD.h" // ATmega2560 env:mega2560
|
||||
#elif MB(HJC2560C_REV1)
|
||||
#include "mega/pins_HJC2560C_REV1.h" // ATmega2560 env:mega2560
|
||||
#elif MB(HJC2560C_REV2)
|
||||
#include "mega/pins_HJC2560C_REV2.h" // ATmega2560 env:mega2560
|
||||
#elif MB(LEAPFROG_XEED2015)
|
||||
|
||||
@@ -124,14 +124,14 @@
|
||||
#define X_DIR_PIN 55
|
||||
#define X_ENABLE_PIN 38
|
||||
#ifndef X_CS_PIN
|
||||
#define X_CS_PIN 53
|
||||
#define X_CS_PIN EXP2_07_PIN
|
||||
#endif
|
||||
|
||||
#define Y_STEP_PIN 60
|
||||
#define Y_DIR_PIN 61
|
||||
#define Y_ENABLE_PIN 56
|
||||
#ifndef Y_CS_PIN
|
||||
#define Y_CS_PIN 49
|
||||
#define Y_CS_PIN EXP2_04_PIN
|
||||
#endif
|
||||
|
||||
#ifndef Z_STEP_PIN
|
||||
@@ -245,7 +245,7 @@
|
||||
//
|
||||
// Misc. Functions
|
||||
//
|
||||
#define SDSS 53
|
||||
#define SDSS EXP2_07_PIN
|
||||
#define LED_PIN 13
|
||||
|
||||
#ifndef FILWIDTH_PIN
|
||||
@@ -307,6 +307,9 @@
|
||||
*
|
||||
* Hardware serial communication ports.
|
||||
* If undefined software serial is used according to the pins below
|
||||
*
|
||||
* Serial2 -- AUX-4 Pin 18 (D16 TX2) and AUX-4 Pin 17 (D17 RX2)
|
||||
* Serial1 -- Pins D18 and D19 are used for Z-MIN and Z-MAX
|
||||
*/
|
||||
//#define X_HARDWARE_SERIAL Serial1
|
||||
//#define X2_HARDWARE_SERIAL Serial1
|
||||
@@ -426,10 +429,57 @@
|
||||
#define E_MUX2_PIN 44 // E1_CS_PIN
|
||||
#endif
|
||||
|
||||
//
|
||||
// Aux 3 GND D52 D50 5V
|
||||
// NC D53 D51 D49
|
||||
|
||||
//
|
||||
// Aux 4 D16 D17 D23 D25 D27 D29 D31 D33 D35 D37 D39 D41 D43 D45 D47 D32 GND 5V
|
||||
//
|
||||
|
||||
/**
|
||||
* LCD adapter. Please note: These comes in two variants. The socket keys can be
|
||||
* on either side, and may be backwards on some boards / displays.
|
||||
* _____ _____
|
||||
* D37 |10 9 | D35 (MISO) D50 |10 9 | D52 (SCK)
|
||||
* D17 | 8 7 | D16 D31 | 8 7 | D53
|
||||
* D23 6 5 D25 D33 6 5 D51 (MOSI)
|
||||
* D27 | 4 3 | D29 D49 | 4 3 | D41
|
||||
* GND | 2 1 | 5V GND | 2 1 | NC
|
||||
* ----- -----
|
||||
* EXP1 EXP2
|
||||
*/
|
||||
|
||||
#ifndef EXP1_03_PIN
|
||||
#define EXP1_03_PIN 29
|
||||
#define EXP1_04_PIN 27
|
||||
#define EXP1_05_PIN 25
|
||||
#define EXP1_06_PIN 23
|
||||
#define EXP1_07_PIN 16
|
||||
#define EXP1_08_PIN 17
|
||||
#define EXP1_09_PIN 35
|
||||
#define EXP1_10_PIN 37
|
||||
|
||||
#define EXP2_03_PIN 41
|
||||
#define EXP2_04_PIN 49
|
||||
#define EXP2_05_PIN 51
|
||||
#define EXP2_06_PIN 33
|
||||
#define EXP2_07_PIN 53
|
||||
#define EXP2_08_PIN 31
|
||||
#define EXP2_09_PIN 52
|
||||
#define EXP2_10_PIN 50
|
||||
#endif
|
||||
|
||||
//////////////////////////
|
||||
// LCDs and Controllers //
|
||||
//////////////////////////
|
||||
|
||||
// GLCD features
|
||||
// Uncomment screen orientation
|
||||
//#define LCD_SCREEN_ROT_90
|
||||
//#define LCD_SCREEN_ROT_180
|
||||
//#define LCD_SCREEN_ROT_270
|
||||
|
||||
#if HAS_WIRED_LCD
|
||||
|
||||
//
|
||||
@@ -437,9 +487,9 @@
|
||||
//
|
||||
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
|
||||
|
||||
#define LCD_PINS_RS 49 // CS chip select /SS chip slave select
|
||||
#define LCD_PINS_ENABLE 51 // SID (MOSI)
|
||||
#define LCD_PINS_D4 52 // SCK (CLK) clock
|
||||
#define LCD_PINS_RS EXP2_04_PIN // CS chip select /SS chip slave select
|
||||
#define LCD_PINS_ENABLE EXP2_05_PIN // SID (MOSI)
|
||||
#define LCD_PINS_D4 EXP2_09_PIN // SCK (CLK) clock
|
||||
|
||||
#elif BOTH(IS_NEWPANEL, PANEL_ONE)
|
||||
|
||||
@@ -452,18 +502,18 @@
|
||||
|
||||
#elif ENABLED(TFTGLCD_PANEL_SPI)
|
||||
|
||||
#define TFTGLCD_CS 33
|
||||
#define TFTGLCD_CS EXP2_06_PIN
|
||||
|
||||
#else
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
|
||||
#define LCD_PINS_RS 27
|
||||
#define LCD_PINS_ENABLE 29
|
||||
#define LCD_PINS_D4 25
|
||||
#define LCD_PINS_RS EXP1_04_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_03_PIN
|
||||
#define LCD_PINS_D4 EXP1_05_PIN
|
||||
|
||||
#if !IS_NEWPANEL
|
||||
#define BEEPER_PIN 37
|
||||
#define BEEPER_PIN EXP1_10_PIN
|
||||
#endif
|
||||
|
||||
#elif ENABLED(ZONESTAR_LCD)
|
||||
@@ -479,25 +529,25 @@
|
||||
#else
|
||||
|
||||
#if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
|
||||
#define LCD_PINS_DC 25 // Set as output on init
|
||||
#define LCD_PINS_RS 27 // Pull low for 1s to init
|
||||
#define LCD_PINS_DC EXP1_05_PIN // Set as output on init
|
||||
#define LCD_PINS_RS EXP1_04_PIN // Pull low for 1s to init
|
||||
// DOGM SPI LCD Support
|
||||
#define DOGLCD_A0 LCD_PINS_DC
|
||||
#define DOGLCD_CS 16
|
||||
#define DOGLCD_MOSI 17
|
||||
#define DOGLCD_SCK 23
|
||||
#define DOGLCD_CS EXP1_07_PIN
|
||||
#define DOGLCD_MOSI EXP1_08_PIN
|
||||
#define DOGLCD_SCK EXP1_06_PIN
|
||||
#else
|
||||
#define LCD_PINS_RS 16
|
||||
#define LCD_PINS_ENABLE 17
|
||||
#define LCD_PINS_D4 23
|
||||
#define LCD_PINS_D5 25
|
||||
#define LCD_PINS_D6 27
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
#define LCD_PINS_D5 EXP1_05_PIN
|
||||
#define LCD_PINS_D6 EXP1_04_PIN
|
||||
#endif
|
||||
|
||||
#define LCD_PINS_D7 29
|
||||
#define LCD_PINS_D7 EXP1_03_PIN
|
||||
|
||||
#if !IS_NEWPANEL
|
||||
#define BEEPER_PIN 33
|
||||
#define BEEPER_PIN EXP2_06_PIN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -508,7 +558,7 @@
|
||||
//#define SHIFT_CLK_PIN 38
|
||||
//#define SHIFT_LD_PIN 42
|
||||
//#define SHIFT_OUT_PIN 40
|
||||
//#define SHIFT_EN_PIN 17
|
||||
//#define SHIFT_EN_PIN EXP1_08_PIN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -524,22 +574,22 @@
|
||||
|
||||
#if IS_RRD_SC
|
||||
|
||||
#define BEEPER_PIN 37
|
||||
#define BEEPER_PIN EXP1_10_PIN
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
#define BTN_EN1 17
|
||||
#define BTN_EN2 23
|
||||
#define BTN_EN1 EXP1_08_PIN
|
||||
#define BTN_EN2 EXP1_06_PIN
|
||||
#else
|
||||
#define BTN_EN1 31
|
||||
#define BTN_EN2 33
|
||||
#define BTN_EN1 EXP2_08_PIN
|
||||
#define BTN_EN2 EXP2_06_PIN
|
||||
#endif
|
||||
|
||||
#define BTN_ENC 35
|
||||
#define BTN_ENC EXP1_09_PIN
|
||||
#ifndef SD_DETECT_PIN
|
||||
#define SD_DETECT_PIN 49
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
#endif
|
||||
#ifndef KILL_PIN
|
||||
#define KILL_PIN 41
|
||||
#define KILL_PIN EXP2_03_PIN
|
||||
#endif
|
||||
|
||||
#if ENABLED(BQ_LCD_SMART_CONTROLLER)
|
||||
@@ -559,7 +609,7 @@
|
||||
#define BTN_EN2 43
|
||||
#define BTN_ENC 32
|
||||
#define LCD_SDSS SDSS
|
||||
#define KILL_PIN 41
|
||||
#define KILL_PIN EXP2_03_PIN
|
||||
|
||||
#elif ENABLED(LCD_I2C_VIKI)
|
||||
|
||||
@@ -568,7 +618,7 @@
|
||||
#define BTN_ENC -1
|
||||
|
||||
#define LCD_SDSS SDSS
|
||||
#define SD_DETECT_PIN 49
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
|
||||
#elif ANY(VIKI2, miniVIKI)
|
||||
|
||||
@@ -576,87 +626,81 @@
|
||||
#define DOGLCD_A0 44
|
||||
#define LCD_SCREEN_ROT_180
|
||||
|
||||
#define BEEPER_PIN 33
|
||||
#define BEEPER_PIN EXP2_06_PIN
|
||||
#define STAT_LED_RED_PIN 32
|
||||
#define STAT_LED_BLUE_PIN 35
|
||||
#define STAT_LED_BLUE_PIN EXP1_09_PIN
|
||||
|
||||
#define BTN_EN1 22
|
||||
#define BTN_EN2 7
|
||||
#define BTN_ENC 39
|
||||
|
||||
#define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board
|
||||
#define KILL_PIN 31
|
||||
#define KILL_PIN EXP2_08_PIN
|
||||
|
||||
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
|
||||
|
||||
#define DOGLCD_CS 29
|
||||
#define DOGLCD_A0 27
|
||||
#define DOGLCD_CS EXP1_03_PIN
|
||||
#define DOGLCD_A0 EXP1_04_PIN
|
||||
|
||||
#define BEEPER_PIN 23
|
||||
#define LCD_BACKLIGHT_PIN 33
|
||||
#define BEEPER_PIN EXP1_06_PIN
|
||||
#define LCD_BACKLIGHT_PIN EXP2_06_PIN
|
||||
|
||||
#define BTN_EN1 35
|
||||
#define BTN_EN2 37
|
||||
#define BTN_ENC 31
|
||||
#define BTN_EN1 EXP1_09_PIN
|
||||
#define BTN_EN2 EXP1_10_PIN
|
||||
#define BTN_ENC EXP2_08_PIN
|
||||
|
||||
#define LCD_SDSS SDSS
|
||||
#define SD_DETECT_PIN 49
|
||||
#define KILL_PIN 41
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
#define KILL_PIN EXP2_03_PIN
|
||||
|
||||
#elif EITHER(MKS_MINI_12864, FYSETC_MINI_12864)
|
||||
|
||||
#define BEEPER_PIN 37
|
||||
#define BTN_ENC 35
|
||||
#define SD_DETECT_PIN 49
|
||||
#define BEEPER_PIN EXP1_10_PIN
|
||||
#define BTN_ENC EXP1_09_PIN
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
|
||||
#ifndef KILL_PIN
|
||||
#define KILL_PIN 41
|
||||
#define KILL_PIN EXP2_03_PIN
|
||||
#endif
|
||||
|
||||
#if ENABLED(MKS_MINI_12864)
|
||||
|
||||
#define DOGLCD_A0 27
|
||||
#define DOGLCD_CS 25
|
||||
|
||||
// GLCD features
|
||||
// Uncomment screen orientation
|
||||
//#define LCD_SCREEN_ROT_90
|
||||
//#define LCD_SCREEN_ROT_180
|
||||
//#define LCD_SCREEN_ROT_270
|
||||
#define DOGLCD_A0 EXP1_04_PIN
|
||||
#define DOGLCD_CS EXP1_05_PIN
|
||||
|
||||
// not connected to a pin
|
||||
#define LCD_BACKLIGHT_PIN -1 // 65 (MKS mini12864 can't adjust backlight by software!)
|
||||
|
||||
#define BTN_EN1 31
|
||||
#define BTN_EN2 33
|
||||
#define BTN_EN1 EXP2_08_PIN
|
||||
#define BTN_EN2 EXP2_06_PIN
|
||||
|
||||
#elif ENABLED(FYSETC_MINI_12864)
|
||||
|
||||
// From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
|
||||
|
||||
#define DOGLCD_A0 16
|
||||
#define DOGLCD_CS 17
|
||||
#define DOGLCD_A0 EXP1_07_PIN
|
||||
#define DOGLCD_CS EXP1_08_PIN
|
||||
|
||||
#define BTN_EN1 33
|
||||
#define BTN_EN2 31
|
||||
#define BTN_EN1 EXP2_06_PIN
|
||||
#define BTN_EN2 EXP2_08_PIN
|
||||
|
||||
//#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
|
||||
// results in LCD soft SPI mode 3, SD soft SPI mode 0
|
||||
|
||||
#define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally.
|
||||
#define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
|
||||
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
||||
#ifndef RGB_LED_R_PIN
|
||||
#define RGB_LED_R_PIN 25
|
||||
#define RGB_LED_R_PIN EXP1_05_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_G_PIN
|
||||
#define RGB_LED_G_PIN 27
|
||||
#define RGB_LED_G_PIN EXP1_04_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_B_PIN
|
||||
#define RGB_LED_B_PIN 29
|
||||
#define RGB_LED_B_PIN EXP1_03_PIN
|
||||
#endif
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
#define NEOPIXEL_PIN 25
|
||||
#define NEOPIXEL_PIN EXP1_05_PIN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -670,17 +714,11 @@
|
||||
#define DOGLCD_A0 44
|
||||
#define DOGLCD_CS 66
|
||||
|
||||
// GLCD features
|
||||
// Uncomment screen orientation
|
||||
//#define LCD_SCREEN_ROT_90
|
||||
//#define LCD_SCREEN_ROT_180
|
||||
//#define LCD_SCREEN_ROT_270
|
||||
|
||||
#define BTN_EN1 40
|
||||
#define BTN_EN2 63
|
||||
#define BTN_ENC 59
|
||||
|
||||
#define SD_DETECT_PIN 49
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
#define KILL_PIN 64
|
||||
|
||||
#elif ENABLED(ZONESTAR_LCD)
|
||||
@@ -690,31 +728,33 @@
|
||||
#elif ENABLED(AZSMZ_12864)
|
||||
|
||||
// Pins only defined for RAMPS_SMART currently
|
||||
#error "No pins defined for RAMPS with AZSMZ_12864."
|
||||
#if DISABLED(IS_RAMPS_SMART)
|
||||
#error "No pins defined for RAMPS with AZSMZ_12864."
|
||||
#endif
|
||||
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#define SD_DETECT_PIN 49
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
|
||||
#else
|
||||
|
||||
// Beeper on AUX-4
|
||||
#define BEEPER_PIN 33
|
||||
#define BEEPER_PIN EXP2_06_PIN
|
||||
|
||||
// Buttons are directly attached to AUX-2
|
||||
#if ENABLED(PANEL_ONE)
|
||||
#define BTN_EN1 59 // AUX2 PIN 3
|
||||
#define BTN_EN2 63 // AUX2 PIN 4
|
||||
#define BTN_ENC 49 // AUX3 PIN 7
|
||||
#define BTN_ENC EXP2_04_PIN
|
||||
#else
|
||||
#define BTN_EN1 37
|
||||
#define BTN_EN2 35
|
||||
#define BTN_ENC 31
|
||||
#define BTN_EN1 EXP1_10_PIN
|
||||
#define BTN_EN2 EXP1_09_PIN
|
||||
#define BTN_ENC EXP2_08_PIN
|
||||
#endif
|
||||
|
||||
#if ENABLED(G3D_PANEL)
|
||||
#define SD_DETECT_PIN 49
|
||||
#define KILL_PIN 41
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
#define KILL_PIN EXP2_03_PIN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -741,7 +781,8 @@
|
||||
|
||||
#error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_RAMPS.h' for details. Comment out this line to continue."
|
||||
|
||||
/** FYSETC TFT TFT81050 display pinout
|
||||
/**
|
||||
* FYSETC TFT-81050 display pinout
|
||||
*
|
||||
* Board Display
|
||||
* _____ _____
|
||||
@@ -766,16 +807,16 @@
|
||||
* EXP2-7 ----------- EXP1-4
|
||||
* EXP2-8 ----------- EXP1-3
|
||||
* EXP2-1 ----------- EXP1-2
|
||||
* EXP1-10 ----------- EXP1-1
|
||||
* EXP1-10 ---------- EXP1-1
|
||||
*
|
||||
* NOTE: The MISO pin should not get a 5V signal.
|
||||
* To fix, insert a 1N4148 diode in the MISO line.
|
||||
*/
|
||||
|
||||
#define BEEPER_PIN 37
|
||||
#define BEEPER_PIN EXP1_10_PIN
|
||||
|
||||
#define SD_DETECT_PIN 49
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
|
||||
#define CLCD_MOD_RESET 31
|
||||
#define CLCD_SPI_CS 33
|
||||
#define CLCD_MOD_RESET EXP2_08_PIN
|
||||
#define CLCD_SPI_CS EXP2_06_PIN
|
||||
#endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050
|
||||
|
||||
@@ -60,8 +60,8 @@
|
||||
* (Search the web for "Arduino DUE Board Pinout" to see the correct header.)
|
||||
*/
|
||||
|
||||
#if NOT_TARGET(__SAM3X8E__)
|
||||
#error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
|
||||
#if NOT_TARGET(__SAM3X8E__, __AVR_ATmega2560__)
|
||||
#error "Oops! Select 'Arduino Due' or 'Mega 2560' in 'Tools > Board.'"
|
||||
#endif
|
||||
|
||||
#define BOARD_INFO_NAME "RAMPS-SMART"
|
||||
@@ -72,6 +72,18 @@
|
||||
#define I2C_EEPROM
|
||||
#define MARLIN_EEPROM_SIZE 0x1000
|
||||
|
||||
#define SDA_PIN 20
|
||||
#define SCL_PIN 21
|
||||
|
||||
// See EEPROM device datasheet for the following values. These are for 24xx256
|
||||
#define EEPROM_SERIAL_ADDR 0x50 // 7 bit i2c address (without R/W bit)
|
||||
#define EEPROM_PAGE_SIZE 64 // page write buffer size
|
||||
#define EEPROM_PAGE_WRITE_TIME 7 // page write time in milliseconds (docs say 5ms but that is too short)
|
||||
|
||||
#define TWI_CLOCK_FREQ 400000
|
||||
#define EEPROM_ADDRSZ_BYTES TWI_MMR_IADRSZ_2_BYTE // TWI_MMR_IADRSZ_1_BYTE for 1 byte, or TWI_MMR_IADRSZ_2_BYTE for 2 byte
|
||||
#define EEPROM_AVAILABLE EEPROM_I2C
|
||||
|
||||
#define RESET_PIN 42 // Resets the board if the jumper is attached
|
||||
|
||||
//
|
||||
@@ -97,6 +109,7 @@
|
||||
//
|
||||
// LCD / Controller
|
||||
//
|
||||
|
||||
// Support for AZSMZ 12864 LCD with SD Card 3D printer smart controller control panel
|
||||
#if ENABLED(AZSMZ_12864)
|
||||
#define BEEPER_PIN 66 // Smart RAMPS 1.42 pinout diagram on RepRap WIKI erroneously says this should be pin 65
|
||||
|
||||
@@ -132,8 +132,12 @@
|
||||
#define HEATER_0_PIN PA1 // HEATER1
|
||||
#define HEATER_BED_PIN PA2 // HOT BED
|
||||
|
||||
#define FAN_PIN PA0 // FAN
|
||||
#define FAN_SOFT_PWM
|
||||
#ifndef FAN_PIN
|
||||
#define FAN_PIN PA0 // FAN
|
||||
#endif
|
||||
#if PIN_EXISTS(FAN)
|
||||
#define FAN_SOFT_PWM
|
||||
#endif
|
||||
|
||||
//
|
||||
// SD Card
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* 24 May 2018 - @chepo for STM32F103VET6
|
||||
* Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf
|
||||
* Geeetech GTM32 Mini board pin assignments
|
||||
*/
|
||||
|
||||
#if NOT_TARGET(__STM32F1__)
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* 24 May 2018 - @chepo for STM32F103VET6
|
||||
* Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf
|
||||
* Geeetech GTM32 Mini A30 board pin assignments
|
||||
*/
|
||||
|
||||
#if NOT_TARGET(__STM32F1__)
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* 24 May 2018 - @chepo for STM32F103VET6
|
||||
* Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf
|
||||
* Geeetech GTM32 Pro VB/VD board pin assignments
|
||||
* http://www.geeetech.com/wiki/index.php/File:Hardware_GTM32_PRO_VB.pdf
|
||||
*/
|
||||
|
||||
#if NOT_TARGET(__STM32F1__)
|
||||
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
|
||||
#endif
|
||||
|
||||
#define BOARD_INFO_NAME "GTM32 Pro VB"
|
||||
#define BOARD_INFO_NAME "GTM32 Pro VB/VD"
|
||||
#define DEFAULT_MACHINE_NAME "STM32F103VET6"
|
||||
|
||||
#define BOARD_NO_NATIVE_USB
|
||||
|
||||
@@ -22,15 +22,14 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* 24 May 2018 - @chepo for STM32F103VET6
|
||||
* Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf
|
||||
* Geeetech GTM32 Rev. B board pin assignments
|
||||
*/
|
||||
|
||||
#if NOT_TARGET(__STM32F1__)
|
||||
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
|
||||
#endif
|
||||
|
||||
#define BOARD_INFO_NAME "GTM32 Pro VB"
|
||||
#define BOARD_INFO_NAME "GTM32 Rev B"
|
||||
#define DEFAULT_MACHINE_NAME "M201"
|
||||
|
||||
#define BOARD_NO_NATIVE_USB
|
||||
|
||||
@@ -58,8 +58,12 @@
|
||||
//
|
||||
#define X_STOP_PIN PG10
|
||||
#define Y_STOP_PIN PA12
|
||||
#define Z_MAX_PIN PA14
|
||||
#define Z_MIN_PIN PA13
|
||||
#ifndef Z_MIN_PIN
|
||||
#define Z_MIN_PIN PA14
|
||||
#endif
|
||||
#ifndef Z_MAX_PIN
|
||||
#define Z_MAX_PIN PA13
|
||||
#endif
|
||||
|
||||
//
|
||||
// Steppers
|
||||
|
||||
@@ -172,73 +172,121 @@
|
||||
#define FAN_PIN PB8 // Fan1
|
||||
#define FAN1_PIN PB9 // Fan0
|
||||
|
||||
/**
|
||||
* -----------------------------------BTT002 V1.0----------------------------------------
|
||||
* ------ ------ |
|
||||
* PA3 | 1 2 | GND 5V | 1 2 | GND |
|
||||
* NRESET | 3 4 | PC4 (SD_DET) (LCD_D7) PE13 | 3 4 | PE12 (LCD_D6) |
|
||||
* (MOSI) PA7 | 5 6 | PB0 (BTN_EN2) (LCD_D5) PE11 | 5 6 | PE10 (LCD_D4) |
|
||||
* (SD_SS) PA4 | 7 8 | PC5 (BTN_EN1) (LCD_RS) PE8 | 7 8 | PE9 (LCD_EN) |
|
||||
* (SCK) PA5 | 9 10 | PA6 (MISO) (BTN_ENC) PB1 | 9 10 | PE7 (BEEPER) |
|
||||
* ------ ------ |
|
||||
* EXP2 EXP1 |
|
||||
* --------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define EXP1_03_PIN PE13
|
||||
#define EXP1_04_PIN PE12
|
||||
#define EXP1_05_PIN PE11
|
||||
#define EXP1_06_PIN PE10
|
||||
#define EXP1_07_PIN PE8
|
||||
#define EXP1_08_PIN PE9
|
||||
#define EXP1_09_PIN PB1
|
||||
#define EXP1_10_PIN PE7
|
||||
|
||||
#define EXP2_03_PIN -1
|
||||
#define EXP2_04_PIN PC4
|
||||
#define EXP2_05_PIN PA7
|
||||
#define EXP2_06_PIN PB0
|
||||
#define EXP2_07_PIN PA4
|
||||
#define EXP2_08_PIN PC5
|
||||
#define EXP2_09_PIN PA5
|
||||
#define EXP2_10_PIN PA6
|
||||
|
||||
// HAL SPI1 pins
|
||||
#define CUSTOM_SPI_PINS
|
||||
#if ENABLED(CUSTOM_SPI_PINS)
|
||||
#define SD_SCK_PIN PA5 // SPI1 SCLK
|
||||
#define SD_SS_PIN PA4 // SPI1 SSEL
|
||||
#define SD_MISO_PIN PA6 // SPI1 MISO
|
||||
#define SD_MOSI_PIN PA7 // SPI1 MOSI
|
||||
#define SD_SCK_PIN EXP2_09_PIN // SPI1 SCLK
|
||||
#define SD_SS_PIN EXP2_07_PIN // SPI1 SSEL
|
||||
#define SD_MISO_PIN EXP2_10_PIN // SPI1 MISO
|
||||
#define SD_MOSI_PIN EXP2_05_PIN // SPI1 MOSI
|
||||
#endif
|
||||
|
||||
//
|
||||
// Misc. Functions
|
||||
//
|
||||
#define SDSS PA4
|
||||
|
||||
/**
|
||||
* -------------------------------------BTT002 V1.0--------------------------------------------
|
||||
* ----- ----- |
|
||||
* PA3 | · · | GND 5V | · · | GND |
|
||||
* NRESET | · · | PC4(SD_DET) (LCD_D7) PE13 | · · | PE12 (LCD_D6) |
|
||||
* (MOSI)PA7 | · · | PB0(BTN_EN2) (LCD_D5) PE11 | · · | PE10 (LCD_D4) |
|
||||
* (SD_SS)PA4 | · · | PC5(BTN_EN1) (LCD_RS) PE8 | · · | PE9 (LCD_EN) |
|
||||
* (SCK)PA5 | · · | PA6(MISO) (BTN_ENC) PB1 | · · | PE7 (BEEPER) |
|
||||
* ----- ----- |
|
||||
* EXP2 EXP1 |
|
||||
* --------------------------------------------------------------------------------------------
|
||||
*/
|
||||
#define SDSS EXP2_07_PIN
|
||||
|
||||
//
|
||||
// LCDs and Controllers
|
||||
//
|
||||
#if HAS_WIRED_LCD
|
||||
#define BEEPER_PIN PE7
|
||||
#define BTN_ENC PB1
|
||||
#define BEEPER_PIN EXP1_10_PIN
|
||||
#define BTN_ENC EXP1_09_PIN
|
||||
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
#define LCD_PINS_RS PE12
|
||||
#define LCD_PINS_RS EXP1_04_PIN
|
||||
|
||||
#define BTN_EN1 PE9
|
||||
#define BTN_EN2 PE10
|
||||
#define BTN_EN1 EXP1_08_PIN
|
||||
#define BTN_EN2 EXP1_06_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE PE13
|
||||
#define LCD_PINS_D4 PE11
|
||||
#define LCD_PINS_ENABLE EXP1_03_PIN
|
||||
#define LCD_PINS_D4 EXP1_05_PIN
|
||||
|
||||
#elif ENABLED(MKS_MINI_12864)
|
||||
|
||||
#define DOGLCD_A0 EXP1_04_PIN
|
||||
#define DOGLCD_CS EXP1_05_PIN
|
||||
#define BTN_EN1 EXP2_08_PIN
|
||||
#define BTN_EN2 EXP2_06_PIN
|
||||
|
||||
#else
|
||||
|
||||
#define LCD_PINS_RS PE8
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
|
||||
#define BTN_EN1 PC5
|
||||
#define BTN_EN2 PB0
|
||||
#define SD_DETECT_PIN PC4
|
||||
#define BTN_EN1 EXP2_08_PIN
|
||||
#define BTN_EN2 EXP2_06_PIN
|
||||
|
||||
#define LCD_SDSS PA4
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE PE9
|
||||
#define LCD_PINS_D4 PE10
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#define DOGLCD_CS EXP1_08_PIN
|
||||
#define DOGLCD_A0 EXP1_07_PIN
|
||||
#define DOGLCD_MOSI EXP2_05_PIN
|
||||
#define DOGLCD_MISO EXP2_10_PIN
|
||||
#define DOGLCD_SCK EXP2_09_PIN
|
||||
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
|
||||
#define FORCE_SOFT_SPI
|
||||
|
||||
#define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
|
||||
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
||||
#ifndef RGB_LED_R_PIN
|
||||
#define RGB_LED_R_PIN EXP1_05_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_G_PIN
|
||||
#define RGB_LED_G_PIN EXP1_04_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_B_PIN
|
||||
#define RGB_LED_B_PIN EXP1_03_PIN
|
||||
#endif
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
#define NEOPIXEL_PIN EXP1_05_PIN
|
||||
#endif
|
||||
#endif // !FYSETC_MINI_12864
|
||||
|
||||
#if IS_ULTIPANEL
|
||||
#define LCD_PINS_D5 PE11
|
||||
#define LCD_PINS_D6 PE12
|
||||
#define LCD_PINS_D7 PE13
|
||||
#define LCD_PINS_D5 EXP1_05_PIN
|
||||
#define LCD_PINS_D6 EXP1_04_PIN
|
||||
#define LCD_PINS_D7 EXP1_03_PIN
|
||||
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// Alter timing for graphical display
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
#define HEATER_BED_PIN PD12 // Hotbed
|
||||
#define FAN_PIN PC8 // Fan0
|
||||
#define FAN1_PIN PE5 // Fan1
|
||||
#define FAN2_PIN PE6
|
||||
#define FAN2_PIN PE6 // Fan2
|
||||
|
||||
#ifndef E0_AUTO_FAN_PIN
|
||||
#define E0_AUTO_FAN_PIN FAN1_PIN
|
||||
@@ -268,23 +268,23 @@
|
||||
* EXP2 EXP1
|
||||
*/
|
||||
|
||||
#define EXPA1_03_PIN PG7
|
||||
#define EXPA1_04_PIN PG6
|
||||
#define EXPA1_05_PIN PG3
|
||||
#define EXPA1_06_PIN PG2
|
||||
#define EXPA1_07_PIN PD10
|
||||
#define EXPA1_08_PIN PD11
|
||||
#define EXPA1_09_PIN PA8
|
||||
#define EXPA1_10_PIN PG4
|
||||
#define EXP1_03_PIN PG7
|
||||
#define EXP1_04_PIN PG6
|
||||
#define EXP1_05_PIN PG3
|
||||
#define EXP1_06_PIN PG2
|
||||
#define EXP1_07_PIN PD10
|
||||
#define EXP1_08_PIN PD11
|
||||
#define EXP1_09_PIN PA8
|
||||
#define EXP1_10_PIN PG4
|
||||
|
||||
#define EXPA2_03_PIN -1
|
||||
#define EXPA2_04_PIN PF12
|
||||
#define EXPA2_05_PIN PB15
|
||||
#define EXPA2_06_PIN PF11
|
||||
#define EXPA2_07_PIN PB12
|
||||
#define EXPA2_08_PIN PG10
|
||||
#define EXPA2_09_PIN PB13
|
||||
#define EXPA2_10_PIN PB14
|
||||
#define EXP2_03_PIN -1
|
||||
#define EXP2_04_PIN PF12
|
||||
#define EXP2_05_PIN PB15
|
||||
#define EXP2_06_PIN PF11
|
||||
#define EXP2_07_PIN PB12
|
||||
#define EXP2_08_PIN PG10
|
||||
#define EXP2_09_PIN PB13
|
||||
#define EXP2_10_PIN PB14
|
||||
|
||||
//
|
||||
// Onboard SD card
|
||||
@@ -292,8 +292,8 @@
|
||||
//
|
||||
#if SD_CONNECTION_IS(LCD)
|
||||
|
||||
#define SD_DETECT_PIN EXPA2_04_PIN
|
||||
#define SDSS EXPA2_07_PIN
|
||||
#define SD_DETECT_PIN EXP2_04_PIN
|
||||
#define SDSS EXP2_07_PIN
|
||||
|
||||
#elif SD_CONNECTION_IS(ONBOARD)
|
||||
|
||||
@@ -325,36 +325,36 @@
|
||||
*/
|
||||
|
||||
// M1 on Driver Expansion Module
|
||||
#define E3_STEP_PIN EXPA2_05_PIN
|
||||
#define E3_DIR_PIN EXPA2_06_PIN
|
||||
#define E3_ENABLE_PIN EXPA2_04_PIN
|
||||
#define E3_DIAG_PIN EXPA1_06_PIN
|
||||
#define E3_CS_PIN EXPA1_05_PIN
|
||||
#define E3_STEP_PIN EXP2_05_PIN
|
||||
#define E3_DIR_PIN EXP2_06_PIN
|
||||
#define E3_ENABLE_PIN EXP2_04_PIN
|
||||
#define E3_DIAG_PIN EXP1_06_PIN
|
||||
#define E3_CS_PIN EXP1_05_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E3_SERIAL_TX_PIN EXPA1_05_PIN
|
||||
#define E3_SERIAL_RX_PIN EXPA1_05_PIN
|
||||
#define E3_SERIAL_TX_PIN EXP1_05_PIN
|
||||
#define E3_SERIAL_RX_PIN EXP1_05_PIN
|
||||
#endif
|
||||
|
||||
// M2 on Driver Expansion Module
|
||||
#define E4_STEP_PIN EXPA2_08_PIN
|
||||
#define E4_DIR_PIN EXPA2_07_PIN
|
||||
#define E4_ENABLE_PIN EXPA1_03_PIN
|
||||
#define E4_DIAG_PIN EXPA1_08_PIN
|
||||
#define E4_CS_PIN EXPA1_07_PIN
|
||||
#define E4_STEP_PIN EXP2_08_PIN
|
||||
#define E4_DIR_PIN EXP2_07_PIN
|
||||
#define E4_ENABLE_PIN EXP1_03_PIN
|
||||
#define E4_DIAG_PIN EXP1_08_PIN
|
||||
#define E4_CS_PIN EXP1_07_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E4_SERIAL_TX_PIN EXPA1_07_PIN
|
||||
#define E4_SERIAL_RX_PIN EXPA1_07_PIN
|
||||
#define E4_SERIAL_TX_PIN EXP1_07_PIN
|
||||
#define E4_SERIAL_RX_PIN EXP1_07_PIN
|
||||
#endif
|
||||
|
||||
// M3 on Driver Expansion Module
|
||||
#define E5_STEP_PIN EXPA2_10_PIN
|
||||
#define E5_DIR_PIN EXPA2_09_PIN
|
||||
#define E5_ENABLE_PIN EXPA1_04_PIN
|
||||
#define E5_DIAG_PIN EXPA1_10_PIN
|
||||
#define E5_CS_PIN EXPA1_09_PIN
|
||||
#define E5_STEP_PIN EXP2_10_PIN
|
||||
#define E5_DIR_PIN EXP2_09_PIN
|
||||
#define E5_ENABLE_PIN EXP1_04_PIN
|
||||
#define E5_DIAG_PIN EXP1_10_PIN
|
||||
#define E5_CS_PIN EXP1_09_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E5_SERIAL_TX_PIN EXPA1_09_PIN
|
||||
#define E5_SERIAL_RX_PIN EXPA1_09_PIN
|
||||
#define E5_SERIAL_TX_PIN EXP1_09_PIN
|
||||
#define E5_SERIAL_RX_PIN EXP1_09_PIN
|
||||
#endif
|
||||
|
||||
#endif // BTT_MOTOR_EXPANSION
|
||||
@@ -365,23 +365,23 @@
|
||||
#if IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS EXPA2_08_PIN
|
||||
#define TFTGLCD_CS EXP2_08_PIN
|
||||
#endif
|
||||
|
||||
#elif HAS_WIRED_LCD
|
||||
|
||||
#define BEEPER_PIN EXPA1_10_PIN
|
||||
#define BTN_ENC EXPA1_09_PIN
|
||||
#define BEEPER_PIN EXP1_10_PIN
|
||||
#define BTN_ENC EXP1_09_PIN
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
|
||||
#define LCD_PINS_RS EXPA1_04_PIN
|
||||
#define LCD_PINS_RS EXP1_04_PIN
|
||||
|
||||
#define BTN_EN1 EXPA1_08_PIN
|
||||
#define BTN_EN2 EXPA1_06_PIN
|
||||
#define BTN_EN1 EXP1_08_PIN
|
||||
#define BTN_EN2 EXP1_06_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_03_PIN
|
||||
#define LCD_PINS_D4 EXPA1_05_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_03_PIN
|
||||
#define LCD_PINS_D4 EXP1_05_PIN
|
||||
|
||||
// CR10_STOCKDISPLAY default timing is too fast
|
||||
#undef BOARD_ST7920_DELAY_1
|
||||
@@ -390,45 +390,45 @@
|
||||
|
||||
#elif ENABLED(MKS_MINI_12864)
|
||||
|
||||
#define DOGLCD_A0 EXPA1_04_PIN
|
||||
#define DOGLCD_CS EXPA1_05_PIN
|
||||
#define BTN_EN1 EXPA2_08_PIN
|
||||
#define BTN_EN2 EXPA2_06_PIN
|
||||
#define DOGLCD_A0 EXP1_04_PIN
|
||||
#define DOGLCD_CS EXP1_05_PIN
|
||||
#define BTN_EN1 EXP2_08_PIN
|
||||
#define BTN_EN2 EXP2_06_PIN
|
||||
|
||||
#else
|
||||
|
||||
#define LCD_PINS_RS EXPA1_07_PIN
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
|
||||
#define BTN_EN1 EXPA2_08_PIN
|
||||
#define BTN_EN2 EXPA2_06_PIN
|
||||
#define BTN_EN1 EXP2_08_PIN
|
||||
#define BTN_EN2 EXP2_06_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_08_PIN
|
||||
#define LCD_PINS_D4 EXPA1_06_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#define DOGLCD_CS EXPA1_08_PIN
|
||||
#define DOGLCD_A0 EXPA1_07_PIN
|
||||
#define DOGLCD_CS EXP1_08_PIN
|
||||
#define DOGLCD_A0 EXP1_07_PIN
|
||||
//#define LCD_BACKLIGHT_PIN -1
|
||||
#define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
#define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
||||
#ifndef RGB_LED_R_PIN
|
||||
#define RGB_LED_R_PIN EXPA1_05_PIN
|
||||
#define RGB_LED_R_PIN EXP1_05_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_G_PIN
|
||||
#define RGB_LED_G_PIN EXPA1_04_PIN
|
||||
#define RGB_LED_G_PIN EXP1_04_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_B_PIN
|
||||
#define RGB_LED_B_PIN EXPA1_03_PIN
|
||||
#define RGB_LED_B_PIN EXP1_03_PIN
|
||||
#endif
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
#define NEOPIXEL_PIN EXPA1_05_PIN
|
||||
#define NEOPIXEL_PIN EXP1_05_PIN
|
||||
#endif
|
||||
#endif // !FYSETC_MINI_12864
|
||||
|
||||
#if IS_ULTIPANEL
|
||||
#define LCD_PINS_D5 EXPA1_05_PIN
|
||||
#define LCD_PINS_D6 EXPA1_04_PIN
|
||||
#define LCD_PINS_D7 EXPA1_03_PIN
|
||||
#define LCD_PINS_D5 EXP1_05_PIN
|
||||
#define LCD_PINS_D6 EXP1_04_PIN
|
||||
#define LCD_PINS_D7 EXP1_03_PIN
|
||||
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
|
||||
|
||||
@@ -161,38 +161,38 @@
|
||||
* EXP3
|
||||
*/
|
||||
|
||||
#define EXPA1_03_PIN PB7
|
||||
#define EXPA1_04_PIN PB6
|
||||
#define EXPA1_05_PIN PB14
|
||||
#define EXPA1_06_PIN PB13
|
||||
#define EXPA1_07_PIN PB12
|
||||
#define EXPA1_08_PIN PB15
|
||||
#define EXPA1_09_PIN PC12
|
||||
#define EXPA1_10_PIN PC9
|
||||
#define EXP1_03_PIN PB7
|
||||
#define EXP1_04_PIN PB6
|
||||
#define EXP1_05_PIN PB14
|
||||
#define EXP1_06_PIN PB13
|
||||
#define EXP1_07_PIN PB12
|
||||
#define EXP1_08_PIN PB15
|
||||
#define EXP1_09_PIN PC12
|
||||
#define EXP1_10_PIN PC9
|
||||
|
||||
#define EXPA2_03_PIN -1
|
||||
#define EXPA2_04_PIN PC3
|
||||
#define EXPA2_05_PIN PA7
|
||||
#define EXPA2_06_PIN PC11
|
||||
#define EXPA2_07_PIN PA4
|
||||
#define EXPA2_08_PIN PC10
|
||||
#define EXPA2_09_PIN PA5
|
||||
#define EXPA2_10_PIN PA6
|
||||
#define EXP2_03_PIN -1
|
||||
#define EXP2_04_PIN PC3
|
||||
#define EXP2_05_PIN PA7
|
||||
#define EXP2_06_PIN PC11
|
||||
#define EXP2_07_PIN PA4
|
||||
#define EXP2_08_PIN PC10
|
||||
#define EXP2_09_PIN PA5
|
||||
#define EXP2_10_PIN PA6
|
||||
|
||||
#if HAS_WIRED_LCD
|
||||
|
||||
#define BEEPER_PIN EXPA1_10_PIN
|
||||
#define BTN_ENC EXPA1_09_PIN
|
||||
#define BEEPER_PIN EXP1_10_PIN
|
||||
#define BTN_ENC EXP1_09_PIN
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
|
||||
#define LCD_PINS_RS EXPA1_07_PIN
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
|
||||
#define BTN_EN1 EXPA2_08_PIN
|
||||
#define BTN_EN2 EXPA2_06_PIN
|
||||
#define BTN_EN1 EXP2_08_PIN
|
||||
#define BTN_EN2 EXP2_06_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_08_PIN
|
||||
#define LCD_PINS_D4 EXPA1_06_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
|
||||
// CR10_STOCKDISPLAY default timing is too fast
|
||||
#undef BOARD_ST7920_DELAY_1
|
||||
@@ -201,45 +201,45 @@
|
||||
|
||||
#elif ENABLED(MKS_MINI_12864)
|
||||
|
||||
#define DOGLCD_A0 EXPA1_04_PIN
|
||||
#define DOGLCD_CS EXPA1_05_PIN
|
||||
#define BTN_EN1 EXPA2_08_PIN
|
||||
#define BTN_EN2 EXPA2_06_PIN
|
||||
#define DOGLCD_A0 EXP1_04_PIN
|
||||
#define DOGLCD_CS EXP1_05_PIN
|
||||
#define BTN_EN1 EXP2_08_PIN
|
||||
#define BTN_EN2 EXP2_06_PIN
|
||||
|
||||
#else
|
||||
|
||||
#define LCD_PINS_RS EXPA1_07_PIN
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
|
||||
#define BTN_EN1 EXPA2_06_PIN
|
||||
#define BTN_EN2 EXPA2_08_PIN
|
||||
#define BTN_EN1 EXP2_06_PIN
|
||||
#define BTN_EN2 EXP2_08_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_08_PIN
|
||||
#define LCD_PINS_D4 EXPA1_06_PIN
|
||||
#define LCD_PINS_ENABLE EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#define DOGLCD_CS EXPA1_08_PIN
|
||||
#define DOGLCD_A0 EXPA1_07_PIN
|
||||
#define DOGLCD_CS EXP1_08_PIN
|
||||
#define DOGLCD_A0 EXP1_07_PIN
|
||||
//#define LCD_BACKLIGHT_PIN -1
|
||||
#define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
#define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
||||
#ifndef RGB_LED_R_PIN
|
||||
#define RGB_LED_R_PIN EXPA1_05_PIN
|
||||
#define RGB_LED_R_PIN EXP1_05_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_G_PIN
|
||||
#define RGB_LED_G_PIN EXPA1_04_PIN
|
||||
#define RGB_LED_G_PIN EXP1_04_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_B_PIN
|
||||
#define RGB_LED_B_PIN EXPA1_03_PIN
|
||||
#define RGB_LED_B_PIN EXP1_03_PIN
|
||||
#endif
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
#define NEOPIXEL_PIN EXPA1_05_PIN
|
||||
#define NEOPIXEL_PIN EXP1_05_PIN
|
||||
#endif
|
||||
#endif // !FYSETC_MINI_12864
|
||||
|
||||
#if IS_ULTIPANEL
|
||||
#define LCD_PINS_D5 EXPA1_05_PIN
|
||||
#define LCD_PINS_D6 EXPA1_04_PIN
|
||||
#define LCD_PINS_D7 EXPA1_03_PIN
|
||||
#define LCD_PINS_D5 EXP1_05_PIN
|
||||
#define LCD_PINS_D6 EXP1_04_PIN
|
||||
#define LCD_PINS_D7 EXP1_03_PIN
|
||||
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
|
||||
@@ -265,7 +265,7 @@
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOUCH_UI_FTDI_EVE)
|
||||
#define BEEPER_PIN EXPA1_10_PIN
|
||||
#define CLCD_MOD_RESET EXPA2_08_PIN
|
||||
#define CLCD_SPI_CS EXPA2_06_PIN
|
||||
#define BEEPER_PIN EXP1_10_PIN
|
||||
#define CLCD_MOD_RESET EXP2_08_PIN
|
||||
#define CLCD_SPI_CS EXP2_06_PIN
|
||||
#endif
|
||||
|
||||
Executable
+81
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# build_all_examples base_branch [resume_point]
|
||||
#
|
||||
|
||||
GITREPO=https://github.com/MarlinFirmware/Configurations.git
|
||||
STAT_FILE=./.pio/.buildall
|
||||
|
||||
# Check dependencies
|
||||
which curl 1>/dev/null 2>&1 || { echo "curl not found! Please install it."; exit ; }
|
||||
which git 1>/dev/null 2>&1 || { echo "git not found! Please install it."; exit ; }
|
||||
|
||||
SED=$(command -v gsed 2>/dev/null || command -v sed 2>/dev/null)
|
||||
[[ -z "$SED" ]] && { echo "No sed found, please install sed" ; exit 1 ; }
|
||||
|
||||
SELF=`basename "$0"`
|
||||
HERE=`dirname "$0"`
|
||||
|
||||
# Check if called in the right location
|
||||
[[ -e "Marlin/src" ]] || { echo -e "This script must be called from a Marlin working copy with:\n ./buildroot/bin/$SELF $1" ; exit ; }
|
||||
|
||||
if [[ $# -lt 1 || $# -gt 2 ]]; then
|
||||
echo "Usage: $SELF base_branch [resume_point]
|
||||
base_branch - Configuration branch to download and build
|
||||
resume_point - Configuration path to start from"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "This script downloads all Configurations and builds Marlin with each one."
|
||||
echo "On failure the last-built configs will be left in your working copy."
|
||||
echo "Restore your configs with 'git checkout -f' or 'git reset --hard HEAD'."
|
||||
|
||||
# If -c is given start from the last attempted build
|
||||
if [[ $1 == '-c' ]]; then
|
||||
if [[ -f "$STAT_FILE" ]]; then
|
||||
read BRANCH FIRST_CONF <"$STAT_FILE"
|
||||
else
|
||||
echo "Nothing to continue"
|
||||
exit
|
||||
fi
|
||||
else
|
||||
BRANCH=${1:-"import-2.0.x"}
|
||||
FIRST_CONF=$2
|
||||
fi
|
||||
|
||||
# Check if the current repository has unmerged changes
|
||||
if [[ -z "$FIRST_CONF" ]]; then
|
||||
git diff --quiet || { echo "The working copy is modified. Commit or stash changes before proceeding."; exit ; }
|
||||
else
|
||||
echo "Resuming from $FIRST_CONF"
|
||||
fi
|
||||
|
||||
# Create a temporary folder inside .pio
|
||||
TMP=./.pio/build-$BRANCH
|
||||
[[ -d "$TMP" ]] || mkdir -p $TMP
|
||||
|
||||
# Download Configurations into the temporary folder
|
||||
if [[ ! -e "$TMP/README.md" ]]; then
|
||||
echo "Downloading Configurations from GitHub into $TMP"
|
||||
git clone --depth=1 --single-branch --branch "$BRANCH" $GITREPO "$TMP" || { echo "Failed to clone the configuration repository"; exit ; }
|
||||
else
|
||||
echo "Using previously downloaded Configurations at $TMP"
|
||||
fi
|
||||
|
||||
echo -e "Start building now...\n====================="
|
||||
shopt -s nullglob
|
||||
IFS='
|
||||
'
|
||||
CONF_TREE=$( ls -d "$TMP"/config/examples/*/ "$TMP"/config/examples/*/*/ "$TMP"/config/examples/*/*/*/ "$TMP"/config/examples/*/*/*/*/ | grep -vE ".+\.(\w+)$" )
|
||||
for CONF in $CONF_TREE ; do
|
||||
DIR=$( echo $CONF | sed "s|$TMP/config/examples/||" )
|
||||
[[ ! -z $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue
|
||||
unset FIRST_CONF
|
||||
compgen -G "${CONF}Con*.h" > /dev/null || continue
|
||||
echo -e "$BRANCH\n$DIR" >"$STAT_FILE"
|
||||
"$HERE/build_example" "internal" "$TMP" "$DIR" || { echo "Failed to build $DIR"; exit ; }
|
||||
done
|
||||
|
||||
# Delete the temp folder and build state
|
||||
[[ -e "$TMP/config/examples" ]] && rm -rf "$TMP"
|
||||
rm "$STAT_FILE"
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# build_example
|
||||
#
|
||||
# Usage: build_example internal config-home config-folder
|
||||
#
|
||||
|
||||
# Require 'internal' as the first argument
|
||||
[[ "$1" == "internal" ]] || { echo "Don't call this script directly, use build_all_examples instead." ; exit 1 ; }
|
||||
|
||||
echo "Testing $3:"
|
||||
|
||||
SUB=$2/config/examples/$3
|
||||
[[ -d "$SUB" ]] || { echo "$SUB is not a good path" ; exit 1 ; }
|
||||
|
||||
compgen -G "${SUB}Con*.h" > /dev/null || { echo "No configuration files found in $SUB" ; exit 1 ; }
|
||||
|
||||
echo "Getting configuration files from $SUB"
|
||||
cp "$2/config/default"/*.h Marlin/
|
||||
cp "$SUB"/Configuration.h Marlin/ 2>/dev/null
|
||||
cp "$SUB"/Configuration_adv.h Marlin/ 2>/dev/null
|
||||
cp "$SUB"/_Bootscreen.h Marlin/ 2>/dev/null
|
||||
cp "$SUB"/_Statusscreen.h Marlin/ 2>/dev/null
|
||||
|
||||
echo "Building the firmware now..."
|
||||
HERE=`dirname "$0"`
|
||||
$HERE/mftest -a || { echo "Failed"; exit 1; }
|
||||
|
||||
echo "Success"
|
||||
@@ -6,7 +6,6 @@
|
||||
# mftest [name] [index] [-y] Set config options and optionally build a test
|
||||
#
|
||||
|
||||
MFINFO=$(mfinfo) || exit 1
|
||||
[[ -d Marlin/src ]] || { echo "Please 'cd' to the Marlin repo root." ; exit 1 ; }
|
||||
|
||||
perror() { echo -e "$0: \033[0;31m$1 -- $2\033[0m" ; }
|
||||
@@ -37,7 +36,7 @@ env shortcuts: tree due esp lin lpc|lpc8 lpc9 m128 m256|mega stm|f1 f4 f7 s6 tee
|
||||
|
||||
TESTPATH=buildroot/tests
|
||||
|
||||
STATE_FILE=$( echo ./.pio/.mftestrc )
|
||||
STATE_FILE="./.pio/.mftestrc"
|
||||
SED=$(which gsed || which sed)
|
||||
|
||||
shopt -s extglob nocasematch
|
||||
@@ -111,27 +110,28 @@ if ((REBUILD)); then
|
||||
fi
|
||||
|
||||
case $TESTENV in
|
||||
tree) pio run -d . -e include_tree ; exit 1 ;;
|
||||
due) TESTENV='DUE' ;;
|
||||
esp) TESTENV='esp32' ;;
|
||||
lin*) TESTENV='linux_native' ;;
|
||||
lpc?(8)) TESTENV='LPC1768' ;;
|
||||
lpc9) TESTENV='LPC1769' ;;
|
||||
m128) TESTENV='mega1280' ;;
|
||||
m256) TESTENV='mega2560' ;;
|
||||
mega) TESTENV='mega2560' ;;
|
||||
stm) TESTENV='STM32F103RE' ;;
|
||||
f1) TESTENV='STM32F103RE' ;;
|
||||
f4) TESTENV='STM32F4' ;;
|
||||
f7) TESTENV='STM32F7' ;;
|
||||
s6) TESTENV='FYSETC_S6' ;;
|
||||
teensy) TESTENV='teensy31' ;;
|
||||
t31) TESTENV='teensy31' ;;
|
||||
t32) TESTENV='teensy31' ;;
|
||||
t35) TESTENV='teensy35' ;;
|
||||
t36) TESTENV='teensy35' ;;
|
||||
t40) TESTENV='teensy41' ;;
|
||||
t41) TESTENV='teensy41' ;;
|
||||
tree) pio run -d . -e include_tree ; exit 1 ;;
|
||||
due) TESTENV='DUE' ;;
|
||||
esp) TESTENV='esp32' ;;
|
||||
lin*) TESTENV='linux_native' ;;
|
||||
lp8|lpc8) TESTENV='LPC1768' ;;
|
||||
lp9|lpc9) TESTENV='LPC1769' ;;
|
||||
m128) TESTENV='mega1280' ;;
|
||||
m256) TESTENV='mega2560' ;;
|
||||
mega) TESTENV='mega2560' ;;
|
||||
stm) TESTENV='STM32F103RE' ;;
|
||||
f1) TESTENV='STM32F103RE' ;;
|
||||
f4) TESTENV='STM32F4' ;;
|
||||
f7) TESTENV='STM32F7' ;;
|
||||
s6) TESTENV='FYSETC_S6' ;;
|
||||
teensy) TESTENV='teensy31' ;;
|
||||
t31) TESTENV='teensy31' ;;
|
||||
t32) TESTENV='teensy31' ;;
|
||||
t35) TESTENV='teensy35' ;;
|
||||
t36) TESTENV='teensy35' ;;
|
||||
t40) TESTENV='teensy41' ;;
|
||||
t41) TESTENV='teensy41' ;;
|
||||
[1-9][1-9]|[1-9]) TESTNUM=$TESTENV ; TESTENV=- ;;
|
||||
esac
|
||||
|
||||
if ((AUTO_BUILD)); then
|
||||
@@ -217,8 +217,14 @@ if [[ $TESTENV == '-' ]]; then
|
||||
echo
|
||||
for (( ; ; ))
|
||||
do
|
||||
read -p "Select a test to apply (1-$IND) : " NAMEIND
|
||||
[[ -z "$NAMEIND" ]] && { errout "(canceled)" ; exit 1 ; }
|
||||
if [[ $TESTNUM -gt 0 ]]; then
|
||||
NAMEIND=$TESTNUM
|
||||
else
|
||||
read -p "Select a test to apply (1-$IND) : " NAMEIND
|
||||
fi
|
||||
[[ -z $NAMEIND ]] && { errout "(canceled)" ; exit 1 ; }
|
||||
TESTENV=${NAMES[$NAMEIND-1]}
|
||||
[[ $TESTNUM -gt 0 ]] && { echo "Preselected test $TESTNUM ... ($TESTENV)" ; TESTNUM='' ; }
|
||||
[[ $NAMEIND =~ $ISNUM ]] && ((NAMEIND >= 1 && NAMEIND <= IND)) && { TESTENV=${NAMES[$NAMEIND-1]} ; echo ; break ; }
|
||||
errout "Invalid selection."
|
||||
done
|
||||
@@ -1,3 +1,6 @@
|
||||
#
|
||||
# Generate a generic variant
|
||||
#
|
||||
import os,shutil
|
||||
from SCons.Script import DefaultEnvironment
|
||||
from platformio import util
|
||||
|
||||
+3
-4
@@ -1,11 +1,10 @@
|
||||
# Serial port architecture in Marlin
|
||||
|
||||
Marlin is targeting a pletora of different CPU architecture and platforms. Each of these platforms has its own serial interface.
|
||||
Marlin is targeting a plethora of different CPU architecture and platforms. Each of these platforms has its own serial interface.
|
||||
While many provide a Arduino-like Serial class, it's not all of them, and the differences in the existing API create a very complex brain teaser for writing code that works more or less on each platform.
|
||||
|
||||
Moreover, many platform have intrinsic needs about serial port (like forwarding the output on multiple serial port, providing a *serial-like* telnet server, mixing USB-based serial port with SD card emulation) that are difficult to handle cleanly in the other platform serial logic.
|
||||
|
||||
|
||||
Starting with version `2.0.9`, Marlin provides a common interface for its serial needs.
|
||||
|
||||
## Common interface
|
||||
@@ -16,7 +15,7 @@ Any implementation will need to follow this interface for being used transparent
|
||||
The implementation was written to prioritize performance over abstraction, so the base interface is not using virtual inheritance to avoid the cost of virtual dispatching while calling methods.
|
||||
Instead, the Curiously Recurring Template Pattern (**CRTP**) is used so that, upon compilation, the interface abstraction does not incur a performance cost.
|
||||
|
||||
Because some platform do not follow the same interface, the missing method in the actual low-level implementation are detected via SFINAE and a wrapper is generated when such method are missing. See `CALL_IF_EXISTS` macro in `Marlin/src/core/macros.h` for the documentation of this technic.
|
||||
Because some platform do not follow the same interface, the missing method in the actual low-level implementation are detected via SFINAE and a wrapper is generated when such method are missing. See the `CALL_IF_EXISTS` macro in `Marlin/src/core/macros.h` for documentation of this technique.
|
||||
|
||||
## Composing the desired feature
|
||||
The different specificities for each architecture are provided by composing the serial type based on desired functionality.
|
||||
@@ -32,7 +31,7 @@ Since all the types above are using CRTP, it's possible to combine them to get t
|
||||
This is easily done via type definition of the feature.
|
||||
|
||||
For example, to present a serial interface that's outputting to 2 serial port, the first one being hooked at runtime and the second one connected to a runtime switchable telnet client, you'll declare the type to use as:
|
||||
```
|
||||
```cpp
|
||||
typedef MultiSerial< RuntimeSerial<Serial>, ConditionalSerial<TelnetClient> > Serial0Type;
|
||||
```
|
||||
|
||||
|
||||
+6
-5
@@ -511,13 +511,14 @@ extra_scripts =
|
||||
pre:buildroot/share/PlatformIO/scripts/common-dependencies.py
|
||||
pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
|
||||
post:buildroot/share/PlatformIO/scripts/common-dependencies-post.py
|
||||
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-constants
|
||||
build_flags = -fmax-errors=5 -g3 -D__MARLIN_FIRMWARE__ -fmerge-constants
|
||||
lib_deps =
|
||||
|
||||
#
|
||||
# Feature Dependencies
|
||||
#
|
||||
[features]
|
||||
YHCB2004 = red-scorp/LiquidCrystal_AIP31068@^1.0.4, red-scorp/SoftSPIB@^1.1.1
|
||||
HAS_TFT_LVGL_UI = lvgl=https://github.com/makerbase-mks/LVGL-6.1.1-MKS/archive/master.zip
|
||||
src_filter=+<src/lcd/extui/lib/mks_ui>
|
||||
extra_scripts=download_mks_assets.py
|
||||
@@ -3004,7 +3005,7 @@ board = nxp_lpc1769
|
||||
# HAL/STM32 Base Environment values
|
||||
#
|
||||
[common_stm32]
|
||||
platform = ststm32@~10.0
|
||||
platform = ststm32@~11.0
|
||||
build_flags = ${common.build_flags}
|
||||
-IMarlin/src/HAL/STM32 -std=gnu++14
|
||||
-DUSBCON -DUSBD_USE_CDC
|
||||
@@ -3018,7 +3019,7 @@ src_filter = ${common.default_src_filter} +<src/HAL/STM32>
|
||||
# HAL/STM32F1 Common Environment values
|
||||
#
|
||||
[common_stm32f1]
|
||||
platform = ststm32@~10.0
|
||||
platform = ststm32@~11.0
|
||||
board_build.core = maple
|
||||
build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py
|
||||
${common.build_flags}
|
||||
@@ -3533,7 +3534,7 @@ board_build.core = stm32
|
||||
board_build.variant = MARLIN_F4x7Vx
|
||||
board_build.ldscript = ldscript.ld
|
||||
board_build.firmware = firmware.srec
|
||||
# Just anet_et4_openblt.py generates the file, not stm32_bootloader.py
|
||||
# Just openblt.py (not stm32_bootloader.py) generates the file
|
||||
board_build.encrypt = Yes
|
||||
board_build.offset = 0x10000
|
||||
board_upload.offset_address = 0x08010000
|
||||
@@ -3543,7 +3544,7 @@ upload_protocol = jlink
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
|
||||
buildroot/share/PlatformIO/scripts/stm32_bootloader.py
|
||||
buildroot/share/PlatformIO/scripts/anet_et4_openblt.py
|
||||
buildroot/share/PlatformIO/scripts/openblt.py
|
||||
|
||||
#
|
||||
# BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4)
|
||||
|
||||
Reference in New Issue
Block a user