defaulting to 91 fw
inverting x/y changing hotendfan port
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
*
|
*
|
||||||
* Advanced settings can be found in Configuration_adv.h
|
* Advanced settings can be found in Configuration_adv.h
|
||||||
*/
|
*/
|
||||||
#define CONFIGURATION_H_VERSION 02000902
|
#define CONFIGURATION_H_VERSION 02000901
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//============================= Getting Started =============================
|
//============================= Getting Started =============================
|
||||||
@@ -1234,7 +1234,7 @@
|
|||||||
#define Z_PROBE_OFFSET_RANGE_MAX 30
|
#define Z_PROBE_OFFSET_RANGE_MAX 30
|
||||||
|
|
||||||
// Enable the M48 repeatability test to test probe accuracy
|
// Enable the M48 repeatability test to test probe accuracy
|
||||||
//#define Z_MIN_PROBE_REPEATABILITY_TEST
|
#define Z_MIN_PROBE_REPEATABILITY_TEST
|
||||||
|
|
||||||
// Before deploy/stow pause for user confirmation
|
// Before deploy/stow pause for user confirmation
|
||||||
//#define PAUSE_BEFORE_DEPLOY_STOW
|
//#define PAUSE_BEFORE_DEPLOY_STOW
|
||||||
@@ -1297,8 +1297,8 @@
|
|||||||
|
|
||||||
// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
|
// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
|
||||||
#define INVERT_X_DIR false
|
#define INVERT_X_DIR false
|
||||||
#define INVERT_Y_DIR true
|
#define INVERT_Y_DIR false
|
||||||
#define INVERT_Z_DIR false
|
#define INVERT_Z_DIR true
|
||||||
//#define INVERT_I_DIR false
|
//#define INVERT_I_DIR false
|
||||||
//#define INVERT_J_DIR false
|
//#define INVERT_J_DIR false
|
||||||
//#define INVERT_K_DIR false
|
//#define INVERT_K_DIR false
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
*
|
*
|
||||||
* Basic settings can be found in Configuration.h
|
* Basic settings can be found in Configuration.h
|
||||||
*/
|
*/
|
||||||
#define CONFIGURATION_ADV_H_VERSION 02000902
|
#define CONFIGURATION_ADV_H_VERSION 02000901
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//============================= Thermal Settings ============================
|
//============================= Thermal Settings ============================
|
||||||
@@ -584,7 +584,7 @@
|
|||||||
* Multiple extruders can be assigned to the same pin in which case
|
* Multiple extruders can be assigned to the same pin in which case
|
||||||
* the fan will turn on when any selected extruder is above the threshold.
|
* the fan will turn on when any selected extruder is above the threshold.
|
||||||
*/
|
*/
|
||||||
#define E0_AUTO_FAN_PIN -1
|
#define E0_AUTO_FAN_PIN PB4
|
||||||
#define E1_AUTO_FAN_PIN -1
|
#define E1_AUTO_FAN_PIN -1
|
||||||
#define E2_AUTO_FAN_PIN -1
|
#define E2_AUTO_FAN_PIN -1
|
||||||
#define E3_AUTO_FAN_PIN -1
|
#define E3_AUTO_FAN_PIN -1
|
||||||
@@ -876,7 +876,7 @@
|
|||||||
// Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
|
// Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
|
||||||
// If not defined, probe limits will be used.
|
// If not defined, probe limits will be used.
|
||||||
// Override with 'M422 S<index> X<pos> Y<pos>'
|
// Override with 'M422 S<index> X<pos> Y<pos>'
|
||||||
//#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }
|
#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Orientation for the automatically-calculated probe positions.
|
* Orientation for the automatically-calculated probe positions.
|
||||||
@@ -1449,7 +1449,7 @@
|
|||||||
//#define UTF_FILENAME_SUPPORT
|
//#define UTF_FILENAME_SUPPORT
|
||||||
|
|
||||||
// This allows hosts to request long names for files and folders with M33
|
// This allows hosts to request long names for files and folders with M33
|
||||||
//#define LONG_FILENAME_HOST_SUPPORT
|
#define LONG_FILENAME_HOST_SUPPORT
|
||||||
|
|
||||||
// Enable this option to scroll long filenames in the SD card menu
|
// Enable this option to scroll long filenames in the SD card menu
|
||||||
//#define SCROLL_LONG_FILENAMES
|
//#define SCROLL_LONG_FILENAMES
|
||||||
@@ -1474,7 +1474,7 @@
|
|||||||
/**
|
/**
|
||||||
* Auto-report SdCard status with M27 S<seconds>
|
* Auto-report SdCard status with M27 S<seconds>
|
||||||
*/
|
*/
|
||||||
//#define AUTO_REPORT_SD_STATUS
|
#define AUTO_REPORT_SD_STATUS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Support for USB thumb drives using an Arduino USB Host Shield or
|
* Support for USB thumb drives using an Arduino USB Host Shield or
|
||||||
@@ -1858,7 +1858,7 @@
|
|||||||
*
|
*
|
||||||
* Warning: Does not respect endstops!
|
* Warning: Does not respect endstops!
|
||||||
*/
|
*/
|
||||||
//#define BABYSTEPPING
|
#define BABYSTEPPING
|
||||||
#if ENABLED(BABYSTEPPING)
|
#if ENABLED(BABYSTEPPING)
|
||||||
//#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
|
//#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
|
||||||
//#define BABYSTEP_WITHOUT_HOMING
|
//#define BABYSTEP_WITHOUT_HOMING
|
||||||
@@ -2206,7 +2206,7 @@
|
|||||||
* Currently handles M108, M112, M410, M876
|
* Currently handles M108, M112, M410, M876
|
||||||
* NOTE: Not yet implemented for all platforms.
|
* NOTE: Not yet implemented for all platforms.
|
||||||
*/
|
*/
|
||||||
//#define EMERGENCY_PARSER
|
#define EMERGENCY_PARSER
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Realtime Reporting (requires EMERGENCY_PARSER)
|
* Realtime Reporting (requires EMERGENCY_PARSER)
|
||||||
@@ -2242,7 +2242,7 @@
|
|||||||
#define SERIAL_OVERRUN_PROTECTION
|
#define SERIAL_OVERRUN_PROTECTION
|
||||||
|
|
||||||
// For serial echo, the number of digits after the decimal point
|
// For serial echo, the number of digits after the decimal point
|
||||||
//#define SERIAL_FLOAT_PRECISION 4
|
#define SERIAL_FLOAT_PRECISION 4
|
||||||
|
|
||||||
// @section extras
|
// @section extras
|
||||||
|
|
||||||
@@ -2424,7 +2424,7 @@
|
|||||||
//#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change.
|
//#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change.
|
||||||
//#define HOME_BEFORE_FILAMENT_CHANGE // If needed, home before parking for filament change
|
//#define HOME_BEFORE_FILAMENT_CHANGE // If needed, home before parking for filament change
|
||||||
|
|
||||||
//#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu.
|
#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu.
|
||||||
//#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302)
|
//#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2774,7 +2774,7 @@
|
|||||||
* The default SW SPI pins are defined the respective pins files,
|
* The default SW SPI pins are defined the respective pins files,
|
||||||
* but you can override or define them here.
|
* but you can override or define them here.
|
||||||
*/
|
*/
|
||||||
//#define TMC_USE_SW_SPI
|
#define TMC_USE_SW_SPI
|
||||||
//#define TMC_SW_MOSI -1
|
//#define TMC_SW_MOSI -1
|
||||||
//#define TMC_SW_MISO -1
|
//#define TMC_SW_MISO -1
|
||||||
//#define TMC_SW_SCK -1
|
//#define TMC_SW_SCK -1
|
||||||
@@ -3589,7 +3589,7 @@
|
|||||||
/**
|
/**
|
||||||
* Auto-report position with M154 S<seconds>
|
* Auto-report position with M154 S<seconds>
|
||||||
*/
|
*/
|
||||||
//#define AUTO_REPORT_POSITION
|
#define AUTO_REPORT_POSITION
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include capabilities in M115 output
|
* Include capabilities in M115 output
|
||||||
@@ -3644,11 +3644,11 @@
|
|||||||
//#define NO_WORKSPACE_OFFSETS
|
//#define NO_WORKSPACE_OFFSETS
|
||||||
|
|
||||||
// Extra options for the M114 "Current Position" report
|
// Extra options for the M114 "Current Position" report
|
||||||
//#define M114_DETAIL // Use 'M114` for details to check planner calculations
|
#define M114_DETAIL // Use 'M114` for details to check planner calculations
|
||||||
//#define M114_REALTIME // Real current position based on forward kinematics
|
//#define M114_REALTIME // Real current position based on forward kinematics
|
||||||
//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.
|
//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.
|
||||||
|
|
||||||
//#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others)
|
#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the number of proportional font spaces required to fill up a typical character space.
|
* Set the number of proportional font spaces required to fill up a typical character space.
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
/**
|
/**
|
||||||
* Marlin release version identifier
|
* Marlin release version identifier
|
||||||
*/
|
*/
|
||||||
//#define SHORT_BUILD_VERSION "bugfix-2.0.x"
|
//#define SHORT_BUILD_VERSION "2.0.9.1"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verbose version identifier which should contain a reference to the location
|
* Verbose version identifier which should contain a reference to the location
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
* here we define this default string as the date where the latest release
|
* here we define this default string as the date where the latest release
|
||||||
* version was tagged.
|
* version was tagged.
|
||||||
*/
|
*/
|
||||||
//#define STRING_DISTRIBUTION_DATE "2021-08-12"
|
//#define STRING_DISTRIBUTION_DATE "2021-06-27"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||||
|
|||||||
@@ -39,19 +39,6 @@
|
|||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
|
|
||||||
//
|
|
||||||
// Default graphical display delays
|
|
||||||
//
|
|
||||||
#if F_CPU >= 20000000
|
|
||||||
#define CPU_ST7920_DELAY_1 150
|
|
||||||
#define CPU_ST7920_DELAY_2 0
|
|
||||||
#define CPU_ST7920_DELAY_3 150
|
|
||||||
#elif F_CPU == 16000000
|
|
||||||
#define CPU_ST7920_DELAY_1 125
|
|
||||||
#define CPU_ST7920_DELAY_2 0
|
|
||||||
#define CPU_ST7920_DELAY_3 188
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef pgm_read_ptr
|
#ifndef pgm_read_ptr
|
||||||
// Compatibility for avr-libc 1.8.0-4.1 included with Ubuntu for
|
// Compatibility for avr-libc 1.8.0-4.1 included with Ubuntu for
|
||||||
// Windows Subsystem for Linux on Windows 10 as of 10/18/2019
|
// Windows Subsystem for Linux on Windows 10 as of 10/18/2019
|
||||||
|
|||||||
@@ -267,11 +267,11 @@ uint16_t set_pwm_frequency_hz(const_float_t hz, const float dca, const float dcb
|
|||||||
SET_WGM(5, FAST_PWM_ICRn); // Fast PWM with ICR5 as TOP
|
SET_WGM(5, FAST_PWM_ICRn); // Fast PWM with ICR5 as TOP
|
||||||
|
|
||||||
//SERIAL_ECHOLNPGM("Timer 5 Settings:");
|
//SERIAL_ECHOLNPGM("Timer 5 Settings:");
|
||||||
//SERIAL_ECHOLNPGM(" Prescaler=", prescaler);
|
//SERIAL_ECHOLNPAIR(" Prescaler=", prescaler);
|
||||||
//SERIAL_ECHOLNPGM(" TOP=", ICR5);
|
//SERIAL_ECHOLNPAIR(" TOP=", ICR5);
|
||||||
//SERIAL_ECHOLNPGM(" OCR5A=", OCR5A);
|
//SERIAL_ECHOLNPAIR(" OCR5A=", OCR5A);
|
||||||
//SERIAL_ECHOLNPGM(" OCR5B=", OCR5B);
|
//SERIAL_ECHOLNPAIR(" OCR5B=", OCR5B);
|
||||||
//SERIAL_ECHOLNPGM(" OCR5C=", OCR5C);
|
//SERIAL_ECHOLNPAIR(" OCR5C=", OCR5C);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Restore the default for Timer 5
|
// Restore the default for Timer 5
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
/**
|
/**
|
||||||
* Sanity checks for Spindle / Laser PWM
|
* Sanity checks for Spindle / Laser PWM
|
||||||
*/
|
*/
|
||||||
#if ENABLED(SPINDLE_LASER_USE_PWM)
|
#if ENABLED(SPINDLE_LASER_PWM)
|
||||||
#include "../ServoTimers.h" // Needed to check timer availability (_useTimer3)
|
#include "../ServoTimers.h" // Needed to check timer availability (_useTimer3)
|
||||||
#if SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13)
|
#if SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13)
|
||||||
#error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt."
|
#error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt."
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
#error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system."
|
#error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system."
|
||||||
#endif
|
#endif
|
||||||
#elif defined(SPINDLE_LASER_FREQUENCY)
|
#elif defined(SPINDLE_LASER_FREQUENCY)
|
||||||
#error "SPINDLE_LASER_FREQUENCY requires SPINDLE_LASER_USE_PWM."
|
#error "SPINDLE_LASER_FREQUENCY requires SPINDLE_LASER_PWM."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -238,9 +235,9 @@ static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin");
|
|||||||
|
|
||||||
inline void com_print(const uint8_t N, const uint8_t Z) {
|
inline void com_print(const uint8_t N, const uint8_t Z) {
|
||||||
const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
|
const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
|
||||||
SERIAL_ECHOPGM(" COM", AS_DIGIT(N));
|
SERIAL_ECHOPAIR(" COM", AS_CHAR('0' + N));
|
||||||
SERIAL_CHAR(Z);
|
SERIAL_CHAR(Z);
|
||||||
SERIAL_ECHOPGM(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03));
|
SERIAL_ECHOPAIR(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03));
|
||||||
}
|
}
|
||||||
|
|
||||||
void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - WGM bit layout
|
void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - WGM bit layout
|
||||||
@@ -250,7 +247,7 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
|
|||||||
uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1))));
|
uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1))));
|
||||||
if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1);
|
if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1);
|
||||||
|
|
||||||
SERIAL_ECHOPGM(" TIMER", AS_DIGIT(T));
|
SERIAL_ECHOPAIR(" TIMER", AS_CHAR(T + '0'));
|
||||||
SERIAL_CHAR(L);
|
SERIAL_CHAR(L);
|
||||||
SERIAL_ECHO_SP(3);
|
SERIAL_ECHO_SP(3);
|
||||||
|
|
||||||
@@ -262,14 +259,14 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
|
|||||||
const uint16_t *OCRVAL16 = (uint16_t*)OCR_VAL(T, L - 'A');
|
const uint16_t *OCRVAL16 = (uint16_t*)OCR_VAL(T, L - 'A');
|
||||||
PWM_PRINT(*OCRVAL16);
|
PWM_PRINT(*OCRVAL16);
|
||||||
}
|
}
|
||||||
SERIAL_ECHOPGM(" WGM: ", WGM);
|
SERIAL_ECHOPAIR(" WGM: ", WGM);
|
||||||
com_print(T,L);
|
com_print(T,L);
|
||||||
SERIAL_ECHOPGM(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) ));
|
SERIAL_ECHOPAIR(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) ));
|
||||||
SERIAL_ECHOPGM(" TCCR", AS_DIGIT(T), "A: ", *TCCRA);
|
SERIAL_ECHOPAIR(" TCCR", AS_CHAR(T + '0'), "A: ", *TCCRA);
|
||||||
SERIAL_ECHOPGM(" TCCR", AS_DIGIT(T), "B: ", *TCCRB);
|
SERIAL_ECHOPAIR(" TCCR", AS_CHAR(T + '0'), "B: ", *TCCRB);
|
||||||
|
|
||||||
const uint8_t *TMSK = (uint8_t*)TIMSK(T);
|
const uint8_t *TMSK = (uint8_t*)TIMSK(T);
|
||||||
SERIAL_ECHOPGM(" TIMSK", AS_DIGIT(T), ": ", *TMSK);
|
SERIAL_ECHOPAIR(" TIMSK", AS_CHAR(T + '0'), ": ", *TMSK);
|
||||||
|
|
||||||
const uint8_t OCIE = L - 'A' + 1;
|
const uint8_t OCIE = L - 'A' + 1;
|
||||||
if (N == 3) { if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter(); }
|
if (N == 3) { if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter(); }
|
||||||
@@ -396,4 +393,3 @@ static void pwm_details(uint8_t pin) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
|||||||
@@ -594,14 +594,18 @@
|
|||||||
SPI_Configure(SPI0, ID_SPI0, SPI_MR_MSTR | SPI_MR_MODFDIS | SPI_MR_PS);
|
SPI_Configure(SPI0, ID_SPI0, SPI_MR_MSTR | SPI_MR_MODFDIS | SPI_MR_PS);
|
||||||
SPI_Enable(SPI0);
|
SPI_Enable(SPI0);
|
||||||
|
|
||||||
SET_OUTPUT(DAC0_SYNC_PIN);
|
SET_OUTPUT(DAC0_SYNC);
|
||||||
#if HAS_MULTI_EXTRUDER
|
#if HAS_MULTI_EXTRUDER
|
||||||
OUT_WRITE(DAC1_SYNC_PIN, HIGH);
|
SET_OUTPUT(DAC1_SYNC);
|
||||||
|
WRITE(DAC1_SYNC, HIGH);
|
||||||
#endif
|
#endif
|
||||||
WRITE(DAC0_SYNC_PIN, HIGH);
|
SET_OUTPUT(SPI_EEPROM1_CS);
|
||||||
OUT_WRITE(SPI_EEPROM1_CS_PIN, HIGH);
|
SET_OUTPUT(SPI_EEPROM2_CS);
|
||||||
OUT_WRITE(SPI_EEPROM2_CS_PIN, HIGH);
|
SET_OUTPUT(SPI_FLASH_CS);
|
||||||
OUT_WRITE(SPI_FLASH_CS_PIN, HIGH);
|
WRITE(DAC0_SYNC, HIGH);
|
||||||
|
WRITE(SPI_EEPROM1_CS, HIGH);
|
||||||
|
WRITE(SPI_EEPROM2_CS, HIGH);
|
||||||
|
WRITE(SPI_FLASH_CS, HIGH);
|
||||||
WRITE(SD_SS_PIN, HIGH);
|
WRITE(SD_SS_PIN, HIGH);
|
||||||
|
|
||||||
OUT_WRITE(SDSS, LOW);
|
OUT_WRITE(SDSS, LOW);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Based on u8g_com_msp430_hw_spi.c
|
* Based on u8g_com_msp430_hw_spi.c
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -200,9 +200,9 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
|||||||
pageContents[i] = (((uint32_t*)data)[i]) | (~(pageContents[i] ^ ((uint32_t*)data)[i]));
|
pageContents[i] = (((uint32_t*)data)[i]) | (~(pageContents[i] ^ ((uint32_t*)data)[i]));
|
||||||
|
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM PageWrite ", page);
|
DEBUG_ECHOLNPAIR("EEPROM PageWrite ", page);
|
||||||
DEBUG_ECHOLNPGM(" in FLASH address ", (uint32_t)addrflash);
|
DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
|
||||||
DEBUG_ECHOLNPGM(" base address ", (uint32_t)getFlashStorage(0));
|
DEBUG_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0));
|
||||||
DEBUG_FLUSH();
|
DEBUG_FLUSH();
|
||||||
|
|
||||||
// Get the page relative to the start of the EFC controller, and the EFC controller to use
|
// Get the page relative to the start of the EFC controller, and the EFC controller to use
|
||||||
@@ -246,7 +246,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
|||||||
__enable_irq();
|
__enable_irq();
|
||||||
|
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM Unlock failure for page ", page);
|
DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ", page);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
|||||||
__enable_irq();
|
__enable_irq();
|
||||||
|
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM Write failure for page ", page);
|
DEBUG_ECHOLNPAIR("EEPROM Write failure for page ", page);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -287,7 +287,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
|||||||
|
|
||||||
#ifdef EE_EMU_DEBUG
|
#ifdef EE_EMU_DEBUG
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM Verify Write failure for page ", page);
|
DEBUG_ECHOLNPAIR("EEPROM Verify Write failure for page ", page);
|
||||||
|
|
||||||
ee_Dump( page, (uint32_t *)addrflash);
|
ee_Dump( page, (uint32_t *)addrflash);
|
||||||
ee_Dump(-page, data);
|
ee_Dump(-page, data);
|
||||||
@@ -306,7 +306,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DEBUG_ECHOLNPGM("--> Differing bits: ", count);
|
DEBUG_ECHOLNPAIR("--> Differing bits: ", count);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -326,9 +326,9 @@ static bool ee_PageErase(uint16_t page) {
|
|||||||
uint32_t addrflash = uint32_t(getFlashStorage(page));
|
uint32_t addrflash = uint32_t(getFlashStorage(page));
|
||||||
|
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM PageErase ", page);
|
DEBUG_ECHOLNPAIR("EEPROM PageErase ", page);
|
||||||
DEBUG_ECHOLNPGM(" in FLASH address ", (uint32_t)addrflash);
|
DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
|
||||||
DEBUG_ECHOLNPGM(" base address ", (uint32_t)getFlashStorage(0));
|
DEBUG_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0));
|
||||||
DEBUG_FLUSH();
|
DEBUG_FLUSH();
|
||||||
|
|
||||||
// Get the page relative to the start of the EFC controller, and the EFC controller to use
|
// Get the page relative to the start of the EFC controller, and the EFC controller to use
|
||||||
@@ -371,7 +371,7 @@ static bool ee_PageErase(uint16_t page) {
|
|||||||
__enable_irq();
|
__enable_irq();
|
||||||
|
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM Unlock failure for page ",page);
|
DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ",page);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -395,7 +395,7 @@ static bool ee_PageErase(uint16_t page) {
|
|||||||
__enable_irq();
|
__enable_irq();
|
||||||
|
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM Erase failure for page ",page);
|
DEBUG_ECHOLNPAIR("EEPROM Erase failure for page ",page);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -411,7 +411,7 @@ static bool ee_PageErase(uint16_t page) {
|
|||||||
for (i = 0; i < PageSize >> 2; i++) {
|
for (i = 0; i < PageSize >> 2; i++) {
|
||||||
if (*aligned_src++ != 0xFFFFFFFF) {
|
if (*aligned_src++ != 0xFFFFFFFF) {
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM Verify Erase failure for page ",page);
|
DEBUG_ECHOLNPAIR("EEPROM Verify Erase failure for page ",page);
|
||||||
ee_Dump(page, (uint32_t *)addrflash);
|
ee_Dump(page, (uint32_t *)addrflash);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -922,7 +922,7 @@ static void ee_Init() {
|
|||||||
if (curGroup >= GroupCount) curGroup = 0;
|
if (curGroup >= GroupCount) curGroup = 0;
|
||||||
|
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM Current Group: ",curGroup);
|
DEBUG_ECHOLNPAIR("EEPROM Current Group: ",curGroup);
|
||||||
DEBUG_FLUSH();
|
DEBUG_FLUSH();
|
||||||
|
|
||||||
// Now, validate that all the other group pages are empty
|
// Now, validate that all the other group pages are empty
|
||||||
@@ -932,7 +932,7 @@ static void ee_Init() {
|
|||||||
for (int page = 0; page < PagesPerGroup; page++) {
|
for (int page = 0; page < PagesPerGroup; page++) {
|
||||||
if (!ee_IsPageClean(grp * PagesPerGroup + page)) {
|
if (!ee_IsPageClean(grp * PagesPerGroup + page)) {
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM Page ", page, " not clean on group ", grp);
|
DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp);
|
||||||
DEBUG_FLUSH();
|
DEBUG_FLUSH();
|
||||||
ee_PageErase(grp * PagesPerGroup + page);
|
ee_PageErase(grp * PagesPerGroup + page);
|
||||||
}
|
}
|
||||||
@@ -949,14 +949,14 @@ static void ee_Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM Active page: ", curPage);
|
DEBUG_ECHOLNPAIR("EEPROM Active page: ", curPage);
|
||||||
DEBUG_FLUSH();
|
DEBUG_FLUSH();
|
||||||
|
|
||||||
// Make sure the pages following the first clean one are also clean
|
// Make sure the pages following the first clean one are also clean
|
||||||
for (int page = curPage + 1; page < PagesPerGroup; page++) {
|
for (int page = curPage + 1; page < PagesPerGroup; page++) {
|
||||||
if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) {
|
if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) {
|
||||||
DEBUG_ECHO_START();
|
DEBUG_ECHO_START();
|
||||||
DEBUG_ECHOLNPGM("EEPROM Page ", page, " not clean on active group ", curGroup);
|
DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup);
|
||||||
DEBUG_FLUSH();
|
DEBUG_FLUSH();
|
||||||
ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
|
ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
|
||||||
ee_PageErase(curGroup * PagesPerGroup + page);
|
ee_PageErase(curGroup * PagesPerGroup + page);
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -67,7 +64,6 @@
|
|||||||
#define PRINT_PORT(p)
|
#define PRINT_PORT(p)
|
||||||
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
|
||||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||||
#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
|
#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
|
||||||
#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL ? 1 : 0)
|
#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL ? 1 : 0)
|
||||||
@@ -90,7 +86,7 @@ bool GET_PINMODE(int8_t pin) { // 1: output, 0: input
|
|||||||
void pwm_details(int32_t pin) {
|
void pwm_details(int32_t pin) {
|
||||||
if (pwm_status(pin)) {
|
if (pwm_status(pin)) {
|
||||||
uint32_t chan = g_APinDescription[pin].ulPWMChannel;
|
uint32_t chan = g_APinDescription[pin].ulPWMChannel;
|
||||||
SERIAL_ECHOPGM("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY);
|
SERIAL_ECHOPAIR("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void wifi_init() {
|
|||||||
|
|
||||||
MDNS.addService("http", "tcp", 80);
|
MDNS.addService("http", "tcp", 80);
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Successfully connected to WiFi with SSID '" WIFI_SSID "', hostname: '" WIFI_HOSTNAME "', IP address: ", WiFi.localIP().toString().c_str());
|
SERIAL_ECHOLNPAIR("Successfully connected to WiFi with SSID '" WIFI_SSID "', hostname: '" WIFI_HOSTNAME "', IP address: ", WiFi.localIP().toString().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // WIFISUPPORT
|
#endif // WIFISUPPORT
|
||||||
|
|||||||
@@ -63,9 +63,9 @@ uint8_t _getc();
|
|||||||
extern MSerialT usb_serial;
|
extern MSerialT usb_serial;
|
||||||
#define MYSERIAL1 usb_serial
|
#define MYSERIAL1 usb_serial
|
||||||
|
|
||||||
#define CPU_ST7920_DELAY_1 600
|
#define ST7920_DELAY_1 DELAY_NS(600)
|
||||||
#define CPU_ST7920_DELAY_2 750
|
#define ST7920_DELAY_2 DELAY_NS(750)
|
||||||
#define CPU_ST7920_DELAY_3 750
|
#define ST7920_DELAY_3 DELAY_NS(750)
|
||||||
|
|
||||||
//
|
//
|
||||||
// Interrupts
|
// Interrupts
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Emulating RAMPS
|
// Emulating RAMPS
|
||||||
#if ENABLED(SPINDLE_LASER_USE_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
||||||
#error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
#error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -19,7 +16,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __PLAT_LINUX__
|
#ifdef __PLAT_LINUX__
|
||||||
|
|
||||||
//#define GPIO_LOGGING // Full GPIO and Positional Logging
|
//#define GPIO_LOGGING // Full GPIO and Positional Logging
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -37,7 +34,6 @@
|
|||||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||||
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
|
||||||
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
|
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
|
||||||
|
|
||||||
// active ADC function/mode/code values for PINSEL registers
|
// active ADC function/mode/code values for PINSEL registers
|
||||||
|
|||||||
@@ -50,9 +50,15 @@ extern "C" volatile uint32_t _millis;
|
|||||||
//
|
//
|
||||||
// Default graphical display delays
|
// Default graphical display delays
|
||||||
//
|
//
|
||||||
#define CPU_ST7920_DELAY_1 600
|
#ifndef ST7920_DELAY_1
|
||||||
#define CPU_ST7920_DELAY_2 750
|
#define ST7920_DELAY_1 DELAY_NS(600)
|
||||||
#define CPU_ST7920_DELAY_3 750
|
#endif
|
||||||
|
#ifndef ST7920_DELAY_2
|
||||||
|
#define ST7920_DELAY_2 DELAY_NS(750)
|
||||||
|
#endif
|
||||||
|
#ifndef ST7920_DELAY_3
|
||||||
|
#define ST7920_DELAY_3 DELAY_NS(750)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef ForwardSerial1Class< decltype(UsbSerial) > DefaultSerial1;
|
typedef ForwardSerial1Class< decltype(UsbSerial) > DefaultSerial1;
|
||||||
extern DefaultSerial1 USBSerial;
|
extern DefaultSerial1 USBSerial;
|
||||||
@@ -107,7 +113,7 @@ extern DefaultSerial1 USBSerial;
|
|||||||
#error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
#error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||||
#endif
|
#endif
|
||||||
#if HAS_DGUS_LCD
|
#if HAS_DGUS_LCD
|
||||||
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.available()
|
#define SERIAL_GET_TX_BUFFER_FREE() MSerial0.available()
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -156,17 +162,17 @@ int freeMemory();
|
|||||||
|
|
||||||
using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
|
using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
|
||||||
extern uint32_t HAL_adc_reading;
|
extern uint32_t HAL_adc_reading;
|
||||||
[[gnu::always_inline]] inline void HAL_adc_start_conversion(const pin_t pin) {
|
[[gnu::always_inline]] inline void HAL_start_adc(const pin_t pin) {
|
||||||
HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
|
HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
|
||||||
}
|
}
|
||||||
[[gnu::always_inline]] inline uint16_t HAL_adc_get_result() {
|
[[gnu::always_inline]] inline uint16_t HAL_read_adc() {
|
||||||
return HAL_adc_reading;
|
return HAL_adc_reading;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define HAL_adc_init()
|
#define HAL_adc_init()
|
||||||
#define HAL_ANALOG_SELECT(pin) FilteredADC::enable_channel(pin)
|
#define HAL_ANALOG_SELECT(pin) FilteredADC::enable_channel(pin)
|
||||||
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
#define HAL_START_ADC(pin) HAL_start_adc(pin)
|
||||||
#define HAL_READ_ADC() HAL_adc_get_result()
|
#define HAL_READ_ADC() HAL_read_adc()
|
||||||
#define HAL_ADC_READY() (true)
|
#define HAL_ADC_READY() (true)
|
||||||
|
|
||||||
// Test whether the pin is valid
|
// Test whether the pin is valid
|
||||||
|
|||||||
@@ -46,8 +46,6 @@ public:
|
|||||||
|
|
||||||
void end() {}
|
void end() {}
|
||||||
|
|
||||||
uint8_t availableForWrite(void) { /* flushTX(); */ return TX_BUFFER_SIZE; }
|
|
||||||
|
|
||||||
#if ENABLED(EMERGENCY_PARSER)
|
#if ENABLED(EMERGENCY_PARSER)
|
||||||
bool recv_callback(const char c) override;
|
bool recv_callback(const char c) override;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||||
|
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
|
||||||
|
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,19 +20,12 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of EEPROM settings in SD Card
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef TARGET_LPC1768
|
#ifdef TARGET_LPC1768
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(SDCARD_EEPROM_EMULATION)
|
#if ENABLED(SDCARD_EEPROM_EMULATION)
|
||||||
|
|
||||||
//#define DEBUG_SD_EEPROM_EMULATION
|
|
||||||
|
|
||||||
#include "../shared/eeprom_api.h"
|
#include "../shared/eeprom_api.h"
|
||||||
|
|
||||||
#include <chanfs/diskio.h>
|
#include <chanfs/diskio.h>
|
||||||
@@ -44,11 +38,9 @@ FATFS fat_fs;
|
|||||||
FIL eeprom_file;
|
FIL eeprom_file;
|
||||||
bool eeprom_file_open = false;
|
bool eeprom_file_open = false;
|
||||||
|
|
||||||
#define EEPROM_FILENAME "eeprom.dat"
|
|
||||||
#ifndef MARLIN_EEPROM_SIZE
|
#ifndef MARLIN_EEPROM_SIZE
|
||||||
#define MARLIN_EEPROM_SIZE size_t(0x1000) // 4KiB of Emulated EEPROM
|
#define MARLIN_EEPROM_SIZE size_t(0x1000) // 4KiB of Emulated EEPROM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
|
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
|
||||||
|
|
||||||
bool PersistentStore::access_start() {
|
bool PersistentStore::access_start() {
|
||||||
@@ -58,7 +50,7 @@ bool PersistentStore::access_start() {
|
|||||||
MSC_Release_Lock();
|
MSC_Release_Lock();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
FRESULT res = f_open(&eeprom_file, EEPROM_FILENAME, FA_OPEN_ALWAYS | FA_WRITE | FA_READ);
|
FRESULT res = f_open(&eeprom_file, "eeprom.dat", FA_OPEN_ALWAYS | FA_WRITE | FA_READ);
|
||||||
if (res) MSC_Release_Lock();
|
if (res) MSC_Release_Lock();
|
||||||
|
|
||||||
if (res == FR_OK) {
|
if (res == FR_OK) {
|
||||||
@@ -89,20 +81,18 @@ bool PersistentStore::access_finish() {
|
|||||||
// This extra chit-chat goes away soon, but is helpful for now
|
// This extra chit-chat goes away soon, but is helpful for now
|
||||||
// to see errors that are happening in read_data / write_data
|
// to see errors that are happening in read_data / write_data
|
||||||
static void debug_rw(const bool write, int &pos, const uint8_t *value, const size_t size, const FRESULT s, const size_t total=0) {
|
static void debug_rw(const bool write, int &pos, const uint8_t *value, const size_t size, const FRESULT s, const size_t total=0) {
|
||||||
#if ENABLED(DEBUG_SD_EEPROM_EMULATION)
|
PGM_P const rw_str = write ? PSTR("write") : PSTR("read");
|
||||||
PGM_P const rw_str = write ? PSTR("write") : PSTR("read");
|
SERIAL_CHAR(' ');
|
||||||
SERIAL_CHAR(' ');
|
SERIAL_ECHOPGM_P(rw_str);
|
||||||
|
SERIAL_ECHOLNPAIR("_data(", pos, ",", value, ",", size, ", ...)");
|
||||||
|
if (total) {
|
||||||
|
SERIAL_ECHOPGM(" f_");
|
||||||
SERIAL_ECHOPGM_P(rw_str);
|
SERIAL_ECHOPGM_P(rw_str);
|
||||||
SERIAL_ECHOLNPGM("_data(", pos, ",", *value, ",", size, ", ...)");
|
SERIAL_ECHOPAIR("()=", s, "\n size=", size, "\n bytes_");
|
||||||
if (total) {
|
SERIAL_ECHOLNPAIR_P(write ? PSTR("written=") : PSTR("read="), total);
|
||||||
SERIAL_ECHOPGM(" f_");
|
}
|
||||||
SERIAL_ECHOPGM_P(rw_str);
|
else
|
||||||
SERIAL_ECHOPGM("()=", s, "\n size=", size, "\n bytes_");
|
SERIAL_ECHOLNPAIR(" f_lseek()=", s);
|
||||||
SERIAL_ECHOLNPGM_P(write ? PSTR("written=") : PSTR("read="), total);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SERIAL_ECHOLNPGM(" f_lseek()=", s);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// File function return codes for type FRESULT. This goes away soon, but
|
// File function return codes for type FRESULT. This goes away soon, but
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ static_assert(!(NUM_SERVOS && ENABLED(FAST_PWM_FAN)), "BLTOUCH and Servos are in
|
|||||||
* Test LPC176x-specific configuration values for errors at compile-time.
|
* Test LPC176x-specific configuration values for errors at compile-time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//#if ENABLED(SPINDLE_LASER_USE_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
||||||
// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -36,9 +33,8 @@
|
|||||||
#define PRINT_PORT(p)
|
#define PRINT_PORT(p)
|
||||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||||
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("P%d_%02d"), LPC176x::pin_port(p), LPC176x::pin_bit(p)); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%d.%02d"), LPC176x::pin_port(p), LPC176x::pin_bit(p)); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR("_A%d "), LPC176x::pin_get_adc_channel(pin)); SERIAL_ECHO(buffer); }while(0)
|
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
|
||||||
#define MULTI_NAME_PAD 17 // space needed to be pretty if not first name assigned to a pin
|
|
||||||
|
|
||||||
// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities
|
// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities
|
||||||
#ifndef M43_NEVER_TOUCH
|
#ifndef M43_NEVER_TOUCH
|
||||||
@@ -52,4 +48,6 @@ bool GET_PINMODE(const pin_t pin) {
|
|||||||
return LPC176x::gpio_direction(pin);
|
return LPC176x::gpio_direction(pin);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GET_ARRAY_IS_DIGITAL(x) ((bool) pin_array[x].is_digital)
|
bool GET_ARRAY_IS_DIGITAL(const pin_t pin) {
|
||||||
|
return (!LPC176x::pin_has_adc(pin) || !LPC176x::pin_adc_enabled(pin));
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,22 +26,39 @@
|
|||||||
|
|
||||||
#include "tft_spi.h"
|
#include "tft_spi.h"
|
||||||
|
|
||||||
|
//TFT_SPI tft;
|
||||||
|
|
||||||
SPIClass TFT_SPI::SPIx(1);
|
SPIClass TFT_SPI::SPIx(1);
|
||||||
|
|
||||||
|
#define TFT_CS_H WRITE(TFT_CS_PIN, HIGH)
|
||||||
|
#define TFT_CS_L WRITE(TFT_CS_PIN, LOW)
|
||||||
|
|
||||||
|
#define TFT_DC_H WRITE(TFT_DC_PIN, HIGH)
|
||||||
|
#define TFT_DC_L WRITE(TFT_DC_PIN, LOW)
|
||||||
|
|
||||||
|
#define TFT_RST_H WRITE(TFT_RESET_PIN, HIGH)
|
||||||
|
#define TFT_RST_L WRITE(TFT_RESET_PIN, LOW)
|
||||||
|
|
||||||
|
#define TFT_BLK_H WRITE(TFT_BACKLIGHT_PIN, HIGH)
|
||||||
|
#define TFT_BLK_L WRITE(TFT_BACKLIGHT_PIN, LOW)
|
||||||
|
|
||||||
void TFT_SPI::Init() {
|
void TFT_SPI::Init() {
|
||||||
#if PIN_EXISTS(TFT_RESET)
|
#if PIN_EXISTS(TFT_RESET)
|
||||||
OUT_WRITE(TFT_RESET_PIN, HIGH);
|
SET_OUTPUT(TFT_RESET_PIN);
|
||||||
|
TFT_RST_H;
|
||||||
delay(100);
|
delay(100);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if PIN_EXISTS(TFT_BACKLIGHT)
|
#if PIN_EXISTS(TFT_BACKLIGHT)
|
||||||
OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
SET_OUTPUT(TFT_BACKLIGHT_PIN);
|
||||||
|
TFT_BLK_H;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SET_OUTPUT(TFT_DC_PIN);
|
SET_OUTPUT(TFT_DC_PIN);
|
||||||
SET_OUTPUT(TFT_CS_PIN);
|
SET_OUTPUT(TFT_CS_PIN);
|
||||||
WRITE(TFT_DC_PIN, HIGH);
|
|
||||||
WRITE(TFT_CS_PIN, HIGH);
|
TFT_DC_H;
|
||||||
|
TFT_CS_H;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz
|
* STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz
|
||||||
@@ -80,7 +97,7 @@ void TFT_SPI::Init() {
|
|||||||
void TFT_SPI::DataTransferBegin(uint16_t DataSize) {
|
void TFT_SPI::DataTransferBegin(uint16_t DataSize) {
|
||||||
SPIx.setDataSize(DataSize);
|
SPIx.setDataSize(DataSize);
|
||||||
SPIx.begin();
|
SPIx.begin();
|
||||||
WRITE(TFT_CS_PIN, LOW);
|
TFT_CS_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t TFT_SPI::GetID() {
|
uint32_t TFT_SPI::GetID() {
|
||||||
@@ -99,7 +116,7 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) {
|
|||||||
SPIx.setDataSize(DATASIZE_8BIT);
|
SPIx.setDataSize(DATASIZE_8BIT);
|
||||||
SPIx.setClock(SPI_CLOCK_DIV64);
|
SPIx.setClock(SPI_CLOCK_DIV64);
|
||||||
SPIx.begin();
|
SPIx.begin();
|
||||||
WRITE(TFT_CS_PIN, LOW);
|
TFT_CS_L;
|
||||||
WriteReg(Reg);
|
WriteReg(Reg);
|
||||||
|
|
||||||
LOOP_L_N(i, 4) {
|
LOOP_L_N(i, 4) {
|
||||||
@@ -114,15 +131,21 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) {
|
|||||||
return data >> 7;
|
return data >> 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TFT_SPI::isBusy() { return false; }
|
bool TFT_SPI::isBusy() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void TFT_SPI::Abort() { DataTransferEnd(); }
|
void TFT_SPI::Abort() {
|
||||||
|
DataTransferEnd();
|
||||||
|
}
|
||||||
|
|
||||||
void TFT_SPI::Transmit(uint16_t Data) { SPIx.transfer(Data); }
|
void TFT_SPI::Transmit(uint16_t Data) {
|
||||||
|
SPIx.transfer(Data);
|
||||||
|
}
|
||||||
|
|
||||||
void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) {
|
void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) {
|
||||||
DataTransferBegin(DATASIZE_16BIT);
|
DataTransferBegin(DATASIZE_16BIT); //16
|
||||||
WRITE(TFT_DC_PIN, HIGH);
|
TFT_DC_H;
|
||||||
SPIx.dmaSend(Data, Count, MemoryIncrease);
|
SPIx.dmaSend(Data, Count, MemoryIncrease);
|
||||||
DataTransferEnd();
|
DataTransferEnd();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,9 +99,9 @@ extern MSerialT serial_stream_3;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define CPU_ST7920_DELAY_1 600
|
#define ST7920_DELAY_1 DELAY_NS(600)
|
||||||
#define CPU_ST7920_DELAY_2 750
|
#define ST7920_DELAY_2 DELAY_NS(750)
|
||||||
#define CPU_ST7920_DELAY_3 750
|
#define ST7920_DELAY_3 DELAY_NS(750)
|
||||||
|
|
||||||
//
|
//
|
||||||
// Interrupts
|
// Interrupts
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Emulating RAMPS
|
// Emulating RAMPS
|
||||||
#if ENABLED(SPINDLE_LASER_USE_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
||||||
#error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
#error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* Support routines for X86_64
|
* Support routines for X86_64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,7 +36,6 @@
|
|||||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||||
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
|
||||||
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
|
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
|
||||||
|
|
||||||
// active ADC function/mode/code values for PINSEL registers
|
// active ADC function/mode/code values for PINSEL registers
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
*
|
*
|
||||||
* Derived from Adafruit_SPIFlash class with no SdFat references
|
* Derived from Adafruit_SPIFlash class with no SdFat references
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Adafruit_SPIFlashBase.h>
|
#include <Adafruit_SPIFlashBase.h>
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#define PRINT_PORT(p) do{ SERIAL_ECHOPGM(" Port: "); sprintf_P(buffer, PSTR("%c%02ld"), 'A' + g_APinDescription[p].ulPort, g_APinDescription[p].ulPin); SERIAL_ECHO(buffer); }while (0)
|
#define PRINT_PORT(p) do{ SERIAL_ECHOPGM(" Port: "); sprintf_P(buffer, PSTR("%c%02ld"), 'A' + g_APinDescription[p].ulPort, g_APinDescription[p].ulPin); SERIAL_ECHO(buffer); }while (0)
|
||||||
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
|
||||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||||
#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
|
#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
|
||||||
#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL)
|
#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL)
|
||||||
@@ -48,7 +47,7 @@ bool GET_PINMODE(int8_t pin) { // 1: output, 0: input
|
|||||||
void pwm_details(int32_t pin) {
|
void pwm_details(int32_t pin) {
|
||||||
if (pwm_status(pin)) {
|
if (pwm_status(pin)) {
|
||||||
//uint32_t chan = g_APinDescription[pin].ulPWMChannel TODO when fast pwm is operative;
|
//uint32_t chan = g_APinDescription[pin].ulPWMChannel TODO when fast pwm is operative;
|
||||||
//SERIAL_ECHOPGM("PWM = ", duty);
|
//SERIAL_ECHOPAIR("PWM = ", duty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,13 +37,6 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
//
|
|
||||||
// Default graphical display delays
|
|
||||||
//
|
|
||||||
#define CPU_ST7920_DELAY_1 300
|
|
||||||
#define CPU_ST7920_DELAY_2 40
|
|
||||||
#define CPU_ST7920_DELAY_3 340
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Serial Ports
|
// Serial Ports
|
||||||
//
|
//
|
||||||
@@ -183,13 +176,8 @@ static inline int freeMemory() {
|
|||||||
|
|
||||||
#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)
|
#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)
|
||||||
|
|
||||||
#ifdef ADC_RESOLUTION
|
|
||||||
#define HAL_ADC_RESOLUTION ADC_RESOLUTION
|
|
||||||
#else
|
|
||||||
#define HAL_ADC_RESOLUTION 12
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAL_ADC_VREF 3.3
|
#define HAL_ADC_VREF 3.3
|
||||||
|
#define HAL_ADC_RESOLUTION ADC_RESOLUTION // 12
|
||||||
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
||||||
#define HAL_READ_ADC() HAL_adc_result
|
#define HAL_READ_ADC() HAL_adc_result
|
||||||
#define HAL_ADC_READY() true
|
#define HAL_ADC_READY() true
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../platforms.h"
|
||||||
|
|
||||||
#if defined(HAL_STM32) && !defined(STM32H7xx)
|
#if defined(HAL_STM32) && !defined(STM32H7xx)
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -19,7 +16,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ bool PersistentStore::access_start() {
|
|||||||
// load current settings
|
// load current settings
|
||||||
uint8_t *eeprom_data = (uint8_t *)SLOT_ADDRESS(current_slot);
|
uint8_t *eeprom_data = (uint8_t *)SLOT_ADDRESS(current_slot);
|
||||||
for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i];
|
for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i];
|
||||||
DEBUG_ECHOLNPGM("EEPROM loaded from slot ", current_slot, ".");
|
DEBUG_ECHOLNPAIR("EEPROM loaded from slot ", current_slot, ".");
|
||||||
}
|
}
|
||||||
eeprom_data_written = false;
|
eeprom_data_written = false;
|
||||||
}
|
}
|
||||||
@@ -179,9 +179,9 @@ bool PersistentStore::access_finish() {
|
|||||||
ENABLE_ISRS();
|
ENABLE_ISRS();
|
||||||
TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT());
|
TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT());
|
||||||
if (status != HAL_OK) {
|
if (status != HAL_OK) {
|
||||||
DEBUG_ECHOLNPGM("HAL_FLASHEx_Erase=", status);
|
DEBUG_ECHOLNPAIR("HAL_FLASHEx_Erase=", status);
|
||||||
DEBUG_ECHOLNPGM("GetError=", HAL_FLASH_GetError());
|
DEBUG_ECHOLNPAIR("GetError=", HAL_FLASH_GetError());
|
||||||
DEBUG_ECHOLNPGM("SectorError=", SectorError);
|
DEBUG_ECHOLNPAIR("SectorError=", SectorError);
|
||||||
LOCK_FLASH();
|
LOCK_FLASH();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -204,9 +204,9 @@ bool PersistentStore::access_finish() {
|
|||||||
offset += sizeof(uint32_t);
|
offset += sizeof(uint32_t);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DEBUG_ECHOLNPGM("HAL_FLASH_Program=", status);
|
DEBUG_ECHOLNPAIR("HAL_FLASH_Program=", status);
|
||||||
DEBUG_ECHOLNPGM("GetError=", HAL_FLASH_GetError());
|
DEBUG_ECHOLNPAIR("GetError=", HAL_FLASH_GetError());
|
||||||
DEBUG_ECHOLNPGM("address=", address);
|
DEBUG_ECHOLNPAIR("address=", address);
|
||||||
success = false;
|
success = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -216,7 +216,7 @@ bool PersistentStore::access_finish() {
|
|||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
eeprom_data_written = false;
|
eeprom_data_written = false;
|
||||||
DEBUG_ECHOLNPGM("EEPROM saved to slot ", current_slot, ".");
|
DEBUG_ECHOLNPAIR("EEPROM saved to slot ", current_slot, ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
/**
|
/**
|
||||||
* Test STM32-specific configuration values for errors at compile-time.
|
* Test STM32-specific configuration values for errors at compile-time.
|
||||||
*/
|
*/
|
||||||
//#if ENABLED(SPINDLE_LASER_USE_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
||||||
// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#if defined(STM32F4xx) && BOTH(PRINTCOUNTER, FLASH_EEPROM_EMULATION)
|
#if defined(STM32F4xx) && BOTH(PRINTCOUNTER, FLASH_EEPROM_EMULATION)
|
||||||
#warning "FLASH_EEPROM_EMULATION may cause long delays when writing and should not be used while printing."
|
#warning "FLASH_EEPROM_EMULATION may cause long delays when writing and should not be used while printing."
|
||||||
//#error "Disable PRINTCOUNTER or choose another EEPROM emulation."
|
#error "Disable PRINTCOUNTER or choose another EEPROM emulation."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(STM32F4xx) && ENABLED(FLASH_EEPROM_LEVELING)
|
#if !defined(STM32F4xx) && ENABLED(FLASH_EEPROM_LEVELING)
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -112,7 +109,6 @@ const XrefInfo pin_xref[] PROGMEM = {
|
|||||||
#define VALID_PIN(ANUM) ((ANUM) >= 0 && (ANUM) < NUMBER_PINS_TOTAL)
|
#define VALID_PIN(ANUM) ((ANUM) >= 0 && (ANUM) < NUMBER_PINS_TOTAL)
|
||||||
#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads
|
#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads
|
||||||
#define PRINT_PIN(Q)
|
#define PRINT_PIN(Q)
|
||||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
|
||||||
#define PRINT_PORT(ANUM) port_print(ANUM)
|
#define PRINT_PORT(ANUM) port_print(ANUM)
|
||||||
#define DIGITAL_PIN_TO_ANALOG_PIN(ANUM) -1 // will report analog pin number in the print port routine
|
#define DIGITAL_PIN_TO_ANALOG_PIN(ANUM) -1 // will report analog pin number in the print port routine
|
||||||
#define GET_PIN_MAP_PIN_M43(Index) pin_xref[Index].Ard_num
|
#define GET_PIN_MAP_PIN_M43(Index) pin_xref[Index].Ard_num
|
||||||
@@ -240,7 +236,7 @@ void pwm_details(const pin_t Ard_num) {
|
|||||||
if (over_7) pin_number -= 8;
|
if (over_7) pin_number -= 8;
|
||||||
|
|
||||||
uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F;
|
uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F;
|
||||||
SERIAL_ECHOPGM("Alt Function: ", alt_func);
|
SERIAL_ECHOPAIR("Alt Function: ", alt_func);
|
||||||
if (alt_func < 10) SERIAL_CHAR(' ');
|
if (alt_func < 10) SERIAL_CHAR(' ');
|
||||||
SERIAL_ECHOPGM(" - ");
|
SERIAL_ECHOPGM(" - ");
|
||||||
switch (alt_func) {
|
switch (alt_func) {
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../platforms.h"
|
#include "../../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ void LTDC_Config() {
|
|||||||
hltdc_F.Init.AccumulatedVBP = (LTDC_LCD_VSYNC + LTDC_LCD_VBP - 1);
|
hltdc_F.Init.AccumulatedVBP = (LTDC_LCD_VSYNC + LTDC_LCD_VBP - 1);
|
||||||
hltdc_F.Init.AccumulatedActiveH = (TFT_HEIGHT + LTDC_LCD_VSYNC + LTDC_LCD_VBP - 1);
|
hltdc_F.Init.AccumulatedActiveH = (TFT_HEIGHT + LTDC_LCD_VSYNC + LTDC_LCD_VBP - 1);
|
||||||
hltdc_F.Init.AccumulatedActiveW = (TFT_WIDTH + LTDC_LCD_HSYNC + LTDC_LCD_HBP - 1);
|
hltdc_F.Init.AccumulatedActiveW = (TFT_WIDTH + LTDC_LCD_HSYNC + LTDC_LCD_HBP - 1);
|
||||||
hltdc_F.Init.TotalHeigh = (TFT_HEIGHT + LTDC_LCD_VSYNC + LTDC_LCD_VBP + LTDC_LCD_VFP - 1);
|
hltdc_F.Init.TotalHeight = (TFT_HEIGHT + LTDC_LCD_VSYNC + LTDC_LCD_VBP + LTDC_LCD_VFP - 1);
|
||||||
hltdc_F.Init.TotalWidth = (TFT_WIDTH + LTDC_LCD_HSYNC + LTDC_LCD_HBP + LTDC_LCD_HFP - 1);
|
hltdc_F.Init.TotalWidth = (TFT_WIDTH + LTDC_LCD_HSYNC + LTDC_LCD_HBP + LTDC_LCD_HFP - 1);
|
||||||
|
|
||||||
/* Configure R,G,B component values for LCD background color : all black background */
|
/* Configure R,G,B component values for LCD background color : all black background */
|
||||||
@@ -205,7 +205,7 @@ void LTDC_Config() {
|
|||||||
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
|
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
|
||||||
|
|
||||||
/* Start Address configuration : frame buffer is located at SDRAM memory */
|
/* Start Address configuration : frame buffer is located at SDRAM memory */
|
||||||
pLayerCfg.FBStartAdress = (uint32_t)(FRAME_BUFFER_ADDRESS);
|
pLayerCfg.FBStartAddress = (uint32_t)(FRAME_BUFFER_ADDRESS);
|
||||||
|
|
||||||
/* Alpha constant (255 == totally opaque) */
|
/* Alpha constant (255 == totally opaque) */
|
||||||
pLayerCfg.Alpha = 255;
|
pLayerCfg.Alpha = 255;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../platforms.h"
|
#include "../../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../platforms.h"
|
#include "../../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
@@ -89,9 +88,9 @@ void USBHost::setUsbTaskState(uint8_t state) {
|
|||||||
capacity = info.capacity.block_nbr / 2000;
|
capacity = info.capacity.block_nbr / 2000;
|
||||||
block_size = info.capacity.block_size;
|
block_size = info.capacity.block_size;
|
||||||
block_count = info.capacity.block_nbr;
|
block_count = info.capacity.block_nbr;
|
||||||
//SERIAL_ECHOLNPGM("info.capacity.block_nbr : %ld\n", info.capacity.block_nbr);
|
// SERIAL_ECHOLNPAIR("info.capacity.block_nbr : %ld\n", info.capacity.block_nbr);
|
||||||
//SERIAL_ECHOLNPGM("info.capacity.block_size: %d\n", info.capacity.block_size);
|
// SERIAL_ECHOLNPAIR("info.capacity.block_size: %d\n", info.capacity.block_size);
|
||||||
//SERIAL_ECHOLNPGM("capacity : %d MB\n", capacity);
|
// SERIAL_ECHOLNPAIR("capacity : %d MB\n", capacity);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -19,7 +16,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
|
|||||||
case POWER_MONITOR_VOLTAGE_PIN: pin_index = POWERMON_VOLTS; break;
|
case POWER_MONITOR_VOLTAGE_PIN: pin_index = POWERMON_VOLTS; break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
HAL_adc_result = HAL_adc_results[(int)pin_index] >> (12 - HAL_ADC_RESOLUTION); // shift out unused bits
|
HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only.
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t HAL_adc_get_result() { return HAL_adc_result; }
|
uint16_t HAL_adc_get_result() { return HAL_adc_result; }
|
||||||
|
|||||||
@@ -51,13 +51,6 @@
|
|||||||
// Defines
|
// Defines
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
||||||
//
|
|
||||||
// Default graphical display delays
|
|
||||||
//
|
|
||||||
#define CPU_ST7920_DELAY_1 300
|
|
||||||
#define CPU_ST7920_DELAY_2 40
|
|
||||||
#define CPU_ST7920_DELAY_3 340
|
|
||||||
|
|
||||||
#ifndef STM32_FLASH_SIZE
|
#ifndef STM32_FLASH_SIZE
|
||||||
#if ANY(MCU_STM32F103RE, MCU_STM32F103VE, MCU_STM32F103ZE)
|
#if ANY(MCU_STM32F103RE, MCU_STM32F103VE, MCU_STM32F103ZE)
|
||||||
#define STM32_FLASH_SIZE 512
|
#define STM32_FLASH_SIZE 512
|
||||||
@@ -237,13 +230,8 @@ static inline int freeMemory() {
|
|||||||
|
|
||||||
void HAL_adc_init();
|
void HAL_adc_init();
|
||||||
|
|
||||||
#ifdef ADC_RESOLUTION
|
|
||||||
#define HAL_ADC_RESOLUTION ADC_RESOLUTION
|
|
||||||
#else
|
|
||||||
#define HAL_ADC_RESOLUTION 12
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAL_ADC_VREF 3.3
|
#define HAL_ADC_VREF 3.3
|
||||||
|
#define HAL_ADC_RESOLUTION 10
|
||||||
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
||||||
#define HAL_READ_ADC() HAL_adc_result
|
#define HAL_READ_ADC() HAL_adc_result
|
||||||
#define HAL_ADC_READY() true
|
#define HAL_ADC_READY() true
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -19,7 +16,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __STM32F1__
|
#ifdef __STM32F1__
|
||||||
|
|
||||||
#include "../../../inc/MarlinConfig.h"
|
#include "../../../inc/MarlinConfig.h"
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -47,7 +44,7 @@ bool PersistentStore::access_start() {
|
|||||||
SET_OUTPUT(BOARD_SPI1_SCK_PIN);
|
SET_OUTPUT(BOARD_SPI1_SCK_PIN);
|
||||||
SET_OUTPUT(BOARD_SPI1_MOSI_PIN);
|
SET_OUTPUT(BOARD_SPI1_MOSI_PIN);
|
||||||
SET_INPUT(BOARD_SPI1_MISO_PIN);
|
SET_INPUT(BOARD_SPI1_MISO_PIN);
|
||||||
SET_OUTPUT(SPI_EEPROM1_CS_PIN);
|
SET_OUTPUT(SPI_EEPROM1_CS);
|
||||||
#endif
|
#endif
|
||||||
spiInit(0);
|
spiInit(0);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ static void sd_power_on() {
|
|||||||
ONBOARD_SD_SPI.begin();
|
ONBOARD_SD_SPI.begin();
|
||||||
ONBOARD_SD_SPI.setBitOrder(MSBFIRST);
|
ONBOARD_SD_SPI.setBitOrder(MSBFIRST);
|
||||||
ONBOARD_SD_SPI.setDataMode(SPI_MODE0);
|
ONBOARD_SD_SPI.setDataMode(SPI_MODE0);
|
||||||
CS_HIGH();
|
OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); // Set CS# high
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable SPI function
|
// Disable SPI function
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -44,7 +41,6 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS];
|
|||||||
#define pwm_status(pin) PWM_PIN(pin)
|
#define pwm_status(pin) PWM_PIN(pin)
|
||||||
#define digitalRead_mod(p) extDigitalRead(p)
|
#define digitalRead_mod(p) extDigitalRead(p)
|
||||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
|
||||||
#define PRINT_PORT(p) print_port(p)
|
#define PRINT_PORT(p) print_port(p)
|
||||||
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define MULTI_NAME_PAD 21 // space needed to be pretty if not first name assigned to a pin
|
#define MULTI_NAME_PAD 21 // space needed to be pretty if not first name assigned to a pin
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
|||||||
@@ -26,20 +26,36 @@
|
|||||||
|
|
||||||
#include "tft_spi.h"
|
#include "tft_spi.h"
|
||||||
|
|
||||||
|
// TFT_SPI tft;
|
||||||
|
|
||||||
SPIClass TFT_SPI::SPIx(1);
|
SPIClass TFT_SPI::SPIx(1);
|
||||||
|
|
||||||
|
#define TFT_CS_H OUT_WRITE(TFT_CS_PIN, HIGH)
|
||||||
|
#define TFT_CS_L OUT_WRITE(TFT_CS_PIN, LOW)
|
||||||
|
|
||||||
|
#define TFT_DC_H OUT_WRITE(TFT_DC_PIN, HIGH)
|
||||||
|
#define TFT_DC_L OUT_WRITE(TFT_DC_PIN, LOW)
|
||||||
|
|
||||||
|
#define TFT_RST_H OUT_WRITE(TFT_RST_PIN, HIGH)
|
||||||
|
#define TFT_RST_L OUT_WRITE(TFT_RST_PIN, LOW)
|
||||||
|
|
||||||
|
#define TFT_BLK_H OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH)
|
||||||
|
#define TFT_BLK_L OUT_WRITE(TFT_BACKLIGHT_PIN, LOW)
|
||||||
|
|
||||||
void TFT_SPI::Init() {
|
void TFT_SPI::Init() {
|
||||||
#if PIN_EXISTS(TFT_RESET)
|
#if PIN_EXISTS(TFT_RESET)
|
||||||
OUT_WRITE(TFT_RST_PIN, HIGH);
|
// OUT_WRITE(TFT_RESET_PIN, HIGH);
|
||||||
|
TFT_RST_H;
|
||||||
delay(100);
|
delay(100);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if PIN_EXISTS(TFT_BACKLIGHT)
|
#if PIN_EXISTS(TFT_BACKLIGHT)
|
||||||
OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
// OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
||||||
|
TFT_BLK_H;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OUT_WRITE(TFT_DC_PIN, HIGH);
|
TFT_DC_H;
|
||||||
OUT_WRITE(TFT_CS_PIN, HIGH);
|
TFT_CS_H;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz
|
* STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz
|
||||||
@@ -71,7 +87,7 @@ void TFT_SPI::Init() {
|
|||||||
void TFT_SPI::DataTransferBegin(uint16_t DataSize) {
|
void TFT_SPI::DataTransferBegin(uint16_t DataSize) {
|
||||||
SPIx.setDataSize(DataSize);
|
SPIx.setDataSize(DataSize);
|
||||||
SPIx.begin();
|
SPIx.begin();
|
||||||
OUT_WRITE(TFT_CS_PIN, LOW);
|
TFT_CS_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TFT_DEFAULT_DRIVER
|
#ifdef TFT_DEFAULT_DRIVER
|
||||||
@@ -113,16 +129,28 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TFT_SPI::isBusy() { return false; }
|
bool TFT_SPI::isBusy() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void TFT_SPI::Abort() { DataTransferEnd(); }
|
void TFT_SPI::Abort() {
|
||||||
|
DataTransferEnd();
|
||||||
|
}
|
||||||
|
|
||||||
void TFT_SPI::Transmit(uint16_t Data) { SPIx.send(Data); }
|
void TFT_SPI::Transmit(uint16_t Data) {
|
||||||
|
SPIx.send(Data);
|
||||||
|
}
|
||||||
|
|
||||||
void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) {
|
void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) {
|
||||||
DataTransferBegin();
|
DataTransferBegin();
|
||||||
OUT_WRITE(TFT_DC_PIN, HIGH);
|
TFT_DC_H;
|
||||||
SPIx.dmaSend(Data, Count, MemoryIncrease == DMA_MINC_ENABLE);
|
if (MemoryIncrease == DMA_MINC_ENABLE) {
|
||||||
|
SPIx.dmaSend(Data, Count, true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SPIx.dmaSend(Data, Count, false);
|
||||||
|
}
|
||||||
|
|
||||||
DataTransferEnd();
|
DataTransferEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,9 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define CPU_ST7920_DELAY_1 600
|
#define ST7920_DELAY_1 DELAY_NS(600)
|
||||||
#define CPU_ST7920_DELAY_2 750
|
#define ST7920_DELAY_2 DELAY_NS(750)
|
||||||
#define CPU_ST7920_DELAY_3 750
|
#define ST7920_DELAY_3 DELAY_NS(750)
|
||||||
|
|
||||||
//#undef MOTHERBOARD
|
//#undef MOTHERBOARD
|
||||||
//#define MOTHERBOARD BOARD_TEENSY31_32
|
//#define MOTHERBOARD BOARD_TEENSY31_32
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -19,7 +16,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __MK20DX256__
|
#ifdef __MK20DX256__
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -37,9 +37,9 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <util/atomic.h>
|
#include <util/atomic.h>
|
||||||
|
|
||||||
#define CPU_ST7920_DELAY_1 600
|
#define ST7920_DELAY_1 DELAY_NS(600)
|
||||||
#define CPU_ST7920_DELAY_2 750
|
#define ST7920_DELAY_2 DELAY_NS(750)
|
||||||
#define CPU_ST7920_DELAY_3 750
|
#define ST7920_DELAY_3 DELAY_NS(750)
|
||||||
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
// Defines
|
// Defines
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
|||||||
@@ -41,9 +41,9 @@
|
|||||||
#include "../../feature/ethernet.h"
|
#include "../../feature/ethernet.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CPU_ST7920_DELAY_1 600
|
//#define ST7920_DELAY_1 DELAY_NS(600)
|
||||||
#define CPU_ST7920_DELAY_2 750
|
//#define ST7920_DELAY_2 DELAY_NS(750)
|
||||||
#define CPU_ST7920_DELAY_3 750
|
//#define ST7920_DELAY_3 DELAY_NS(750)
|
||||||
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
// Defines
|
// Defines
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
* Marlin 3D Printer Firmware
|
* Marlin 3D Printer Firmware
|
||||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||||
*
|
*
|
||||||
* Based on Sprinter and grbl.
|
|
||||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -33,7 +30,6 @@
|
|||||||
#define PRINT_PORT(p)
|
#define PRINT_PORT(p)
|
||||||
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0)
|
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0)
|
||||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
|
||||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||||
#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
|
#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
|
||||||
#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL ? 1 : 0)
|
#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL ? 1 : 0)
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Delay.h"
|
#include "Delay.h"
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../inc/MarlinConfig.h"
|
||||||
@@ -111,16 +110,16 @@
|
|||||||
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) {
|
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 ");
|
SERIAL_ECHOPGM("Calling ");
|
||||||
SERIAL_ECHOPGM_P(name);
|
SERIAL_ECHOPGM_P(name);
|
||||||
SERIAL_ECHOLNPGM(" for ", cycles);
|
SERIAL_ECHOLNPAIR(" for ", cycles);
|
||||||
SERIAL_ECHOPGM_P(unit);
|
SERIAL_ECHOPGM_P(unit);
|
||||||
SERIAL_ECHOLNPGM(" took: ", total);
|
SERIAL_ECHOLNPAIR(" took: ", total);
|
||||||
SERIAL_ECHOPGM_P(unit);
|
SERIAL_ECHOPGM_P(unit);
|
||||||
if (do_flush) SERIAL_FLUSHTX();
|
if (do_flush) SERIAL_FLUSHTX();
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t s, e;
|
uint32_t s, e;
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Computed delay calibration value: ", ASM_CYCLES_PER_ITERATION);
|
SERIAL_ECHOLNPAIR("Computed delay calibration value: ", ASM_CYCLES_PER_ITERATION);
|
||||||
SERIAL_FLUSH();
|
SERIAL_FLUSH();
|
||||||
// Display the results of the calibration above
|
// Display the results of the calibration above
|
||||||
constexpr uint32_t testValues[] = { 1, 5, 10, 20, 50, 100, 150, 200, 350, 500, 750, 1000 };
|
constexpr uint32_t testValues[] = { 1, 5, 10, 20, 50, 100, 150, 200, 350, 500, 750, 1000 };
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ static void _eeprom_begin(uint8_t * const pos, const uint8_t cmd) {
|
|||||||
(unsigned(pos) >> 8) & 0xFF, // Address High
|
(unsigned(pos) >> 8) & 0xFF, // Address High
|
||||||
unsigned(pos) & 0xFF // Address Low
|
unsigned(pos) & 0xFF // Address Low
|
||||||
};
|
};
|
||||||
WRITE(SPI_EEPROM1_CS_PIN, HIGH); // Usually free already
|
WRITE(SPI_EEPROM1_CS, HIGH); // Usually free already
|
||||||
WRITE(SPI_EEPROM1_CS_PIN, LOW); // Activate the Bus
|
WRITE(SPI_EEPROM1_CS, LOW); // Activate the Bus
|
||||||
spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 3);
|
spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 3);
|
||||||
// Leave the Bus in-use
|
// Leave the Bus in-use
|
||||||
}
|
}
|
||||||
@@ -60,23 +60,23 @@ uint8_t eeprom_read_byte(uint8_t *pos) {
|
|||||||
|
|
||||||
const uint8_t v = spiRec(SPI_CHAN_EEPROM1); // After READ a value sits on the Bus
|
const uint8_t v = spiRec(SPI_CHAN_EEPROM1); // After READ a value sits on the Bus
|
||||||
|
|
||||||
WRITE(SPI_EEPROM1_CS_PIN, HIGH); // Done with device
|
WRITE(SPI_EEPROM1_CS, HIGH); // Done with device
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeprom_write_byte(uint8_t *pos, uint8_t value) {
|
void eeprom_write_byte(uint8_t *pos, uint8_t value) {
|
||||||
const uint8_t eeprom_temp = CMD_WREN;
|
const uint8_t eeprom_temp = CMD_WREN;
|
||||||
WRITE(SPI_EEPROM1_CS_PIN, LOW);
|
WRITE(SPI_EEPROM1_CS, LOW);
|
||||||
spiSend(SPI_CHAN_EEPROM1, &eeprom_temp, 1); // Write Enable
|
spiSend(SPI_CHAN_EEPROM1, &eeprom_temp, 1); // Write Enable
|
||||||
|
|
||||||
WRITE(SPI_EEPROM1_CS_PIN, HIGH); // Done with the Bus
|
WRITE(SPI_EEPROM1_CS, HIGH); // Done with the Bus
|
||||||
delay(1); // For a small amount of time
|
delay(1); // For a small amount of time
|
||||||
|
|
||||||
_eeprom_begin(pos, CMD_WRITE); // Set write address and begin transmission
|
_eeprom_begin(pos, CMD_WRITE); // Set write address and begin transmission
|
||||||
|
|
||||||
spiSend(SPI_CHAN_EEPROM1, value); // Send the value to be written
|
spiSend(SPI_CHAN_EEPROM1, value); // Send the value to be written
|
||||||
WRITE(SPI_EEPROM1_CS_PIN, HIGH); // Done with the Bus
|
WRITE(SPI_EEPROM1_CS, HIGH); // Done with the Bus
|
||||||
delay(EEPROM_WRITE_DELAY); // Give page write time to complete
|
delay(EEPROM_WRITE_DELAY); // Give page write time to complete
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,10 @@
|
|||||||
|
|
||||||
#include "MarlinCore.h"
|
#include "MarlinCore.h"
|
||||||
|
|
||||||
|
#if ENABLED(MARLIN_DEV_MODE)
|
||||||
|
#warning "WARNING! Disable MARLIN_DEV_MODE for the final build!"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "HAL/shared/Delay.h"
|
#include "HAL/shared/Delay.h"
|
||||||
#include "HAL/shared/esp_wifi.h"
|
#include "HAL/shared/esp_wifi.h"
|
||||||
#include "HAL/shared/cpu_exception/exception_hook.h"
|
#include "HAL/shared/cpu_exception/exception_hook.h"
|
||||||
@@ -70,15 +74,9 @@
|
|||||||
#include <lvgl.h>
|
#include <lvgl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_DWIN_E3V2
|
#if ENABLED(DWIN_CREALITY_LCD)
|
||||||
#include "lcd/e3v2/common/encoder.h"
|
#include "lcd/e3v2/creality/dwin.h"
|
||||||
#if ENABLED(DWIN_CREALITY_LCD)
|
#include "lcd/e3v2/creality/rotary_encoder.h"
|
||||||
#include "lcd/e3v2/creality/dwin.h"
|
|
||||||
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
|
|
||||||
#include "lcd/e3v2/enhanced/dwin.h"
|
|
||||||
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
|
|
||||||
#include "lcd/e3v2/jyersui/dwin.h"
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(EXTENSIBLE_UI)
|
#if ENABLED(EXTENSIBLE_UI)
|
||||||
@@ -238,10 +236,6 @@
|
|||||||
#include "feature/stepper_driver_safety.h"
|
#include "feature/stepper_driver_safety.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(PSU_CONTROL)
|
|
||||||
#include "feature/power.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
PGMSTR(M112_KILL_STR, "M112 Shutdown");
|
PGMSTR(M112_KILL_STR, "M112 Shutdown");
|
||||||
|
|
||||||
MarlinState marlin_state = MF_INITIALIZING;
|
MarlinState marlin_state = MF_INITIALIZING;
|
||||||
@@ -538,7 +532,6 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
|
|||||||
next_cub_ms_##N = ms + CUB_DEBOUNCE_DELAY_##N; \
|
next_cub_ms_##N = ms + CUB_DEBOUNCE_DELAY_##N; \
|
||||||
CODE; \
|
CODE; \
|
||||||
queue.inject_P(PSTR(BUTTON##N##_GCODE)); \
|
queue.inject_P(PSTR(BUTTON##N##_GCODE)); \
|
||||||
TERN_(HAS_LCD_MENU, ui.quick_feedback()); \
|
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}while(0)
|
}while(0)
|
||||||
@@ -795,7 +788,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
|
|||||||
void idle(bool no_stepper_sleep/*=false*/) {
|
void idle(bool no_stepper_sleep/*=false*/) {
|
||||||
#if ENABLED(MARLIN_DEV_MODE)
|
#if ENABLED(MARLIN_DEV_MODE)
|
||||||
static uint16_t idle_depth = 0;
|
static uint16_t idle_depth = 0;
|
||||||
if (++idle_depth > 5) SERIAL_ECHOLNPGM("idle() call depth: ", idle_depth);
|
if (++idle_depth > 5) SERIAL_ECHOLNPAIR("idle() call depth: ", idle_depth);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Core Marlin activities
|
// Core Marlin activities
|
||||||
@@ -849,7 +842,7 @@ void idle(bool no_stepper_sleep/*=false*/) {
|
|||||||
TERN_(USE_BEEPER, buzzer.tick());
|
TERN_(USE_BEEPER, buzzer.tick());
|
||||||
|
|
||||||
// Handle UI input / draw events
|
// Handle UI input / draw events
|
||||||
TERN(HAS_DWIN_E3V2_BASIC, DWIN_Update(), ui.update());
|
TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update());
|
||||||
|
|
||||||
// Run i2c Position Encoders
|
// Run i2c Position Encoders
|
||||||
#if ENABLED(I2C_POSITION_ENCODERS)
|
#if ENABLED(I2C_POSITION_ENCODERS)
|
||||||
@@ -871,7 +864,6 @@ void idle(bool no_stepper_sleep/*=false*/) {
|
|||||||
TERN_(AUTO_REPORT_TEMPERATURES, thermalManager.auto_reporter.tick());
|
TERN_(AUTO_REPORT_TEMPERATURES, thermalManager.auto_reporter.tick());
|
||||||
TERN_(AUTO_REPORT_SD_STATUS, card.auto_reporter.tick());
|
TERN_(AUTO_REPORT_SD_STATUS, card.auto_reporter.tick());
|
||||||
TERN_(AUTO_REPORT_POSITION, position_auto_reporter.tick());
|
TERN_(AUTO_REPORT_POSITION, position_auto_reporter.tick());
|
||||||
TERN_(BUFFER_MONITORING, queue.auto_report_buffer_statistics());
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -904,7 +896,7 @@ void kill(PGM_P const lcd_error/*=nullptr*/, PGM_P const lcd_component/*=nullptr
|
|||||||
// Echo the LCD message to serial for extra context
|
// Echo the LCD message to serial for extra context
|
||||||
if (lcd_error) { SERIAL_ECHO_START(); SERIAL_ECHOLNPGM_P(lcd_error); }
|
if (lcd_error) { SERIAL_ECHO_START(); SERIAL_ECHOLNPGM_P(lcd_error); }
|
||||||
|
|
||||||
#if EITHER(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED)
|
#if HAS_DISPLAY
|
||||||
ui.kill_screen(lcd_error ?: GET_TEXT(MSG_KILLED), lcd_component ?: NUL_STR);
|
ui.kill_screen(lcd_error ?: GET_TEXT(MSG_KILLED), lcd_component ?: NUL_STR);
|
||||||
#else
|
#else
|
||||||
UNUSED(lcd_error); UNUSED(lcd_component);
|
UNUSED(lcd_error); UNUSED(lcd_component);
|
||||||
@@ -940,7 +932,7 @@ void minkill(const bool steppers_off/*=false*/) {
|
|||||||
// Power off all steppers (for M112) or just the E steppers
|
// Power off all steppers (for M112) or just the E steppers
|
||||||
steppers_off ? disable_all_steppers() : disable_e_steppers();
|
steppers_off ? disable_all_steppers() : disable_e_steppers();
|
||||||
|
|
||||||
TERN_(PSU_CONTROL, powerManager.power_off());
|
TERN_(PSU_CONTROL, PSU_OFF());
|
||||||
|
|
||||||
TERN_(HAS_SUICIDE, suicide());
|
TERN_(HAS_SUICIDE, suicide());
|
||||||
|
|
||||||
@@ -1195,7 +1187,7 @@ void setup() {
|
|||||||
|
|
||||||
#if HAS_SUICIDE
|
#if HAS_SUICIDE
|
||||||
SETUP_LOG("SUICIDE_PIN");
|
SETUP_LOG("SUICIDE_PIN");
|
||||||
OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_STATE);
|
OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef JTAGSWD_RESET
|
#ifdef JTAGSWD_RESET
|
||||||
@@ -1222,10 +1214,10 @@ void setup() {
|
|||||||
SETUP_RUN(HAL_init());
|
SETUP_RUN(HAL_init());
|
||||||
|
|
||||||
// Init and disable SPI thermocouples; this is still needed
|
// Init and disable SPI thermocouples; this is still needed
|
||||||
#if TEMP_SENSOR_0_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E0))
|
#if TEMP_SENSOR_0_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 0)
|
||||||
OUT_WRITE(TEMP_0_CS_PIN, HIGH); // Disable
|
OUT_WRITE(TEMP_0_CS_PIN, HIGH); // Disable
|
||||||
#endif
|
#endif
|
||||||
#if TEMP_SENSOR_1_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E1))
|
#if TEMP_SENSOR_1_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 1)
|
||||||
OUT_WRITE(TEMP_1_CS_PIN, HIGH);
|
OUT_WRITE(TEMP_1_CS_PIN, HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1243,7 +1235,8 @@ void setup() {
|
|||||||
|
|
||||||
#if ENABLED(PSU_CONTROL)
|
#if ENABLED(PSU_CONTROL)
|
||||||
SETUP_LOG("PSU_CONTROL");
|
SETUP_LOG("PSU_CONTROL");
|
||||||
powerManager.init();
|
powersupply_on = ENABLED(PSU_DEFAULT_OFF);
|
||||||
|
if (ENABLED(PSU_DEFAULT_OFF)) PSU_OFF(); else PSU_ON();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||||
@@ -1282,13 +1275,14 @@ void setup() {
|
|||||||
HAL_clear_reset_source();
|
HAL_clear_reset_source();
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Marlin " SHORT_BUILD_VERSION);
|
SERIAL_ECHOLNPGM("Marlin " SHORT_BUILD_VERSION);
|
||||||
|
SERIAL_EOL();
|
||||||
#if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR)
|
#if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR)
|
||||||
SERIAL_ECHO_MSG(
|
SERIAL_ECHO_MSG(
|
||||||
" Last Updated: " STRING_DISTRIBUTION_DATE
|
" Last Updated: " STRING_DISTRIBUTION_DATE
|
||||||
" | Author: " STRING_CONFIG_H_AUTHOR
|
" | Author: " STRING_CONFIG_H_AUTHOR
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
SERIAL_ECHO_MSG(" Compiled: " __DATE__);
|
SERIAL_ECHO_MSG("Compiled: " __DATE__);
|
||||||
SERIAL_ECHO_MSG(STR_FREE_MEMORY, freeMemory(), STR_PLANNER_BUFFER_BYTES, sizeof(block_t) * (BLOCK_BUFFER_SIZE));
|
SERIAL_ECHO_MSG(STR_FREE_MEMORY, freeMemory(), STR_PLANNER_BUFFER_BYTES, sizeof(block_t) * (BLOCK_BUFFER_SIZE));
|
||||||
|
|
||||||
// Some HAL need precise delay adjustment
|
// Some HAL need precise delay adjustment
|
||||||
@@ -1315,7 +1309,7 @@ void setup() {
|
|||||||
// UI must be initialized before EEPROM
|
// UI must be initialized before EEPROM
|
||||||
// (because EEPROM code calls the UI).
|
// (because EEPROM code calls the UI).
|
||||||
|
|
||||||
#if HAS_DWIN_E3V2_BASIC
|
#if ENABLED(DWIN_CREALITY_LCD)
|
||||||
SETUP_RUN(DWIN_Startup());
|
SETUP_RUN(DWIN_Startup());
|
||||||
#else
|
#else
|
||||||
SETUP_RUN(ui.init());
|
SETUP_RUN(ui.init());
|
||||||
@@ -1351,7 +1345,7 @@ void setup() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_TOUCH_BUTTONS
|
#if HAS_TOUCH_BUTTONS
|
||||||
SETUP_RUN(touchBt.init());
|
SETUP_RUN(touch.init());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TERN_(HAS_M206_COMMAND, current_position += home_offset); // Init current position based on home_offset
|
TERN_(HAS_M206_COMMAND, current_position += home_offset); // Init current position based on home_offset
|
||||||
@@ -1590,7 +1584,7 @@ void setup() {
|
|||||||
SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n");
|
SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_DWIN_E3V2_BASIC
|
#if ENABLED(DWIN_CREALITY_LCD)
|
||||||
Encoder_Configuration();
|
Encoder_Configuration();
|
||||||
HMI_Init();
|
HMI_Init();
|
||||||
HMI_SetLanguageCache();
|
HMI_SetLanguageCache();
|
||||||
@@ -1598,7 +1592,7 @@ void setup() {
|
|||||||
DWIN_StatusChanged_P(GET_TEXT(WELCOME_MSG));
|
DWIN_StatusChanged_P(GET_TEXT(WELCOME_MSG));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_SERVICE_INTERVALS && !HAS_DWIN_E3V2_BASIC
|
#if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD)
|
||||||
ui.reset_status(true); // Show service messages or keep current status
|
ui.reset_status(true); // Show service messages or keep current status
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1620,7 +1614,7 @@ void setup() {
|
|||||||
#if BOTH(HAS_WIRED_LCD, SHOW_BOOTSCREEN)
|
#if BOTH(HAS_WIRED_LCD, SHOW_BOOTSCREEN)
|
||||||
const millis_t elapsed = millis() - bootscreen_ms;
|
const millis_t elapsed = millis() - bootscreen_ms;
|
||||||
#if ENABLED(MARLIN_DEV_MODE)
|
#if ENABLED(MARLIN_DEV_MODE)
|
||||||
SERIAL_ECHOLNPGM("elapsed=", elapsed);
|
SERIAL_ECHOLNPAIR("elapsed=", elapsed);
|
||||||
#endif
|
#endif
|
||||||
SETUP_RUN(ui.bootscreen_completion(elapsed));
|
SETUP_RUN(ui.bootscreen_completion(elapsed));
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -23,6 +23,10 @@
|
|||||||
|
|
||||||
#include "inc/MarlinConfig.h"
|
#include "inc/MarlinConfig.h"
|
||||||
|
|
||||||
|
#ifdef DEBUG_GCODE_PARSER
|
||||||
|
#include "gcode/parser.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -77,10 +81,29 @@ extern bool wait_for_heatup;
|
|||||||
void wait_for_user_response(millis_t ms=0, const bool no_sleep=false);
|
void wait_for_user_response(millis_t ms=0, const bool no_sleep=false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(PSU_CONTROL)
|
||||||
|
extern bool powersupply_on;
|
||||||
|
#define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_STATE); powersupply_on = true; }while(0)
|
||||||
|
#define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_STATE); powersupply_on = false; }while(0)
|
||||||
|
#if ENABLED(AUTO_POWER_CONTROL)
|
||||||
|
#define PSU_ON() powerManager.power_on()
|
||||||
|
#define PSU_OFF() powerManager.power_off()
|
||||||
|
#define PSU_OFF_SOON() powerManager.power_off_soon()
|
||||||
|
#else
|
||||||
|
#define PSU_ON() PSU_PIN_ON()
|
||||||
|
#if ENABLED(PS_OFF_SOUND)
|
||||||
|
#define PSU_OFF() do{ BUZZ(1000, 659); PSU_PIN_OFF(); }while(0)
|
||||||
|
#else
|
||||||
|
#define PSU_OFF() PSU_PIN_OFF()
|
||||||
|
#endif
|
||||||
|
#define PSU_OFF_SOON PSU_OFF
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
bool pin_is_protected(const pin_t pin);
|
bool pin_is_protected(const pin_t pin);
|
||||||
|
|
||||||
#if HAS_SUICIDE
|
#if HAS_SUICIDE
|
||||||
inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_STATE); }
|
inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_KILL
|
#if HAS_KILL
|
||||||
|
|||||||
@@ -149,10 +149,10 @@
|
|||||||
#define BOARD_GT2560_REV_A 1314 // Geeetech GT2560 Rev A
|
#define BOARD_GT2560_REV_A 1314 // Geeetech GT2560 Rev A
|
||||||
#define BOARD_GT2560_REV_A_PLUS 1315 // Geeetech GT2560 Rev A+ (with auto level probe)
|
#define BOARD_GT2560_REV_A_PLUS 1315 // Geeetech GT2560 Rev A+ (with auto level probe)
|
||||||
#define BOARD_GT2560_REV_B 1316 // Geeetech GT2560 Rev B
|
#define BOARD_GT2560_REV_B 1316 // Geeetech GT2560 Rev B
|
||||||
#define BOARD_GT2560_V3 1317 // Geeetech GT2560 Rev B for A10(M/T/D)
|
#define BOARD_GT2560_V3 1317 // Geeetech GT2560 Rev B for A10(M/D)
|
||||||
#define BOARD_GT2560_V4 1318 // Geeetech GT2560 Rev B for A10(M/T/D)
|
#define BOARD_GT2560_V4 1318 // Geeetech GT2560 Rev B for A10(M/D)
|
||||||
#define BOARD_GT2560_V3_MC2 1319 // Geeetech GT2560 Rev B for Mecreator2
|
#define BOARD_GT2560_V3_MC2 1319 // Geeetech GT2560 Rev B for Mecreator2
|
||||||
#define BOARD_GT2560_V3_A20 1320 // Geeetech GT2560 Rev B for A20(M/T/D)
|
#define BOARD_GT2560_V3_A20 1320 // Geeetech GT2560 Rev B for A20(M/D)
|
||||||
#define BOARD_EINSTART_S 1321 // Einstart retrofit
|
#define BOARD_EINSTART_S 1321 // Einstart retrofit
|
||||||
#define BOARD_WANHAO_ONEPLUS 1322 // Wanhao 0ne+ i3 Mini
|
#define BOARD_WANHAO_ONEPLUS 1322 // Wanhao 0ne+ i3 Mini
|
||||||
#define BOARD_LEAPFROG_XEED2015 1323 // Leapfrog Xeed 2015
|
#define BOARD_LEAPFROG_XEED2015 1323 // Leapfrog Xeed 2015
|
||||||
@@ -160,8 +160,6 @@
|
|||||||
#define BOARD_PICA 1325 // PICA Shield (rev C or later)
|
#define BOARD_PICA 1325 // PICA Shield (rev C or later)
|
||||||
#define BOARD_INTAMSYS40 1326 // Intamsys 4.0 (Funmat HT)
|
#define BOARD_INTAMSYS40 1326 // Intamsys 4.0 (Funmat HT)
|
||||||
#define BOARD_MALYAN_M180 1327 // Malyan M180 Mainboard Version 2 (no display function, direct gcode only)
|
#define BOARD_MALYAN_M180 1327 // Malyan M180 Mainboard Version 2 (no display function, direct gcode only)
|
||||||
#define BOARD_GT2560_V4_A20 1328 // Geeetech GT2560 Rev B for A20(M/T/D)
|
|
||||||
#define BOARD_PROTONEER_CNC_SHIELD_V3 1329 // Mega controller & Protoneer CNC Shield V3.00
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// ATmega1281, ATmega2561
|
// ATmega1281, ATmega2561
|
||||||
@@ -340,21 +338,17 @@
|
|||||||
#define BOARD_CREALITY_V427 4040 // Creality v4.2.7 (STM32F103RE)
|
#define BOARD_CREALITY_V427 4040 // Creality v4.2.7 (STM32F103RE)
|
||||||
#define BOARD_CREALITY_V4210 4041 // Creality v4.2.10 (STM32F103RE) as found in the CR-30
|
#define BOARD_CREALITY_V4210 4041 // Creality v4.2.10 (STM32F103RE) as found in the CR-30
|
||||||
#define BOARD_CREALITY_V431 4042 // Creality v4.3.1 (STM32F103RE)
|
#define BOARD_CREALITY_V431 4042 // Creality v4.3.1 (STM32F103RE)
|
||||||
#define BOARD_CREALITY_V431_A 4043 // Creality v4.3.1a (STM32F103RE)
|
#define BOARD_CREALITY_V452 4043 // Creality v4.5.2 (STM32F103RE)
|
||||||
#define BOARD_CREALITY_V431_B 4044 // Creality v4.3.1b (STM32F103RE)
|
#define BOARD_CREALITY_V453 4044 // Creality v4.5.3 (STM32F103RE)
|
||||||
#define BOARD_CREALITY_V431_C 4045 // Creality v4.3.1c (STM32F103RE)
|
#define BOARD_TRIGORILLA_PRO 4045 // Trigorilla Pro (STM32F103ZET6)
|
||||||
#define BOARD_CREALITY_V431_D 4046 // Creality v4.3.1d (STM32F103RE)
|
#define BOARD_FLY_MINI 4046 // FLYmaker FLY MINI (STM32F103RCT6)
|
||||||
#define BOARD_CREALITY_V452 4047 // Creality v4.5.2 (STM32F103RE)
|
#define BOARD_FLSUN_HISPEED 4047 // FLSUN HiSpeedV1 (STM32F103VET6)
|
||||||
#define BOARD_CREALITY_V453 4048 // Creality v4.5.3 (STM32F103RE)
|
#define BOARD_BEAST 4048 // STM32F103RET6 Libmaple-based controller
|
||||||
#define BOARD_TRIGORILLA_PRO 4049 // Trigorilla Pro (STM32F103ZET6)
|
#define BOARD_MINGDA_MPX_ARM_MINI 4049 // STM32F103ZET6 Mingda MD-16
|
||||||
#define BOARD_FLY_MINI 4050 // FLYmaker FLY MINI (STM32F103RCT6)
|
#define BOARD_GTM32_PRO_VD 4050 // STM32F103VET6 controller
|
||||||
#define BOARD_FLSUN_HISPEED 4051 // FLSUN HiSpeedV1 (STM32F103VET6)
|
#define BOARD_ZONESTAR_ZM3E2 4051 // Zonestar ZM3E2 (STM32F103RCT6)
|
||||||
#define BOARD_BEAST 4052 // STM32F103RET6 Libmaple-based controller
|
#define BOARD_ZONESTAR_ZM3E4 4052 // Zonestar ZM3E4 V1 (STM32F103VCT6)
|
||||||
#define BOARD_MINGDA_MPX_ARM_MINI 4053 // STM32F103ZET6 Mingda MD-16
|
#define BOARD_ZONESTAR_ZM3E4V2 4053 // Zonestar ZM3E4 V2 (STM32F103VCT6)
|
||||||
#define BOARD_GTM32_PRO_VD 4054 // STM32F103VET6 controller
|
|
||||||
#define BOARD_ZONESTAR_ZM3E2 4055 // Zonestar ZM3E2 (STM32F103RCT6)
|
|
||||||
#define BOARD_ZONESTAR_ZM3E4 4056 // Zonestar ZM3E4 V1 (STM32F103VCT6)
|
|
||||||
#define BOARD_ZONESTAR_ZM3E4V2 4057 // Zonestar ZM3E4 V2 (STM32F103VCT6)
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// ARM Cortex-M4F
|
// ARM Cortex-M4F
|
||||||
@@ -371,37 +365,33 @@
|
|||||||
#define BOARD_RUMBA32_V1_0 4201 // RUMBA32 STM32F446VET6 based controller from Aus3D
|
#define BOARD_RUMBA32_V1_0 4201 // RUMBA32 STM32F446VET6 based controller from Aus3D
|
||||||
#define BOARD_RUMBA32_V1_1 4202 // RUMBA32 STM32F446VET6 based controller from Aus3D
|
#define BOARD_RUMBA32_V1_1 4202 // RUMBA32 STM32F446VET6 based controller from Aus3D
|
||||||
#define BOARD_RUMBA32_MKS 4203 // RUMBA32 STM32F446VET6 based controller from Makerbase
|
#define BOARD_RUMBA32_MKS 4203 // RUMBA32 STM32F446VET6 based controller from Makerbase
|
||||||
#define BOARD_RUMBA32_BTT 4204 // RUMBA32 STM32F446VET6 based controller from BIGTREETECH
|
#define BOARD_BLACK_STM32F407VE 4204 // BLACK_STM32F407VE
|
||||||
#define BOARD_BLACK_STM32F407VE 4205 // BLACK_STM32F407VE
|
#define BOARD_BLACK_STM32F407ZE 4205 // BLACK_STM32F407ZE
|
||||||
#define BOARD_BLACK_STM32F407ZE 4206 // BLACK_STM32F407ZE
|
#define BOARD_STEVAL_3DP001V1 4206 // STEVAL-3DP001V1 3D PRINTER BOARD
|
||||||
#define BOARD_STEVAL_3DP001V1 4207 // STEVAL-3DP001V1 3D PRINTER BOARD
|
#define BOARD_BTT_SKR_PRO_V1_1 4207 // BigTreeTech SKR Pro v1.1 (STM32F407ZGT6)
|
||||||
#define BOARD_BTT_SKR_PRO_V1_1 4208 // BigTreeTech SKR Pro v1.1 (STM32F407ZGT6)
|
#define BOARD_BTT_SKR_PRO_V1_2 4208 // BigTreeTech SKR Pro v1.2 (STM32F407ZGT6)
|
||||||
#define BOARD_BTT_SKR_PRO_V1_2 4209 // BigTreeTech SKR Pro v1.2 (STM32F407ZGT6)
|
#define BOARD_BTT_BTT002_V1_0 4209 // BigTreeTech BTT002 v1.0 (STM32F407VGT6)
|
||||||
#define BOARD_BTT_BTT002_V1_0 4210 // BigTreeTech BTT002 v1.0 (STM32F407VGT6)
|
#define BOARD_BTT_E3_RRF 4210 // BigTreeTech E3 RRF (STM32F407VGT6)
|
||||||
#define BOARD_BTT_E3_RRF 4211 // BigTreeTech E3 RRF (STM32F407VGT6)
|
#define BOARD_BTT_SKR_V2_0_REV_A 4211 // BigTreeTech SKR v2.0 Rev A (STM32F407VGT6)
|
||||||
#define BOARD_BTT_SKR_V2_0_REV_A 4212 // BigTreeTech SKR v2.0 Rev A (STM32F407VGT6)
|
#define BOARD_BTT_SKR_V2_0_REV_B 4212 // BigTreeTech SKR v2.0 Rev B (STM32F407VGT6)
|
||||||
#define BOARD_BTT_SKR_V2_0_REV_B 4213 // BigTreeTech SKR v2.0 Rev B (STM32F407VGT6)
|
#define BOARD_BTT_GTR_V1_0 4213 // BigTreeTech GTR v1.0 (STM32F407IGT)
|
||||||
#define BOARD_BTT_GTR_V1_0 4214 // BigTreeTech GTR v1.0 (STM32F407IGT)
|
#define BOARD_BTT_OCTOPUS_V1_0 4214 // BigTreeTech Octopus v1.0 (STM32F446ZET6)
|
||||||
#define BOARD_BTT_OCTOPUS_V1_0 4215 // BigTreeTech Octopus v1.0 (STM32F446ZET6)
|
#define BOARD_BTT_OCTOPUS_V1_1 4215 // BigTreeTech Octopus v1.1 (STM32F446ZET6)
|
||||||
#define BOARD_BTT_OCTOPUS_V1_1 4216 // BigTreeTech Octopus v1.1 (STM32F446ZET6)
|
#define BOARD_LERDGE_K 4216 // Lerdge K (STM32F407ZG)
|
||||||
#define BOARD_LERDGE_K 4217 // Lerdge K (STM32F407ZG)
|
#define BOARD_LERDGE_S 4217 // Lerdge S (STM32F407VE)
|
||||||
#define BOARD_LERDGE_S 4218 // Lerdge S (STM32F407VE)
|
#define BOARD_LERDGE_X 4218 // Lerdge X (STM32F407VE)
|
||||||
#define BOARD_LERDGE_X 4219 // Lerdge X (STM32F407VE)
|
#define BOARD_VAKE403D 4219 // VAkE 403D (STM32F446VET6)
|
||||||
#define BOARD_VAKE403D 4220 // VAkE 403D (STM32F446VET6)
|
#define BOARD_FYSETC_S6 4220 // FYSETC S6 (STM32F446VET6)
|
||||||
#define BOARD_FYSETC_S6 4221 // FYSETC S6 (STM32F446VET6)
|
#define BOARD_FYSETC_S6_V2_0 4221 // FYSETC S6 v2.0 (STM32F446VET6)
|
||||||
#define BOARD_FYSETC_S6_V2_0 4222 // FYSETC S6 v2.0 (STM32F446VET6)
|
#define BOARD_FYSETC_SPIDER 4222 // FYSETC Spider (STM32F446VET6)
|
||||||
#define BOARD_FYSETC_SPIDER 4223 // FYSETC Spider (STM32F446VET6)
|
#define BOARD_FLYF407ZG 4223 // FLYmaker FLYF407ZG (STM32F407ZG)
|
||||||
#define BOARD_FLYF407ZG 4224 // FLYmaker FLYF407ZG (STM32F407ZG)
|
#define BOARD_MKS_ROBIN2 4224 // MKS_ROBIN2 (STM32F407ZE)
|
||||||
#define BOARD_MKS_ROBIN2 4225 // MKS_ROBIN2 (STM32F407ZE)
|
#define BOARD_MKS_ROBIN_PRO_V2 4225 // MKS Robin Pro V2 (STM32F407VE)
|
||||||
#define BOARD_MKS_ROBIN_PRO_V2 4226 // MKS Robin Pro V2 (STM32F407VE)
|
#define BOARD_MKS_ROBIN_NANO_V3 4226 // MKS Robin Nano V3 (STM32F407VG)
|
||||||
#define BOARD_MKS_ROBIN_NANO_V3 4227 // MKS Robin Nano V3 (STM32F407VG)
|
#define BOARD_MKS_MONSTER8 4227 // MKS Monster8 (STM32F407VGT6)
|
||||||
#define BOARD_MKS_MONSTER8 4228 // MKS Monster8 (STM32F407VGT6)
|
#define BOARD_ANET_ET4 4228 // ANET ET4 V1.x (STM32F407VGT6)
|
||||||
#define BOARD_ANET_ET4 4229 // ANET ET4 V1.x (STM32F407VGT6)
|
#define BOARD_ANET_ET4P 4229 // ANET ET4P V1.x (STM32F407VGT6)
|
||||||
#define BOARD_ANET_ET4P 4230 // ANET ET4P V1.x (STM32F407VGT6)
|
#define BOARD_FYSETC_CHEETAH_V20 4230 // FYSETC Cheetah V2.0
|
||||||
#define BOARD_FYSETC_CHEETAH_V20 4231 // FYSETC Cheetah V2.0
|
|
||||||
#define BOARD_TH3D_EZBOARD_LITE_V2 4232 // TH3D EZBoard Lite v2.0
|
|
||||||
#define BOARD_INDEX_REV03 4233 // Index PnP Controller REV03 (STM32F407VET6/VGT6)
|
|
||||||
#define BOARD_MKS_ROBIN_NANO_V1_3_F4 4234 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VET6)
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// ARM Cortex M7
|
// ARM Cortex M7
|
||||||
|
|||||||
@@ -20,19 +20,19 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// We need SERIAL_ECHOPGM and macros.h
|
// We need SERIAL_ECHOPAIR and macros.h
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
|
|
||||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||||
// Useful macro for stopping the CPU on an unexpected condition
|
// Useful macro for stopping the CPU on an unexpected condition
|
||||||
// This is used like SERIAL_ECHOPGM, that is: a key-value call of the local variables you want
|
// This is used like SERIAL_ECHOPAIR, that is: a key-value call of the local variables you want
|
||||||
// to dump to the serial port before stopping the CPU.
|
// to dump to the serial port before stopping the CPU.
|
||||||
// \/ Don't replace by SERIAL_ECHOPGM since ONLY_FILENAME cannot be transformed to a PGM string on Arduino and it breaks building
|
// \/ Don't replace by SERIAL_ECHOPAIR since ONLY_FILENAME cannot be transformed to a PGM string on Arduino and it breaks building
|
||||||
#define BUG_ON(V...) do { SERIAL_ECHO(ONLY_FILENAME); SERIAL_ECHO(__LINE__); SERIAL_ECHOLNPGM(": "); SERIAL_ECHOLNPGM(V); SERIAL_FLUSHTX(); *(char*)0 = 42; } while(0)
|
#define BUG_ON(V...) do { SERIAL_ECHO(ONLY_FILENAME); SERIAL_ECHO(__LINE__); SERIAL_ECHOLNPGM(": "); SERIAL_ECHOLNPAIR(V); SERIAL_FLUSHTX(); *(char*)0 = 42; } while(0)
|
||||||
#elif ENABLED(MARLIN_DEV_MODE)
|
#elif ENABLED(MARLIN_DEV_MODE)
|
||||||
// Don't stop the CPU here, but at least dump the bug on the serial port
|
// Don't stop the CPU here, but at least dump the bug on the serial port
|
||||||
// \/ Don't replace by SERIAL_ECHOPGM since ONLY_FILENAME cannot be transformed to a PGM string on Arduino and it breaks building
|
// \/ Don't replace by SERIAL_ECHOPAIR since ONLY_FILENAME cannot be transformed to a PGM string on Arduino and it breaks building
|
||||||
#define BUG_ON(V...) do { SERIAL_ECHO(ONLY_FILENAME); SERIAL_ECHO(__LINE__); SERIAL_ECHOLNPGM(": BUG!"); SERIAL_ECHOLNPGM(V); SERIAL_FLUSHTX(); } while(0)
|
#define BUG_ON(V...) do { SERIAL_ECHO(ONLY_FILENAME); SERIAL_ECHO(__LINE__); SERIAL_ECHOLNPGM(": BUG!"); SERIAL_ECHOLNPAIR(V); SERIAL_FLUSHTX(); } while(0)
|
||||||
#else
|
#else
|
||||||
// Release mode, let's ignore the bug
|
// Release mode, let's ignore the bug
|
||||||
#define BUG_ON(V...) NOOP
|
#define BUG_ON(V...) NOOP
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#undef DEBUG_SECTION
|
#undef DEBUG_SECTION
|
||||||
|
#undef DEBUG_ECHOPGM_P
|
||||||
#undef DEBUG_ECHO_START
|
#undef DEBUG_ECHO_START
|
||||||
#undef DEBUG_ERROR_START
|
#undef DEBUG_ERROR_START
|
||||||
#undef DEBUG_CHAR
|
#undef DEBUG_CHAR
|
||||||
@@ -36,10 +37,12 @@
|
|||||||
#undef DEBUG_ECHOLN
|
#undef DEBUG_ECHOLN
|
||||||
#undef DEBUG_ECHOPGM
|
#undef DEBUG_ECHOPGM
|
||||||
#undef DEBUG_ECHOLNPGM
|
#undef DEBUG_ECHOLNPGM
|
||||||
#undef DEBUG_ECHOPGM_P
|
#undef DEBUG_ECHOPAIR
|
||||||
#undef DEBUG_ECHOLNPGM_P
|
#undef DEBUG_ECHOPAIR_P
|
||||||
#undef DEBUG_ECHOPAIR_F
|
#undef DEBUG_ECHOPAIR_F
|
||||||
#undef DEBUG_ECHOPAIR_F_P
|
#undef DEBUG_ECHOPAIR_F_P
|
||||||
|
#undef DEBUG_ECHOLNPAIR
|
||||||
|
#undef DEBUG_ECHOLNPAIR_P
|
||||||
#undef DEBUG_ECHOLNPAIR_F
|
#undef DEBUG_ECHOLNPAIR_F
|
||||||
#undef DEBUG_ECHOLNPAIR_F_P
|
#undef DEBUG_ECHOLNPAIR_F_P
|
||||||
#undef DEBUG_ECHO_MSG
|
#undef DEBUG_ECHO_MSG
|
||||||
@@ -56,6 +59,7 @@
|
|||||||
#include "debug_section.h"
|
#include "debug_section.h"
|
||||||
#define DEBUG_SECTION(N,S,D) SectionLog N(PSTR(S),D)
|
#define DEBUG_SECTION(N,S,D) SectionLog N(PSTR(S),D)
|
||||||
|
|
||||||
|
#define DEBUG_ECHOPGM_P(P) SERIAL_ECHOPGM_P(P)
|
||||||
#define DEBUG_ECHO_START SERIAL_ECHO_START
|
#define DEBUG_ECHO_START SERIAL_ECHO_START
|
||||||
#define DEBUG_ERROR_START SERIAL_ERROR_START
|
#define DEBUG_ERROR_START SERIAL_ERROR_START
|
||||||
#define DEBUG_CHAR SERIAL_CHAR
|
#define DEBUG_CHAR SERIAL_CHAR
|
||||||
@@ -65,12 +69,12 @@
|
|||||||
#define DEBUG_ECHOLN SERIAL_ECHOLN
|
#define DEBUG_ECHOLN SERIAL_ECHOLN
|
||||||
#define DEBUG_ECHOPGM SERIAL_ECHOPGM
|
#define DEBUG_ECHOPGM SERIAL_ECHOPGM
|
||||||
#define DEBUG_ECHOLNPGM SERIAL_ECHOLNPGM
|
#define DEBUG_ECHOLNPGM SERIAL_ECHOLNPGM
|
||||||
#define DEBUG_ECHOPGM SERIAL_ECHOPGM
|
#define DEBUG_ECHOPAIR SERIAL_ECHOPAIR
|
||||||
#define DEBUG_ECHOPGM_P SERIAL_ECHOPGM_P
|
#define DEBUG_ECHOPAIR_P SERIAL_ECHOPAIR_P
|
||||||
#define DEBUG_ECHOPAIR_F SERIAL_ECHOPAIR_F
|
#define DEBUG_ECHOPAIR_F SERIAL_ECHOPAIR_F
|
||||||
#define DEBUG_ECHOPAIR_F_P SERIAL_ECHOPAIR_F_P
|
#define DEBUG_ECHOPAIR_F_P SERIAL_ECHOPAIR_F_P
|
||||||
#define DEBUG_ECHOLNPGM SERIAL_ECHOLNPGM
|
#define DEBUG_ECHOLNPAIR SERIAL_ECHOLNPAIR
|
||||||
#define DEBUG_ECHOLNPGM_P SERIAL_ECHOLNPGM_P
|
#define DEBUG_ECHOLNPAIR_P SERIAL_ECHOLNPAIR_P
|
||||||
#define DEBUG_ECHOLNPAIR_F SERIAL_ECHOLNPAIR_F
|
#define DEBUG_ECHOLNPAIR_F SERIAL_ECHOLNPAIR_F
|
||||||
#define DEBUG_ECHOLNPAIR_F_P SERIAL_ECHOLNPAIR_F_P
|
#define DEBUG_ECHOLNPAIR_F_P SERIAL_ECHOLNPAIR_F_P
|
||||||
#define DEBUG_ECHO_MSG SERIAL_ECHO_MSG
|
#define DEBUG_ECHO_MSG SERIAL_ECHO_MSG
|
||||||
@@ -85,6 +89,7 @@
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#define DEBUG_SECTION(...) NOOP
|
#define DEBUG_SECTION(...) NOOP
|
||||||
|
#define DEBUG_ECHOPGM_P(P) NOOP
|
||||||
#define DEBUG_ECHO_START() NOOP
|
#define DEBUG_ECHO_START() NOOP
|
||||||
#define DEBUG_ERROR_START() NOOP
|
#define DEBUG_ERROR_START() NOOP
|
||||||
#define DEBUG_CHAR(...) NOOP
|
#define DEBUG_CHAR(...) NOOP
|
||||||
@@ -94,10 +99,12 @@
|
|||||||
#define DEBUG_ECHOLN(...) NOOP
|
#define DEBUG_ECHOLN(...) NOOP
|
||||||
#define DEBUG_ECHOPGM(...) NOOP
|
#define DEBUG_ECHOPGM(...) NOOP
|
||||||
#define DEBUG_ECHOLNPGM(...) NOOP
|
#define DEBUG_ECHOLNPGM(...) NOOP
|
||||||
#define DEBUG_ECHOPGM_P(...) NOOP
|
#define DEBUG_ECHOPAIR(...) NOOP
|
||||||
#define DEBUG_ECHOLNPGM_P(...) NOOP
|
#define DEBUG_ECHOPAIR_P(...) NOOP
|
||||||
#define DEBUG_ECHOPAIR_F(...) NOOP
|
#define DEBUG_ECHOPAIR_F(...) NOOP
|
||||||
#define DEBUG_ECHOPAIR_F_P(...) NOOP
|
#define DEBUG_ECHOPAIR_F_P(...) NOOP
|
||||||
|
#define DEBUG_ECHOLNPAIR(...) NOOP
|
||||||
|
#define DEBUG_ECHOLNPAIR_P(...) NOOP
|
||||||
#define DEBUG_ECHOLNPAIR_F(...) NOOP
|
#define DEBUG_ECHOLNPAIR_F(...) NOOP
|
||||||
#define DEBUG_ECHOLNPAIR_F_P(...) NOOP
|
#define DEBUG_ECHOLNPAIR_F_P(...) NOOP
|
||||||
#define DEBUG_ECHO_MSG(...) NOOP
|
#define DEBUG_ECHO_MSG(...) NOOP
|
||||||
|
|||||||
@@ -158,14 +158,15 @@
|
|||||||
#define STR_OFF "OFF"
|
#define STR_OFF "OFF"
|
||||||
#define STR_ENDSTOP_HIT "TRIGGERED"
|
#define STR_ENDSTOP_HIT "TRIGGERED"
|
||||||
#define STR_ENDSTOP_OPEN "open"
|
#define STR_ENDSTOP_OPEN "open"
|
||||||
|
#define STR_HOTEND_OFFSET "Hotend offsets:"
|
||||||
#define STR_DUPLICATION_MODE "Duplication mode: "
|
#define STR_DUPLICATION_MODE "Duplication mode: "
|
||||||
|
#define STR_SOFT_ENDSTOPS "Soft endstops: "
|
||||||
#define STR_SOFT_MIN " Min: "
|
#define STR_SOFT_MIN " Min: "
|
||||||
#define STR_SOFT_MAX " Max: "
|
#define STR_SOFT_MAX " Max: "
|
||||||
|
|
||||||
#define STR_SAVED_POS "Position saved"
|
#define STR_SAVED_POS "Position saved"
|
||||||
#define STR_RESTORING_POS "Restoring position"
|
#define STR_RESTORING_POS "Restoring position"
|
||||||
#define STR_INVALID_POS_SLOT "Invalid slot. Total: "
|
#define STR_INVALID_POS_SLOT "Invalid slot. Total: "
|
||||||
#define STR_DONE "Done."
|
|
||||||
|
|
||||||
#define STR_SD_CANT_OPEN_SUBDIR "Cannot open subdir "
|
#define STR_SD_CANT_OPEN_SUBDIR "Cannot open subdir "
|
||||||
#define STR_SD_INIT_FAIL "No SD card"
|
#define STR_SD_INIT_FAIL "No SD card"
|
||||||
@@ -230,9 +231,6 @@
|
|||||||
#define STR_HEATER_BED "bed"
|
#define STR_HEATER_BED "bed"
|
||||||
#define STR_HEATER_CHAMBER "chamber"
|
#define STR_HEATER_CHAMBER "chamber"
|
||||||
#define STR_COOLER "cooler"
|
#define STR_COOLER "cooler"
|
||||||
#define STR_MOTHERBOARD "motherboard"
|
|
||||||
#define STR_PROBE "probe"
|
|
||||||
#define STR_REDUNDANT "redundant "
|
|
||||||
#define STR_LASER_TEMP "laser temperature"
|
#define STR_LASER_TEMP "laser temperature"
|
||||||
|
|
||||||
#define STR_STOPPED_HEATER ", system stopped! Heater_ID: "
|
#define STR_STOPPED_HEATER ", system stopped! Heater_ID: "
|
||||||
@@ -261,49 +259,6 @@
|
|||||||
#define STR_REMINDER_SAVE_SETTINGS "Remember to save!"
|
#define STR_REMINDER_SAVE_SETTINGS "Remember to save!"
|
||||||
#define STR_PASSWORD_SET "Password is "
|
#define STR_PASSWORD_SET "Password is "
|
||||||
|
|
||||||
// Settings Report Strings
|
|
||||||
#define STR_Z_AUTO_ALIGN "Z Auto-Align"
|
|
||||||
#define STR_BACKLASH_COMPENSATION "Backlash compensation"
|
|
||||||
#define STR_DELTA_SETTINGS "Delta settings (L<diagonal-rod> R<radius> H<height> S<segments-per-sec> XYZ<tower-angle-trim> ABC<rod-trim>)"
|
|
||||||
#define STR_SCARA_SETTINGS "SCARA settings"
|
|
||||||
#define STR_SCARA_S "S<seg-per-sec>"
|
|
||||||
#define STR_SCARA_P_T_Z "P<theta-psi-offset> T<theta-offset> Z<home-offset>"
|
|
||||||
#define STR_ENDSTOP_ADJUSTMENT "Endstop adjustment"
|
|
||||||
#define STR_SKEW_FACTOR "Skew Factor"
|
|
||||||
#define STR_FILAMENT_SETTINGS "Filament settings"
|
|
||||||
#define STR_MAX_ACCELERATION "Max Acceleration (units/s2)"
|
|
||||||
#define STR_MAX_FEEDRATES "Max feedrates (units/s)"
|
|
||||||
#define STR_ACCELERATION_P_R_T "Acceleration (units/s2) (P<print-accel> R<retract-accel> T<travel-accel>)"
|
|
||||||
#define STR_TOOL_CHANGING "Tool-changing"
|
|
||||||
#define STR_HOTEND_OFFSETS "Hotend offsets"
|
|
||||||
#define STR_SERVO_ANGLES "Servo Angles"
|
|
||||||
#define STR_HOTEND_PID "Hotend PID"
|
|
||||||
#define STR_BED_PID "Bed PID"
|
|
||||||
#define STR_CHAMBER_PID "Chamber PID"
|
|
||||||
#define STR_STEPS_PER_UNIT "Steps per unit"
|
|
||||||
#define STR_LINEAR_ADVANCE "Linear Advance"
|
|
||||||
#define STR_CONTROLLER_FAN "Controller Fan"
|
|
||||||
#define STR_STEPPER_MOTOR_CURRENTS "Stepper motor currents"
|
|
||||||
#define STR_RETRACT_S_F_Z "Retract (S<length> F<feedrate> Z<lift>)"
|
|
||||||
#define STR_RECOVER_S_F "Recover (S<length> F<feedrate>)"
|
|
||||||
#define STR_AUTO_RETRACT_S "Auto-Retract (S<enable>)"
|
|
||||||
#define STR_FILAMENT_LOAD_UNLOAD "Filament load/unload"
|
|
||||||
#define STR_POWER_LOSS_RECOVERY "Power-loss recovery"
|
|
||||||
#define STR_FILAMENT_RUNOUT_SENSOR "Filament runout sensor"
|
|
||||||
#define STR_DRIVER_STEPPING_MODE "Driver stepping mode"
|
|
||||||
#define STR_STEPPER_DRIVER_CURRENT "Stepper driver current"
|
|
||||||
#define STR_HYBRID_THRESHOLD "Hybrid Threshold"
|
|
||||||
#define STR_STALLGUARD_THRESHOLD "StallGuard threshold"
|
|
||||||
#define STR_HOME_OFFSET "Home offset"
|
|
||||||
#define STR_SOFT_ENDSTOPS "Soft endstops"
|
|
||||||
#define STR_MATERIAL_HEATUP "Material heatup parameters"
|
|
||||||
#define STR_LCD_CONTRAST "LCD Contrast"
|
|
||||||
#define STR_LCD_BRIGHTNESS "LCD Brightness"
|
|
||||||
#define STR_UI_LANGUAGE "UI Language"
|
|
||||||
#define STR_Z_PROBE_OFFSET "Z-Probe Offset"
|
|
||||||
#define STR_TEMPERATURE_UNITS "Temperature Units"
|
|
||||||
#define STR_USER_THERMISTORS "User thermistors"
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Endstop Names used by Endstops::report_states
|
// Endstop Names used by Endstops::report_states
|
||||||
//
|
//
|
||||||
@@ -332,7 +287,7 @@
|
|||||||
|
|
||||||
#define STR_Z_PROBE "z_probe"
|
#define STR_Z_PROBE "z_probe"
|
||||||
#define STR_PROBE_EN "probe_en"
|
#define STR_PROBE_EN "probe_en"
|
||||||
#define STR_FILAMENT "filament"
|
#define STR_FILAMENT_RUNOUT_SENSOR "filament"
|
||||||
|
|
||||||
// General axis names
|
// General axis names
|
||||||
#define STR_X "X"
|
#define STR_X "X"
|
||||||
|
|||||||
@@ -260,7 +260,6 @@
|
|||||||
#define CODE_3( A,B,C,...) A; B; C
|
#define CODE_3( A,B,C,...) A; B; C
|
||||||
#define CODE_2( A,B,...) A; B
|
#define CODE_2( A,B,...) A; B
|
||||||
#define CODE_1( A,...) A
|
#define CODE_1( A,...) A
|
||||||
#define CODE_0(...)
|
|
||||||
#define _CODE_N(N,V...) CODE_##N(V)
|
#define _CODE_N(N,V...) CODE_##N(V)
|
||||||
#define CODE_N(N,V...) _CODE_N(N,V)
|
#define CODE_N(N,V...) _CODE_N(N,V)
|
||||||
|
|
||||||
@@ -280,7 +279,6 @@
|
|||||||
#define GANG_3( A,B,C,...) A B C
|
#define GANG_3( A,B,C,...) A B C
|
||||||
#define GANG_2( A,B,...) A B
|
#define GANG_2( A,B,...) A B
|
||||||
#define GANG_1( A,...) A
|
#define GANG_1( A,...) A
|
||||||
#define GANG_0(...)
|
|
||||||
#define _GANG_N(N,V...) GANG_##N(V)
|
#define _GANG_N(N,V...) GANG_##N(V)
|
||||||
#define GANG_N(N,V...) _GANG_N(N,V)
|
#define GANG_N(N,V...) _GANG_N(N,V)
|
||||||
#define GANG_N_1(N,K) _GANG_N(N,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K)
|
#define GANG_N_1(N,K) _GANG_N(N,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K)
|
||||||
|
|||||||
@@ -36,8 +36,9 @@ typedef const char Language_Str[];
|
|||||||
#define NUM_LANGUAGES 1
|
#define NUM_LANGUAGES 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Set unused languages equal to each other so the
|
// Setting the unused languages equal to each other allows
|
||||||
// compiler can optimize away the conditionals.
|
// the compiler to optimize away the conditionals
|
||||||
|
|
||||||
#ifndef LCD_LANGUAGE_2
|
#ifndef LCD_LANGUAGE_2
|
||||||
#define LCD_LANGUAGE_2 LCD_LANGUAGE
|
#define LCD_LANGUAGE_2 LCD_LANGUAGE
|
||||||
#endif
|
#endif
|
||||||
@@ -57,11 +58,11 @@ typedef const char Language_Str[];
|
|||||||
#if NUM_LANGUAGES > 1
|
#if NUM_LANGUAGES > 1
|
||||||
#define HAS_MULTI_LANGUAGE 1
|
#define HAS_MULTI_LANGUAGE 1
|
||||||
#define GET_TEXT(MSG) ( \
|
#define GET_TEXT(MSG) ( \
|
||||||
ui.language == 4 ? GET_LANG(LCD_LANGUAGE_5)::MSG : \
|
ui.language == 0 ? GET_LANG(LCD_LANGUAGE )::MSG : \
|
||||||
ui.language == 3 ? GET_LANG(LCD_LANGUAGE_4)::MSG : \
|
|
||||||
ui.language == 2 ? GET_LANG(LCD_LANGUAGE_3)::MSG : \
|
|
||||||
ui.language == 1 ? GET_LANG(LCD_LANGUAGE_2)::MSG : \
|
ui.language == 1 ? GET_LANG(LCD_LANGUAGE_2)::MSG : \
|
||||||
GET_LANG(LCD_LANGUAGE )::MSG )
|
ui.language == 2 ? GET_LANG(LCD_LANGUAGE_3)::MSG : \
|
||||||
|
ui.language == 3 ? GET_LANG(LCD_LANGUAGE_4)::MSG : \
|
||||||
|
GET_LANG(LCD_LANGUAGE_5)::MSG )
|
||||||
#define MAX_LANG_CHARSIZE _MAX(GET_LANG(LCD_LANGUAGE )::CHARSIZE, \
|
#define MAX_LANG_CHARSIZE _MAX(GET_LANG(LCD_LANGUAGE )::CHARSIZE, \
|
||||||
GET_LANG(LCD_LANGUAGE_2)::CHARSIZE, \
|
GET_LANG(LCD_LANGUAGE_2)::CHARSIZE, \
|
||||||
GET_LANG(LCD_LANGUAGE_3)::CHARSIZE, \
|
GET_LANG(LCD_LANGUAGE_3)::CHARSIZE, \
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ void print_bin(uint16_t val) {
|
|||||||
|
|
||||||
void print_pos(LINEAR_AXIS_ARGS(const_float_t), PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) {
|
void print_pos(LINEAR_AXIS_ARGS(const_float_t), PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) {
|
||||||
if (prefix) serialprintPGM(prefix);
|
if (prefix) serialprintPGM(prefix);
|
||||||
SERIAL_ECHOPGM_P(
|
SERIAL_ECHOPAIR_P(
|
||||||
LIST_N(DOUBLE(LINEAR_AXES), SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z, SP_I_STR, i, SP_J_STR, j, SP_K_STR, k)
|
LIST_N(DOUBLE(LINEAR_AXES), SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z, SP_I_STR, i, SP_J_STR, j, SP_K_STR, k)
|
||||||
);
|
);
|
||||||
if (suffix) serialprintPGM(suffix); else SERIAL_EOL();
|
if (suffix) serialprintPGM(suffix); else SERIAL_EOL();
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ extern uint8_t marlin_debug_flags;
|
|||||||
#if HAS_MULTI_SERIAL
|
#if HAS_MULTI_SERIAL
|
||||||
#define _PORT_REDIRECT(n,p) REMEMBER(n,multiSerial.portMask,p)
|
#define _PORT_REDIRECT(n,p) REMEMBER(n,multiSerial.portMask,p)
|
||||||
#define _PORT_RESTORE(n,p) RESTORE(n)
|
#define _PORT_RESTORE(n,p) RESTORE(n)
|
||||||
#define SERIAL_ASSERT(P) if (multiSerial.portMask!=(P)) { debugger(); }
|
#define SERIAL_ASSERT(P) if(multiSerial.portMask!=(P)){ debugger(); }
|
||||||
// If we have a catchall, use that directly
|
// If we have a catchall, use that directly
|
||||||
#ifdef SERIAL_CATCHALL
|
#ifdef SERIAL_CATCHALL
|
||||||
#define _SERIAL_LEAF_2 SERIAL_CATCHALL
|
#define _SERIAL_LEAF_2 SERIAL_CATCHALL
|
||||||
@@ -188,44 +188,44 @@ inline void SERIAL_FLUSHTX() { SERIAL_IMPL.flushTX(); }
|
|||||||
void serialprintPGM(PGM_P str);
|
void serialprintPGM(PGM_P str);
|
||||||
|
|
||||||
//
|
//
|
||||||
// SERIAL_ECHOPGM... macros are used to output string-value pairs.
|
// SERIAL_ECHOPAIR... macros are used to output string-value pairs.
|
||||||
//
|
//
|
||||||
|
|
||||||
// Print up to 20 pairs of values. Odd elements must be literal strings.
|
// Print up to 20 pairs of values. Odd elements must be literal strings.
|
||||||
#define __SEP_N(N,V...) _SEP_##N(V)
|
#define __SEP_N(N,V...) _SEP_##N(V)
|
||||||
#define _SEP_N(N,V...) __SEP_N(N,V)
|
#define _SEP_N(N,V...) __SEP_N(N,V)
|
||||||
#define _SEP_N_REF() _SEP_N
|
#define _SEP_N_REF() _SEP_N
|
||||||
#define _SEP_1(s) serialprintPGM(PSTR(s));
|
#define _SEP_1(s) SERIAL_ECHOPGM(s);
|
||||||
#define _SEP_2(s,v) serial_echopair_PGM(PSTR(s),v);
|
#define _SEP_2(s,v) serial_echopair_PGM(PSTR(s),v);
|
||||||
#define _SEP_3(s,v,V...) _SEP_2(s,v); DEFER2(_SEP_N_REF)()(TWO_ARGS(V),V);
|
#define _SEP_3(s,v,V...) _SEP_2(s,v); DEFER2(_SEP_N_REF)()(TWO_ARGS(V),V);
|
||||||
#define SERIAL_ECHOPGM(V...) do{ EVAL(_SEP_N(TWO_ARGS(V),V)); }while(0)
|
#define SERIAL_ECHOPAIR(V...) do{ EVAL(_SEP_N(TWO_ARGS(V),V)); }while(0)
|
||||||
|
|
||||||
// Print up to 20 pairs of values followed by newline. Odd elements must be literal strings.
|
// Print up to 20 pairs of values followed by newline. Odd elements must be literal strings.
|
||||||
#define __SELP_N(N,V...) _SELP_##N(V)
|
#define __SELP_N(N,V...) _SELP_##N(V)
|
||||||
#define _SELP_N(N,V...) __SELP_N(N,V)
|
#define _SELP_N(N,V...) __SELP_N(N,V)
|
||||||
#define _SELP_N_REF() _SELP_N
|
#define _SELP_N_REF() _SELP_N
|
||||||
#define _SELP_1(s) serialprintPGM(PSTR(s "\n"));
|
#define _SELP_1(s) SERIAL_ECHOLNPGM(s);
|
||||||
#define _SELP_2(s,v) serial_echopair_PGM(PSTR(s),v); SERIAL_EOL();
|
#define _SELP_2(s,v) serial_echopair_PGM(PSTR(s),v); SERIAL_EOL();
|
||||||
#define _SELP_3(s,v,V...) _SEP_2(s,v); DEFER2(_SELP_N_REF)()(TWO_ARGS(V),V);
|
#define _SELP_3(s,v,V...) _SEP_2(s,v); DEFER2(_SELP_N_REF)()(TWO_ARGS(V),V);
|
||||||
#define SERIAL_ECHOLNPGM(V...) do{ EVAL(_SELP_N(TWO_ARGS(V),V)); }while(0)
|
#define SERIAL_ECHOLNPAIR(V...) do{ EVAL(_SELP_N(TWO_ARGS(V),V)); }while(0)
|
||||||
|
|
||||||
// Print up to 20 pairs of values. Odd elements must be PSTR pointers.
|
// Print up to 20 pairs of values. Odd elements must be PSTR pointers.
|
||||||
#define __SEP_N_P(N,V...) _SEP_##N##_P(V)
|
#define __SEP_N_P(N,V...) _SEP_##N##_P(V)
|
||||||
#define _SEP_N_P(N,V...) __SEP_N_P(N,V)
|
#define _SEP_N_P(N,V...) __SEP_N_P(N,V)
|
||||||
#define _SEP_N_P_REF() _SEP_N_P
|
#define _SEP_N_P_REF() _SEP_N_P
|
||||||
#define _SEP_1_P(p) serialprintPGM(p);
|
#define _SEP_1_P(s) serialprintPGM(s);
|
||||||
#define _SEP_2_P(p,v) serial_echopair_PGM(p,v);
|
#define _SEP_2_P(s,v) serial_echopair_PGM(s,v);
|
||||||
#define _SEP_3_P(p,v,V...) _SEP_2_P(p,v); DEFER2(_SEP_N_P_REF)()(TWO_ARGS(V),V);
|
#define _SEP_3_P(s,v,V...) _SEP_2_P(s,v); DEFER2(_SEP_N_P_REF)()(TWO_ARGS(V),V);
|
||||||
#define SERIAL_ECHOPGM_P(V...) do{ EVAL(_SEP_N_P(TWO_ARGS(V),V)); }while(0)
|
#define SERIAL_ECHOPAIR_P(V...) do{ EVAL(_SEP_N_P(TWO_ARGS(V),V)); }while(0)
|
||||||
|
|
||||||
// Print up to 20 pairs of values followed by newline. Odd elements must be PSTR pointers.
|
// Print up to 20 pairs of values followed by newline. Odd elements must be PSTR pointers.
|
||||||
#define __SELP_N_P(N,V...) _SELP_##N##_P(V)
|
#define __SELP_N_P(N,V...) _SELP_##N##_P(V)
|
||||||
#define _SELP_N_P(N,V...) __SELP_N_P(N,V)
|
#define _SELP_N_P(N,V...) __SELP_N_P(N,V)
|
||||||
#define _SELP_N_P_REF() _SELP_N_P
|
#define _SELP_N_P_REF() _SELP_N_P
|
||||||
#define _SELP_1_P(p) { serialprintPGM(p); SERIAL_EOL(); }
|
#define _SELP_1_P(s) { serialprintPGM(s); SERIAL_EOL(); }
|
||||||
#define _SELP_2_P(p,v) { serial_echopair_PGM(p,v); SERIAL_EOL(); }
|
#define _SELP_2_P(s,v) { serial_echopair_PGM(s,v); SERIAL_EOL(); }
|
||||||
#define _SELP_3_P(p,v,V...) { _SEP_2_P(p,v); DEFER2(_SELP_N_P_REF)()(TWO_ARGS(V),V); }
|
#define _SELP_3_P(s,v,V...) { _SEP_2_P(s,v); DEFER2(_SELP_N_P_REF)()(TWO_ARGS(V),V); }
|
||||||
#define SERIAL_ECHOLNPGM_P(V...) do{ EVAL(_SELP_N_P(TWO_ARGS(V),V)); }while(0)
|
#define SERIAL_ECHOLNPAIR_P(V...) do{ EVAL(_SELP_N_P(TWO_ARGS(V),V)); }while(0)
|
||||||
|
|
||||||
#ifdef AllowDifferentTypeInList
|
#ifdef AllowDifferentTypeInList
|
||||||
|
|
||||||
@@ -261,6 +261,12 @@ void serialprintPGM(PGM_P str);
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define SERIAL_ECHOPGM_P(P) (serialprintPGM(P))
|
||||||
|
#define SERIAL_ECHOLNPGM_P(P) do{ serialprintPGM(P); SERIAL_EOL(); }while(0)
|
||||||
|
|
||||||
|
#define SERIAL_ECHOPGM(S) (serialprintPGM(PSTR(S)))
|
||||||
|
#define SERIAL_ECHOLNPGM(S) (serialprintPGM(PSTR(S "\n")))
|
||||||
|
|
||||||
#define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0)
|
#define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0)
|
||||||
#define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0)
|
#define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0)
|
||||||
|
|
||||||
@@ -271,8 +277,8 @@ void serialprintPGM(PGM_P str);
|
|||||||
#define SERIAL_ERROR_START() serial_error_start()
|
#define SERIAL_ERROR_START() serial_error_start()
|
||||||
#define SERIAL_EOL() SERIAL_CHAR('\n')
|
#define SERIAL_EOL() SERIAL_CHAR('\n')
|
||||||
|
|
||||||
#define SERIAL_ECHO_MSG(V...) do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(V); }while(0)
|
#define SERIAL_ECHO_MSG(V...) do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(V); }while(0)
|
||||||
#define SERIAL_ERROR_MSG(V...) do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPGM(V); }while(0)
|
#define SERIAL_ERROR_MSG(V...) do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPAIR(V); }while(0)
|
||||||
|
|
||||||
#define SERIAL_ECHO_SP(C) serial_spaces(C)
|
#define SERIAL_ECHO_SP(C) serial_spaces(C)
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ struct IF<true, L, R> { typedef L type; };
|
|||||||
#define LOGICAL_AXIS_ELEM(O) LOGICAL_AXIS_LIST(O.e, O.x, O.y, O.z, O.i, O.j, O.k)
|
#define LOGICAL_AXIS_ELEM(O) LOGICAL_AXIS_LIST(O.e, O.x, O.y, O.z, O.i, O.j, O.k)
|
||||||
#define LOGICAL_AXIS_DECL(T,V) LOGICAL_AXIS_LIST(T e=V, T x=V, T y=V, T z=V, T i=V, T j=V, T k=V)
|
#define LOGICAL_AXIS_DECL(T,V) LOGICAL_AXIS_LIST(T e=V, T x=V, T y=V, T z=V, T i=V, T j=V, T k=V)
|
||||||
|
|
||||||
#define LOGICAL_AXES_STRING LOGICAL_AXIS_GANG("E", "X", "Y", "Z", AXIS4_STR, AXIS5_STR, AXIS6_STR)
|
|
||||||
|
|
||||||
#if HAS_EXTRUDERS
|
#if HAS_EXTRUDERS
|
||||||
#define LIST_ITEM_E(N) , N
|
#define LIST_ITEM_E(N) , N
|
||||||
#define CODE_ITEM_E(N) ; N
|
#define CODE_ITEM_E(N) ; N
|
||||||
|
|||||||
@@ -79,9 +79,9 @@ void safe_delay(millis_t ms) {
|
|||||||
#if HAS_BED_PROBE
|
#if HAS_BED_PROBE
|
||||||
|
|
||||||
#if !HAS_PROBE_XY_OFFSET
|
#if !HAS_PROBE_XY_OFFSET
|
||||||
SERIAL_ECHOPGM("Probe Offset X0 Y0 Z", probe.offset.z, " (");
|
SERIAL_ECHOPAIR("Probe Offset X0 Y0 Z", probe.offset.z, " (");
|
||||||
#else
|
#else
|
||||||
SERIAL_ECHOPGM_P(PSTR("Probe Offset X"), probe.offset_xy.x, SP_Y_STR, probe.offset_xy.y, SP_Z_STR, probe.offset.z);
|
SERIAL_ECHOPAIR_P(PSTR("Probe Offset X"), probe.offset_xy.x, SP_Y_STR, probe.offset_xy.y, SP_Z_STR, probe.offset.z);
|
||||||
if (probe.offset_xy.x > 0)
|
if (probe.offset_xy.x > 0)
|
||||||
SERIAL_ECHOPGM(" (Right");
|
SERIAL_ECHOPGM(" (Right");
|
||||||
else if (probe.offset_xy.x < 0)
|
else if (probe.offset_xy.x < 0)
|
||||||
@@ -119,7 +119,7 @@ void safe_delay(millis_t ms) {
|
|||||||
SERIAL_ECHOLNPGM(" (enabled)");
|
SERIAL_ECHOLNPGM(" (enabled)");
|
||||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||||
if (planner.z_fade_height)
|
if (planner.z_fade_height)
|
||||||
SERIAL_ECHOLNPGM("Z Fade: ", planner.z_fade_height);
|
SERIAL_ECHOLNPAIR("Z Fade: ", planner.z_fade_height);
|
||||||
#endif
|
#endif
|
||||||
#if ABL_PLANAR
|
#if ABL_PLANAR
|
||||||
SERIAL_ECHOPGM("ABL Adjustment");
|
SERIAL_ECHOPGM("ABL Adjustment");
|
||||||
@@ -140,7 +140,7 @@ void safe_delay(millis_t ms) {
|
|||||||
SERIAL_ECHO(ftostr43sign(rz, '+'));
|
SERIAL_ECHO(ftostr43sign(rz, '+'));
|
||||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||||
if (planner.z_fade_height) {
|
if (planner.z_fade_height) {
|
||||||
SERIAL_ECHOPGM(" (", ftostr43sign(rz * planner.fade_scaling_factor_for_z(current_position.z), '+'));
|
SERIAL_ECHOPAIR(" (", ftostr43sign(rz * planner.fade_scaling_factor_for_z(current_position.z), '+'));
|
||||||
SERIAL_CHAR(')');
|
SERIAL_CHAR(')');
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -156,10 +156,10 @@ void safe_delay(millis_t ms) {
|
|||||||
SERIAL_ECHOPGM("Mesh Bed Leveling");
|
SERIAL_ECHOPGM("Mesh Bed Leveling");
|
||||||
if (planner.leveling_active) {
|
if (planner.leveling_active) {
|
||||||
SERIAL_ECHOLNPGM(" (enabled)");
|
SERIAL_ECHOLNPGM(" (enabled)");
|
||||||
SERIAL_ECHOPGM("MBL Adjustment Z", ftostr43sign(mbl.get_z(current_position), '+'));
|
SERIAL_ECHOPAIR("MBL Adjustment Z", ftostr43sign(mbl.get_z(current_position), '+'));
|
||||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||||
if (planner.z_fade_height) {
|
if (planner.z_fade_height) {
|
||||||
SERIAL_ECHOPGM(" (", ftostr43sign(
|
SERIAL_ECHOPAIR(" (", ftostr43sign(
|
||||||
mbl.get_z(current_position, planner.fade_scaling_factor_for_z(current_position.z)), '+'
|
mbl.get_z(current_position, planner.fade_scaling_factor_for_z(current_position.z)), '+'
|
||||||
));
|
));
|
||||||
SERIAL_CHAR(')');
|
SERIAL_CHAR(')');
|
||||||
|
|||||||
@@ -134,12 +134,12 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const
|
|||||||
switch (axis) {
|
switch (axis) {
|
||||||
case CORE_AXIS_1:
|
case CORE_AXIS_1:
|
||||||
//block->steps[CORE_AXIS_2] += influence_distance_mm[axis] * planner.settings.axis_steps_per_mm[CORE_AXIS_2];
|
//block->steps[CORE_AXIS_2] += influence_distance_mm[axis] * planner.settings.axis_steps_per_mm[CORE_AXIS_2];
|
||||||
//SERIAL_ECHOLNPGM("CORE_AXIS_1 dir change. distance=", distance_mm[axis], " r.err=", residual_error[axis],
|
//SERIAL_ECHOLNPAIR("CORE_AXIS_1 dir change. distance=", distance_mm[axis], " r.err=", residual_error[axis],
|
||||||
// " da=", da, " db=", db, " block->steps[axis]=", block->steps[axis], " err_corr=", error_correction);
|
// " da=", da, " db=", db, " block->steps[axis]=", block->steps[axis], " err_corr=", error_correction);
|
||||||
break;
|
break;
|
||||||
case CORE_AXIS_2:
|
case CORE_AXIS_2:
|
||||||
//block->steps[CORE_AXIS_1] += influence_distance_mm[axis] * planner.settings.axis_steps_per_mm[CORE_AXIS_1];;
|
//block->steps[CORE_AXIS_1] += influence_distance_mm[axis] * planner.settings.axis_steps_per_mm[CORE_AXIS_1];;
|
||||||
//SERIAL_ECHOLNPGM("CORE_AXIS_2 dir change. distance=", distance_mm[axis], " r.err=", residual_error[axis],
|
//SERIAL_ECHOLNPAIR("CORE_AXIS_2 dir change. distance=", distance_mm[axis], " r.err=", residual_error[axis],
|
||||||
// " da=", da, " db=", db, " block->steps[axis]=", block->steps[axis], " err_corr=", error_correction);
|
// " da=", da, " db=", db, " block->steps[axis]=", block->steps[axis], " err_corr=", error_correction);
|
||||||
break;
|
break;
|
||||||
case NORMAL_AXIS: break;
|
case NORMAL_AXIS: break;
|
||||||
|
|||||||
@@ -336,11 +336,11 @@ float bilinear_z_offset(const xy_pos_t &raw) {
|
|||||||
/*
|
/*
|
||||||
static float last_offset = 0;
|
static float last_offset = 0;
|
||||||
if (ABS(last_offset - offset) > 0.2) {
|
if (ABS(last_offset - offset) > 0.2) {
|
||||||
SERIAL_ECHOLNPGM("Sudden Shift at x=", rel.x, " / ", bilinear_grid_spacing.x, " -> thisg.x=", thisg.x);
|
SERIAL_ECHOLNPAIR("Sudden Shift at x=", rel.x, " / ", bilinear_grid_spacing.x, " -> thisg.x=", thisg.x);
|
||||||
SERIAL_ECHOLNPGM(" y=", rel.y, " / ", bilinear_grid_spacing.y, " -> thisg.y=", thisg.y);
|
SERIAL_ECHOLNPAIR(" y=", rel.y, " / ", bilinear_grid_spacing.y, " -> thisg.y=", thisg.y);
|
||||||
SERIAL_ECHOLNPGM(" ratio.x=", ratio.x, " ratio.y=", ratio.y);
|
SERIAL_ECHOLNPAIR(" ratio.x=", ratio.x, " ratio.y=", ratio.y);
|
||||||
SERIAL_ECHOLNPGM(" z1=", z1, " z2=", z2, " z3=", z3, " z4=", z4);
|
SERIAL_ECHOLNPAIR(" z1=", z1, " z2=", z2, " z3=", z3, " z4=", z4);
|
||||||
SERIAL_ECHOLNPGM(" L=", L, " R=", R, " offset=", offset);
|
SERIAL_ECHOLNPAIR(" L=", L, " R=", R, " offset=", offset);
|
||||||
}
|
}
|
||||||
last_offset = offset;
|
last_offset = offset;
|
||||||
//*/
|
//*/
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ void unified_bed_leveling::report_current_mesh() {
|
|||||||
GRID_LOOP(x, y)
|
GRID_LOOP(x, y)
|
||||||
if (!isnan(z_values[x][y])) {
|
if (!isnan(z_values[x][y])) {
|
||||||
SERIAL_ECHO_START();
|
SERIAL_ECHO_START();
|
||||||
SERIAL_ECHOPGM(" M421 I", x, " J", y);
|
SERIAL_ECHOPAIR(" M421 I", x, " J", y);
|
||||||
SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, z_values[x][y], 4);
|
SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, z_values[x][y], 4);
|
||||||
serial_delay(75); // Prevent Printrun from exploding
|
serial_delay(75); // Prevent Printrun from exploding
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ public:
|
|||||||
|
|
||||||
if (DEBUGGING(LEVELING)) {
|
if (DEBUGGING(LEVELING)) {
|
||||||
if (WITHIN(x1_i, 0, (GRID_MAX_POINTS_X) - 1)) DEBUG_ECHOPGM("yi"); else DEBUG_ECHOPGM("x1_i");
|
if (WITHIN(x1_i, 0, (GRID_MAX_POINTS_X) - 1)) DEBUG_ECHOPGM("yi"); else DEBUG_ECHOPGM("x1_i");
|
||||||
DEBUG_ECHOLNPGM(" out of bounds in z_correction_for_x_on_horizontal_mesh_line(rx0=", rx0, ",x1_i=", x1_i, ",yi=", yi, ")");
|
DEBUG_ECHOLNPAIR(" out of bounds in z_correction_for_x_on_horizontal_mesh_line(rx0=", rx0, ",x1_i=", x1_i, ",yi=", yi, ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
// The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN.
|
// The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN.
|
||||||
@@ -231,7 +231,7 @@ public:
|
|||||||
|
|
||||||
if (DEBUGGING(LEVELING)) {
|
if (DEBUGGING(LEVELING)) {
|
||||||
if (WITHIN(xi, 0, (GRID_MAX_POINTS_X) - 1)) DEBUG_ECHOPGM("y1_i"); else DEBUG_ECHOPGM("xi");
|
if (WITHIN(xi, 0, (GRID_MAX_POINTS_X) - 1)) DEBUG_ECHOPGM("y1_i"); else DEBUG_ECHOPGM("xi");
|
||||||
DEBUG_ECHOLNPGM(" out of bounds in z_correction_for_y_on_vertical_mesh_line(ry0=", ry0, ", xi=", xi, ", y1_i=", y1_i, ")");
|
DEBUG_ECHOLNPAIR(" out of bounds in z_correction_for_y_on_vertical_mesh_line(ry0=", ry0, ", xi=", xi, ", y1_i=", y1_i, ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
// The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN.
|
// The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN.
|
||||||
@@ -275,11 +275,11 @@ public:
|
|||||||
// because part of the Mesh is undefined and we don't have the
|
// because part of the Mesh is undefined and we don't have the
|
||||||
// information we need to complete the height correction.
|
// information we need to complete the height correction.
|
||||||
|
|
||||||
if (DEBUGGING(MESH_ADJUST)) DEBUG_ECHOLNPGM("??? Yikes! NAN in ");
|
if (DEBUGGING(MESH_ADJUST)) DEBUG_ECHOLNPAIR("??? Yikes! NAN in ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DEBUGGING(MESH_ADJUST)) {
|
if (DEBUGGING(MESH_ADJUST)) {
|
||||||
DEBUG_ECHOPGM("get_z_correction(", rx0, ", ", ry0);
|
DEBUG_ECHOPAIR("get_z_correction(", rx0, ", ", ry0);
|
||||||
DEBUG_ECHOLNPAIR_F(") => ", z0, 6);
|
DEBUG_ECHOLNPAIR_F(") => ", z0, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ void unified_bed_leveling::G29() {
|
|||||||
SERIAL_ECHOLNPGM("Mesh invalidated. Probing mesh.");
|
SERIAL_ECHOLNPGM("Mesh invalidated. Probing mesh.");
|
||||||
}
|
}
|
||||||
if (param.V_verbosity > 1) {
|
if (param.V_verbosity > 1) {
|
||||||
SERIAL_ECHOPGM("Probing around (", param.XY_pos.x);
|
SERIAL_ECHOPAIR("Probing around (", param.XY_pos.x);
|
||||||
SERIAL_CHAR(',');
|
SERIAL_CHAR(',');
|
||||||
SERIAL_DECIMAL(param.XY_pos.y);
|
SERIAL_DECIMAL(param.XY_pos.y);
|
||||||
SERIAL_ECHOLNPGM(").\n");
|
SERIAL_ECHOLNPGM(").\n");
|
||||||
@@ -602,14 +602,14 @@ void unified_bed_leveling::G29() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!WITHIN(param.KLS_storage_slot, 0, a - 1)) {
|
if (!WITHIN(param.KLS_storage_slot, 0, a - 1)) {
|
||||||
SERIAL_ECHOLNPGM("?Invalid storage slot.\n?Use 0 to ", a - 1);
|
SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.load_mesh(param.KLS_storage_slot);
|
settings.load_mesh(param.KLS_storage_slot);
|
||||||
storage_slot = param.KLS_storage_slot;
|
storage_slot = param.KLS_storage_slot;
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM(STR_DONE);
|
SERIAL_ECHOLNPGM("Done.");
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -630,14 +630,14 @@ void unified_bed_leveling::G29() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!WITHIN(param.KLS_storage_slot, 0, a - 1)) {
|
if (!WITHIN(param.KLS_storage_slot, 0, a - 1)) {
|
||||||
SERIAL_ECHOLNPGM("?Invalid storage slot.\n?Use 0 to ", a - 1);
|
SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1);
|
||||||
goto LEAVE;
|
goto LEAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.store_mesh(param.KLS_storage_slot);
|
settings.store_mesh(param.KLS_storage_slot);
|
||||||
storage_slot = param.KLS_storage_slot;
|
storage_slot = param.KLS_storage_slot;
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM(STR_DONE);
|
SERIAL_ECHOLNPGM("Done.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parser.seen_test('T'))
|
if (parser.seen_test('T'))
|
||||||
@@ -653,7 +653,7 @@ void unified_bed_leveling::G29() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Z_PROBE_END_SCRIPT
|
#ifdef Z_PROBE_END_SCRIPT
|
||||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Probe End Script: ", Z_PROBE_END_SCRIPT);
|
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT);
|
||||||
if (probe_deployed) {
|
if (probe_deployed) {
|
||||||
planner.synchronize();
|
planner.synchronize();
|
||||||
gcode.process_subcommands_now_P(PSTR(Z_PROBE_END_SCRIPT));
|
gcode.process_subcommands_now_P(PSTR(Z_PROBE_END_SCRIPT));
|
||||||
@@ -690,7 +690,7 @@ void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const_float_t o
|
|||||||
if (!isnan(z_values[x][y]))
|
if (!isnan(z_values[x][y]))
|
||||||
sum_of_diff_squared += sq(z_values[x][y] - mean);
|
sum_of_diff_squared += sq(z_values[x][y] - mean);
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("# of samples: ", n);
|
SERIAL_ECHOLNPAIR("# of samples: ", n);
|
||||||
SERIAL_ECHOLNPAIR_F("Mean Mesh Height: ", mean, 6);
|
SERIAL_ECHOLNPAIR_F("Mean Mesh Height: ", mean, 6);
|
||||||
|
|
||||||
const float sigma = SQRT(sum_of_diff_squared / (n + 1));
|
const float sigma = SQRT(sum_of_diff_squared / (n + 1));
|
||||||
@@ -735,8 +735,8 @@ void unified_bed_leveling::shift_mesh_height() {
|
|||||||
if (do_ubl_mesh_map) display_map(param.T_map_type);
|
if (do_ubl_mesh_map) display_map(param.T_map_type);
|
||||||
|
|
||||||
const uint8_t point_num = (GRID_MAX_POINTS - count) + 1;
|
const uint8_t point_num = (GRID_MAX_POINTS - count) + 1;
|
||||||
SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
|
SERIAL_ECHOLNPAIR("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
|
||||||
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS)));
|
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), point_num, int(GRID_MAX_POINTS)));
|
||||||
|
|
||||||
#if HAS_LCD_MENU
|
#if HAS_LCD_MENU
|
||||||
if (ui.button_pressed()) {
|
if (ui.button_pressed()) {
|
||||||
@@ -1450,7 +1450,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
#endif
|
#endif
|
||||||
if (param.V_verbosity > 3) {
|
if (param.V_verbosity > 3) {
|
||||||
serial_spaces(16);
|
serial_spaces(16);
|
||||||
SERIAL_ECHOLNPGM("Corrected_Z=", measured_z);
|
SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z);
|
||||||
}
|
}
|
||||||
incremental_LSF(&lsf_results, points[0], measured_z);
|
incremental_LSF(&lsf_results, points[0], measured_z);
|
||||||
}
|
}
|
||||||
@@ -1469,7 +1469,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
measured_z -= get_z_correction(points[1]);
|
measured_z -= get_z_correction(points[1]);
|
||||||
if (param.V_verbosity > 3) {
|
if (param.V_verbosity > 3) {
|
||||||
serial_spaces(16);
|
serial_spaces(16);
|
||||||
SERIAL_ECHOLNPGM("Corrected_Z=", measured_z);
|
SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z);
|
||||||
}
|
}
|
||||||
incremental_LSF(&lsf_results, points[1], measured_z);
|
incremental_LSF(&lsf_results, points[1], measured_z);
|
||||||
}
|
}
|
||||||
@@ -1479,7 +1479,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
|
SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
|
||||||
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
|
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
|
||||||
|
|
||||||
measured_z = probe.probe_at_point(points[2], PROBE_PT_LAST_STOW, param.V_verbosity);
|
measured_z = probe.probe_at_point(points[2], PROBE_PT_STOW, param.V_verbosity);
|
||||||
#ifdef VALIDATE_MESH_TILT
|
#ifdef VALIDATE_MESH_TILT
|
||||||
z3 = measured_z;
|
z3 = measured_z;
|
||||||
#endif
|
#endif
|
||||||
@@ -1489,7 +1489,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
measured_z -= get_z_correction(points[2]);
|
measured_z -= get_z_correction(points[2]);
|
||||||
if (param.V_verbosity > 3) {
|
if (param.V_verbosity > 3) {
|
||||||
serial_spaces(16);
|
serial_spaces(16);
|
||||||
SERIAL_ECHOLNPGM("Corrected_Z=", measured_z);
|
SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z);
|
||||||
}
|
}
|
||||||
incremental_LSF(&lsf_results, points[2], measured_z);
|
incremental_LSF(&lsf_results, points[2], measured_z);
|
||||||
}
|
}
|
||||||
@@ -1517,7 +1517,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
rpos.y = y_min + dy * (zig_zag ? param.J_grid_size - 1 - iy : iy);
|
rpos.y = y_min + dy * (zig_zag ? param.J_grid_size - 1 - iy : iy);
|
||||||
|
|
||||||
if (!abort_flag) {
|
if (!abort_flag) {
|
||||||
SERIAL_ECHOLNPGM("Tilting mesh point ", point_num, "/", total_points, "\n");
|
SERIAL_ECHOLNPAIR("Tilting mesh point ", point_num, "/", total_points, "\n");
|
||||||
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points));
|
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points));
|
||||||
|
|
||||||
measured_z = probe.probe_at_point(rpos, parser.seen_test('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling
|
measured_z = probe.probe_at_point(rpos, parser.seen_test('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling
|
||||||
@@ -1545,7 +1545,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
|
|
||||||
if (param.V_verbosity > 3) {
|
if (param.V_verbosity > 3) {
|
||||||
serial_spaces(16);
|
serial_spaces(16);
|
||||||
SERIAL_ECHOLNPGM("Corrected_Z=", measured_z);
|
SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z);
|
||||||
}
|
}
|
||||||
incremental_LSF(&lsf_results, rpos, measured_z);
|
incremental_LSF(&lsf_results, rpos, measured_z);
|
||||||
}
|
}
|
||||||
@@ -1648,7 +1648,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
DEBUG_ECHOLNPAIR_F("0 : ", normed(safe_homing_xy, 0), 6);
|
DEBUG_ECHOLNPAIR_F("0 : ", normed(safe_homing_xy, 0), 6);
|
||||||
d_from(); DEBUG_ECHOPGM("safe home with Z=");
|
d_from(); DEBUG_ECHOPGM("safe home with Z=");
|
||||||
DEBUG_ECHOLNPAIR_F("mesh value ", normed(safe_homing_xy, get_z_correction(safe_homing_xy)), 6);
|
DEBUG_ECHOLNPAIR_F("mesh value ", normed(safe_homing_xy, get_z_correction(safe_homing_xy)), 6);
|
||||||
DEBUG_ECHOPGM(" Z error = (", Z_SAFE_HOMING_X_POINT, ",", Z_SAFE_HOMING_Y_POINT);
|
DEBUG_ECHOPAIR(" Z error = (", Z_SAFE_HOMING_X_POINT, ",", Z_SAFE_HOMING_Y_POINT);
|
||||||
DEBUG_ECHOLNPAIR_F(") = ", get_z_correction(safe_homing_xy), 6);
|
DEBUG_ECHOLNPAIR_F(") = ", get_z_correction(safe_homing_xy), 6);
|
||||||
#endif
|
#endif
|
||||||
} // DEBUGGING(LEVELING)
|
} // DEBUGGING(LEVELING)
|
||||||
@@ -1722,7 +1722,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
if (storage_slot == -1)
|
if (storage_slot == -1)
|
||||||
SERIAL_ECHOPGM("No Mesh Loaded.");
|
SERIAL_ECHOPGM("No Mesh Loaded.");
|
||||||
else
|
else
|
||||||
SERIAL_ECHOPGM("Mesh ", storage_slot, " Loaded.");
|
SERIAL_ECHOPAIR("Mesh ", storage_slot, " Loaded.");
|
||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
serial_delay(50);
|
serial_delay(50);
|
||||||
|
|
||||||
@@ -1736,14 +1736,14 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
SERIAL_ECHOLNPAIR_F("Probe Offset M851 Z", probe.offset.z, 7);
|
SERIAL_ECHOLNPAIR_F("Probe Offset M851 Z", probe.offset.z, 7);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("MESH_MIN_X " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); serial_delay(50);
|
SERIAL_ECHOLNPAIR("MESH_MIN_X " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); serial_delay(50);
|
||||||
SERIAL_ECHOLNPGM("MESH_MIN_Y " STRINGIFY(MESH_MIN_Y) "=", MESH_MIN_Y); serial_delay(50);
|
SERIAL_ECHOLNPAIR("MESH_MIN_Y " STRINGIFY(MESH_MIN_Y) "=", MESH_MIN_Y); serial_delay(50);
|
||||||
SERIAL_ECHOLNPGM("MESH_MAX_X " STRINGIFY(MESH_MAX_X) "=", MESH_MAX_X); serial_delay(50);
|
SERIAL_ECHOLNPAIR("MESH_MAX_X " STRINGIFY(MESH_MAX_X) "=", MESH_MAX_X); serial_delay(50);
|
||||||
SERIAL_ECHOLNPGM("MESH_MAX_Y " STRINGIFY(MESH_MAX_Y) "=", MESH_MAX_Y); serial_delay(50);
|
SERIAL_ECHOLNPAIR("MESH_MAX_Y " STRINGIFY(MESH_MAX_Y) "=", MESH_MAX_Y); serial_delay(50);
|
||||||
SERIAL_ECHOLNPGM("GRID_MAX_POINTS_X ", GRID_MAX_POINTS_X); serial_delay(50);
|
SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_X ", GRID_MAX_POINTS_X); serial_delay(50);
|
||||||
SERIAL_ECHOLNPGM("GRID_MAX_POINTS_Y ", GRID_MAX_POINTS_Y); serial_delay(50);
|
SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_Y ", GRID_MAX_POINTS_Y); serial_delay(50);
|
||||||
SERIAL_ECHOLNPGM("MESH_X_DIST ", MESH_X_DIST);
|
SERIAL_ECHOLNPAIR("MESH_X_DIST ", MESH_X_DIST);
|
||||||
SERIAL_ECHOLNPGM("MESH_Y_DIST ", MESH_Y_DIST); serial_delay(50);
|
SERIAL_ECHOLNPAIR("MESH_Y_DIST ", MESH_Y_DIST); serial_delay(50);
|
||||||
|
|
||||||
SERIAL_ECHOPGM("X-Axis Mesh Points at: ");
|
SERIAL_ECHOPGM("X-Axis Mesh Points at: ");
|
||||||
LOOP_L_N(i, GRID_MAX_POINTS_X) {
|
LOOP_L_N(i, GRID_MAX_POINTS_X) {
|
||||||
@@ -1762,27 +1762,27 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
|
|
||||||
#if HAS_KILL
|
#if HAS_KILL
|
||||||
SERIAL_ECHOLNPGM("Kill pin on :", KILL_PIN, " state:", kill_state());
|
SERIAL_ECHOLNPAIR("Kill pin on :", KILL_PIN, " state:", kill_state());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
serial_delay(50);
|
serial_delay(50);
|
||||||
|
|
||||||
#if ENABLED(UBL_DEVEL_DEBUGGING)
|
#if ENABLED(UBL_DEVEL_DEBUGGING)
|
||||||
SERIAL_ECHOLNPGM("ubl_state_at_invocation :", ubl_state_at_invocation, "\nubl_state_recursion_chk :", ubl_state_recursion_chk);
|
SERIAL_ECHOLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation, "\nubl_state_recursion_chk :", ubl_state_recursion_chk);
|
||||||
serial_delay(50);
|
serial_delay(50);
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Meshes go from ", hex_address((void*)settings.meshes_start_index()), " to ", hex_address((void*)settings.meshes_end_index()));
|
SERIAL_ECHOLNPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index()), " to ", hex_address((void*)settings.meshes_end_index()));
|
||||||
serial_delay(50);
|
serial_delay(50);
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("sizeof(ubl) : ", sizeof(ubl)); SERIAL_EOL();
|
SERIAL_ECHOLNPAIR("sizeof(ubl) : ", sizeof(ubl)); SERIAL_EOL();
|
||||||
SERIAL_ECHOLNPGM("z_value[][] size: ", sizeof(z_values)); SERIAL_EOL();
|
SERIAL_ECHOLNPAIR("z_value[][] size: ", sizeof(z_values)); SERIAL_EOL();
|
||||||
serial_delay(25);
|
serial_delay(25);
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index())));
|
SERIAL_ECHOLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index())));
|
||||||
serial_delay(50);
|
serial_delay(50);
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("EEPROM can hold ", settings.calc_num_meshes(), " meshes.\n");
|
SERIAL_ECHOLNPAIR("EEPROM can hold ", settings.calc_num_meshes(), " meshes.\n");
|
||||||
serial_delay(25);
|
serial_delay(25);
|
||||||
#endif // UBL_DEVEL_DEBUGGING
|
#endif // UBL_DEVEL_DEBUGGING
|
||||||
|
|
||||||
@@ -1829,7 +1829,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!parser.has_value() || !WITHIN(parser.value_int(), 0, a - 1)) {
|
if (!parser.has_value() || !WITHIN(parser.value_int(), 0, a - 1)) {
|
||||||
SERIAL_ECHOLNPGM("?Invalid storage slot.\n?Use 0 to ", a - 1);
|
SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1838,7 +1838,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||||||
float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
|
float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
|
||||||
settings.load_mesh(param.KLS_storage_slot, &tmp_z_values);
|
settings.load_mesh(param.KLS_storage_slot, &tmp_z_values);
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Subtracting mesh in slot ", param.KLS_storage_slot, " from current mesh.");
|
SERIAL_ECHOLNPAIR("Subtracting mesh in slot ", param.KLS_storage_slot, " from current mesh.");
|
||||||
|
|
||||||
GRID_LOOP(x, y) {
|
GRID_LOOP(x, y) {
|
||||||
z_values[x][y] -= tmp_z_values[x][y];
|
z_values[x][y] -= tmp_z_values[x][y];
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../../inc/MarlinConfig.h"
|
#include "../../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||||
|
|||||||
@@ -146,9 +146,9 @@ public:
|
|||||||
transfer_timeout = millis() + TIMEOUT;
|
transfer_timeout = millis() + TIMEOUT;
|
||||||
switch (static_cast<FileTransfer>(packet_type)) {
|
switch (static_cast<FileTransfer>(packet_type)) {
|
||||||
case FileTransfer::QUERY:
|
case FileTransfer::QUERY:
|
||||||
SERIAL_ECHOPGM("PFT:version:", VERSION_MAJOR, ".", VERSION_MINOR, ".", VERSION_PATCH);
|
SERIAL_ECHOPAIR("PFT:version:", VERSION_MAJOR, ".", VERSION_MINOR, ".", VERSION_PATCH);
|
||||||
#if ENABLED(BINARY_STREAM_COMPRESSION)
|
#if ENABLED(BINARY_STREAM_COMPRESSION)
|
||||||
SERIAL_ECHOLNPGM(":compression:heatshrink,", HEATSHRINK_STATIC_WINDOW_BITS, ",", HEATSHRINK_STATIC_LOOKAHEAD_BITS);
|
SERIAL_ECHOLNPAIR(":compression:heatshrink,", HEATSHRINK_STATIC_WINDOW_BITS, ",", HEATSHRINK_STATIC_LOOKAHEAD_BITS);
|
||||||
#else
|
#else
|
||||||
SERIAL_ECHOLNPGM(":compression:none");
|
SERIAL_ECHOLNPGM(":compression:none");
|
||||||
#endif
|
#endif
|
||||||
@@ -322,7 +322,7 @@ public:
|
|||||||
if (packet.header.checksum == packet.header_checksum) {
|
if (packet.header.checksum == packet.header_checksum) {
|
||||||
// The SYNC control packet is a special case in that it doesn't require the stream sync to be correct
|
// The SYNC control packet is a special case in that it doesn't require the stream sync to be correct
|
||||||
if (static_cast<Protocol>(packet.header.protocol()) == Protocol::CONTROL && static_cast<ProtocolControl>(packet.header.type()) == ProtocolControl::SYNC) {
|
if (static_cast<Protocol>(packet.header.protocol()) == Protocol::CONTROL && static_cast<ProtocolControl>(packet.header.type()) == ProtocolControl::SYNC) {
|
||||||
SERIAL_ECHOLNPGM("ss", sync, ",", buffer_size, ",", VERSION_MAJOR, ".", VERSION_MINOR, ".", VERSION_PATCH);
|
SERIAL_ECHOLNPAIR("ss", sync, ",", buffer_size, ",", VERSION_MAJOR, ".", VERSION_MINOR, ".", VERSION_PATCH);
|
||||||
stream_state = StreamState::PACKET_RESET;
|
stream_state = StreamState::PACKET_RESET;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -337,7 +337,7 @@ public:
|
|||||||
stream_state = StreamState::PACKET_PROCESS;
|
stream_state = StreamState::PACKET_PROCESS;
|
||||||
}
|
}
|
||||||
else if (packet.header.sync == sync - 1) { // ok response must have been lost
|
else if (packet.header.sync == sync - 1) { // ok response must have been lost
|
||||||
SERIAL_ECHOLNPGM("ok", packet.header.sync); // transmit valid packet received and drop the payload
|
SERIAL_ECHOLNPAIR("ok", packet.header.sync); // transmit valid packet received and drop the payload
|
||||||
stream_state = StreamState::PACKET_RESET;
|
stream_state = StreamState::PACKET_RESET;
|
||||||
}
|
}
|
||||||
else if (packet_retries) {
|
else if (packet_retries) {
|
||||||
@@ -393,7 +393,7 @@ public:
|
|||||||
packet_retries = 0;
|
packet_retries = 0;
|
||||||
bytes_received += packet.header.size;
|
bytes_received += packet.header.size;
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("ok", packet.header.sync); // transmit valid packet received
|
SERIAL_ECHOLNPAIR("ok", packet.header.sync); // transmit valid packet received
|
||||||
dispatch();
|
dispatch();
|
||||||
stream_state = StreamState::PACKET_RESET;
|
stream_state = StreamState::PACKET_RESET;
|
||||||
break;
|
break;
|
||||||
@@ -402,7 +402,7 @@ public:
|
|||||||
packet_retries++;
|
packet_retries++;
|
||||||
stream_state = StreamState::PACKET_RESET;
|
stream_state = StreamState::PACKET_RESET;
|
||||||
SERIAL_ECHO_MSG("Resend request ", packet_retries);
|
SERIAL_ECHO_MSG("Resend request ", packet_retries);
|
||||||
SERIAL_ECHOLNPGM("rs", sync);
|
SERIAL_ECHOLNPAIR("rs", sync);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
stream_state = StreamState::PACKET_ERROR;
|
stream_state = StreamState::PACKET_ERROR;
|
||||||
@@ -412,7 +412,7 @@ public:
|
|||||||
stream_state = StreamState::PACKET_RESEND;
|
stream_state = StreamState::PACKET_RESEND;
|
||||||
break;
|
break;
|
||||||
case StreamState::PACKET_ERROR:
|
case StreamState::PACKET_ERROR:
|
||||||
SERIAL_ECHOLNPGM("fe", packet.header.sync);
|
SERIAL_ECHOLNPAIR("fe", packet.header.sync);
|
||||||
reset(); // reset everything, resync required
|
reset(); // reset everything, resync required
|
||||||
stream_state = StreamState::PACKET_RESET;
|
stream_state = StreamState::PACKET_RESET;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ void stop();
|
|||||||
#include "../core/debug_out.h"
|
#include "../core/debug_out.h"
|
||||||
|
|
||||||
bool BLTouch::command(const BLTCommand cmd, const millis_t &ms) {
|
bool BLTouch::command(const BLTCommand cmd, const millis_t &ms) {
|
||||||
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("BLTouch Command :", cmd);
|
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("BLTouch Command :", cmd);
|
||||||
MOVE_SERVO(Z_PROBE_SERVO_NR, cmd);
|
MOVE_SERVO(Z_PROBE_SERVO_NR, cmd);
|
||||||
safe_delay(_MAX(ms, (uint32_t)BLTOUCH_DELAY)); // BLTOUCH_DELAY is also the *minimum* delay
|
safe_delay(_MAX(ms, (uint32_t)BLTOUCH_DELAY)); // BLTOUCH_DELAY is also the *minimum* delay
|
||||||
return triggered();
|
return triggered();
|
||||||
@@ -64,7 +64,7 @@ void BLTouch::init(const bool set_voltage/*=false*/) {
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
if (DEBUGGING(LEVELING)) {
|
if (DEBUGGING(LEVELING)) {
|
||||||
DEBUG_ECHOLNPGM("last_written_mode - ", last_written_mode);
|
DEBUG_ECHOLNPAIR("last_written_mode - ", last_written_mode);
|
||||||
DEBUG_ECHOLNPGM("config mode - "
|
DEBUG_ECHOLNPGM("config mode - "
|
||||||
#if ENABLED(BLTOUCH_SET_5V_MODE)
|
#if ENABLED(BLTOUCH_SET_5V_MODE)
|
||||||
"BLTOUCH_SET_5V_MODE"
|
"BLTOUCH_SET_5V_MODE"
|
||||||
@@ -175,7 +175,7 @@ bool BLTouch::status_proc() {
|
|||||||
_set_SW_mode(); // Incidentally, _set_SW_mode() will also RESET any active alarm
|
_set_SW_mode(); // Incidentally, _set_SW_mode() will also RESET any active alarm
|
||||||
const bool tr = triggered(); // If triggered in SW mode, the pin is up, it is STOWED
|
const bool tr = triggered(); // If triggered in SW mode, the pin is up, it is STOWED
|
||||||
|
|
||||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch is ", tr);
|
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("BLTouch is ", tr);
|
||||||
|
|
||||||
if (tr) _stow(); else _deploy(); // Turn off SW mode, reset any trigger, honor pin state
|
if (tr) _stow(); else _deploy(); // Turn off SW mode, reset any trigger, honor pin state
|
||||||
return !tr;
|
return !tr;
|
||||||
@@ -187,7 +187,7 @@ void BLTouch::mode_conv_proc(const bool M5V) {
|
|||||||
* BLTOUCH V3.0: This will set the mode (twice) and sadly, a STOW is needed at the end, because of the deploy
|
* BLTOUCH V3.0: This will set the mode (twice) and sadly, a STOW is needed at the end, because of the deploy
|
||||||
* BLTOUCH V3.1: This will set the mode and store it in the eeprom. The STOW is not needed but does not hurt
|
* BLTOUCH V3.1: This will set the mode and store it in the eeprom. The STOW is not needed but does not hurt
|
||||||
*/
|
*/
|
||||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Set Mode - ", M5V);
|
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("BLTouch Set Mode - ", M5V);
|
||||||
_deploy();
|
_deploy();
|
||||||
if (M5V) _set_5V_mode(); else _set_OD_mode();
|
if (M5V) _set_5V_mode(); else _set_OD_mode();
|
||||||
_mode_store();
|
_mode_store();
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../inc/MarlinConfig.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(CANCEL_OBJECTS)
|
#if ENABLED(CANCEL_OBJECTS)
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../inc/MarlinConfig.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
|
#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
|
||||||
|
|||||||
@@ -76,14 +76,9 @@ void ControllerFan::update() {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// If any triggers for the controller fan are true...
|
// If any of the drivers or the heated bed are enabled...
|
||||||
// - At least one stepper driver is enabled
|
if (motor_on || TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0))
|
||||||
// - The heated bed is enabled
|
lastMotorOn = ms; //... set time to NOW so the fan will turn on
|
||||||
// - TEMP_SENSOR_BOARD is reporting >= CONTROLLER_FAN_MIN_BOARD_TEMP
|
|
||||||
if ( motor_on
|
|
||||||
|| TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0)
|
|
||||||
|| TERN0(HAS_CONTROLLER_FAN_MIN_BOARD_TEMP, thermalManager.wholeDegBoard() >= CONTROLLER_FAN_MIN_BOARD_TEMP)
|
|
||||||
) lastMotorOn = ms; //... set time to NOW so the fan will turn on
|
|
||||||
|
|
||||||
// Fan Settings. Set fan > 0:
|
// Fan Settings. Set fan > 0:
|
||||||
// - If AutoMode is on and steppers have been enabled for CONTROLLERFAN_IDLE_TIME seconds.
|
// - If AutoMode is on and steppers have been enabled for CONTROLLERFAN_IDLE_TIME seconds.
|
||||||
|
|||||||
@@ -20,35 +20,35 @@ void dac084s085::begin() {
|
|||||||
uint8_t externalDac_buf[] = { 0x20, 0x00 }; // all off
|
uint8_t externalDac_buf[] = { 0x20, 0x00 }; // all off
|
||||||
|
|
||||||
// All SPI chip-select HIGH
|
// All SPI chip-select HIGH
|
||||||
SET_OUTPUT(DAC0_SYNC_PIN);
|
SET_OUTPUT(DAC0_SYNC);
|
||||||
#if HAS_MULTI_EXTRUDER
|
#if HAS_MULTI_EXTRUDER
|
||||||
SET_OUTPUT(DAC1_SYNC_PIN);
|
SET_OUTPUT(DAC1_SYNC);
|
||||||
#endif
|
#endif
|
||||||
cshigh();
|
cshigh();
|
||||||
spiBegin();
|
spiBegin();
|
||||||
|
|
||||||
//init onboard DAC
|
//init onboard DAC
|
||||||
DELAY_US(2);
|
DELAY_US(2);
|
||||||
WRITE(DAC0_SYNC_PIN, LOW);
|
WRITE(DAC0_SYNC, LOW);
|
||||||
DELAY_US(2);
|
DELAY_US(2);
|
||||||
WRITE(DAC0_SYNC_PIN, HIGH);
|
WRITE(DAC0_SYNC, HIGH);
|
||||||
DELAY_US(2);
|
DELAY_US(2);
|
||||||
WRITE(DAC0_SYNC_PIN, LOW);
|
WRITE(DAC0_SYNC, LOW);
|
||||||
|
|
||||||
spiSend(SPI_CHAN_DAC, externalDac_buf, COUNT(externalDac_buf));
|
spiSend(SPI_CHAN_DAC, externalDac_buf, COUNT(externalDac_buf));
|
||||||
WRITE(DAC0_SYNC_PIN, HIGH);
|
WRITE(DAC0_SYNC, HIGH);
|
||||||
|
|
||||||
#if HAS_MULTI_EXTRUDER
|
#if HAS_MULTI_EXTRUDER
|
||||||
//init Piggy DAC
|
//init Piggy DAC
|
||||||
DELAY_US(2);
|
DELAY_US(2);
|
||||||
WRITE(DAC1_SYNC_PIN, LOW);
|
WRITE(DAC1_SYNC, LOW);
|
||||||
DELAY_US(2);
|
DELAY_US(2);
|
||||||
WRITE(DAC1_SYNC_PIN, HIGH);
|
WRITE(DAC1_SYNC, HIGH);
|
||||||
DELAY_US(2);
|
DELAY_US(2);
|
||||||
WRITE(DAC1_SYNC_PIN, LOW);
|
WRITE(DAC1_SYNC, LOW);
|
||||||
|
|
||||||
spiSend(SPI_CHAN_DAC, externalDac_buf, COUNT(externalDac_buf));
|
spiSend(SPI_CHAN_DAC, externalDac_buf, COUNT(externalDac_buf));
|
||||||
WRITE(DAC1_SYNC_PIN, HIGH);
|
WRITE(DAC1_SYNC, HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -66,18 +66,18 @@ void dac084s085::setValue(const uint8_t channel, const uint8_t value) {
|
|||||||
cshigh();
|
cshigh();
|
||||||
|
|
||||||
if (channel > 3) { // DAC Piggy E1,E2,E3
|
if (channel > 3) { // DAC Piggy E1,E2,E3
|
||||||
WRITE(DAC1_SYNC_PIN, LOW);
|
WRITE(DAC1_SYNC, LOW);
|
||||||
DELAY_US(2);
|
DELAY_US(2);
|
||||||
WRITE(DAC1_SYNC_PIN, HIGH);
|
WRITE(DAC1_SYNC, HIGH);
|
||||||
DELAY_US(2);
|
DELAY_US(2);
|
||||||
WRITE(DAC1_SYNC_PIN, LOW);
|
WRITE(DAC1_SYNC, LOW);
|
||||||
}
|
}
|
||||||
else { // DAC onboard X,Y,Z,E0
|
else { // DAC onboard X,Y,Z,E0
|
||||||
WRITE(DAC0_SYNC_PIN, LOW);
|
WRITE(DAC0_SYNC, LOW);
|
||||||
DELAY_US(2);
|
DELAY_US(2);
|
||||||
WRITE(DAC0_SYNC_PIN, HIGH);
|
WRITE(DAC0_SYNC, HIGH);
|
||||||
DELAY_US(2);
|
DELAY_US(2);
|
||||||
WRITE(DAC0_SYNC_PIN, LOW);
|
WRITE(DAC0_SYNC, LOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
DELAY_US(2);
|
DELAY_US(2);
|
||||||
@@ -85,13 +85,13 @@ void dac084s085::setValue(const uint8_t channel, const uint8_t value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dac084s085::cshigh() {
|
void dac084s085::cshigh() {
|
||||||
WRITE(DAC0_SYNC_PIN, HIGH);
|
WRITE(DAC0_SYNC, HIGH);
|
||||||
#if HAS_MULTI_EXTRUDER
|
#if HAS_MULTI_EXTRUDER
|
||||||
WRITE(DAC1_SYNC_PIN, HIGH);
|
WRITE(DAC1_SYNC, HIGH);
|
||||||
#endif
|
#endif
|
||||||
WRITE(SPI_EEPROM1_CS_PIN, HIGH);
|
WRITE(SPI_EEPROM1_CS, HIGH);
|
||||||
WRITE(SPI_EEPROM2_CS_PIN, HIGH);
|
WRITE(SPI_EEPROM2_CS, HIGH);
|
||||||
WRITE(SPI_FLASH_CS_PIN, HIGH);
|
WRITE(SPI_FLASH_CS, HIGH);
|
||||||
WRITE(SD_SS_PIN, HIGH);
|
WRITE(SD_SS_PIN, HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,15 +85,15 @@ void StepperDAC::print_values() {
|
|||||||
if (!dac_present) return;
|
if (!dac_present) return;
|
||||||
SERIAL_ECHO_MSG("Stepper current values in % (Amps):");
|
SERIAL_ECHO_MSG("Stepper current values in % (Amps):");
|
||||||
SERIAL_ECHO_START();
|
SERIAL_ECHO_START();
|
||||||
SERIAL_ECHOPGM_P(SP_X_LBL, dac_perc(X_AXIS), PSTR(" ("), dac_amps(X_AXIS), PSTR(")"));
|
SERIAL_ECHOPAIR_P(SP_X_LBL, dac_perc(X_AXIS), PSTR(" ("), dac_amps(X_AXIS), PSTR(")"));
|
||||||
#if HAS_Y_AXIS
|
#if HAS_Y_AXIS
|
||||||
SERIAL_ECHOPGM_P(SP_Y_LBL, dac_perc(Y_AXIS), PSTR(" ("), dac_amps(Y_AXIS), PSTR(")"));
|
SERIAL_ECHOPAIR_P(SP_Y_LBL, dac_perc(Y_AXIS), PSTR(" ("), dac_amps(Y_AXIS), PSTR(")"));
|
||||||
#endif
|
#endif
|
||||||
#if HAS_Z_AXIS
|
#if HAS_Z_AXIS
|
||||||
SERIAL_ECHOPGM_P(SP_Z_LBL, dac_perc(Z_AXIS), PSTR(" ("), dac_amps(Z_AXIS), PSTR(")"));
|
SERIAL_ECHOPAIR_P(SP_Z_LBL, dac_perc(Z_AXIS), PSTR(" ("), dac_amps(Z_AXIS), PSTR(")"));
|
||||||
#endif
|
#endif
|
||||||
#if HAS_EXTRUDERS
|
#if HAS_EXTRUDERS
|
||||||
SERIAL_ECHOLNPGM_P(SP_E_LBL, dac_perc(E_AXIS), PSTR(" ("), dac_amps(E_AXIS), PSTR(")"));
|
SERIAL_ECHOLNPAIR_P(SP_E_LBL, dac_perc(E_AXIS), PSTR(" ("), dac_amps(E_AXIS), PSTR(")"));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../inc/MarlinConfigPre.h"
|
#include "../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if ENABLED(DIRECT_STEPPING)
|
#if ENABLED(DIRECT_STEPPING)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void I2CPositionEncoder::init(const uint8_t address, const AxisEnum axis) {
|
|||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Setting up encoder on ", AS_CHAR(axis_codes[encoderAxis]), " axis, addr = ", address);
|
SERIAL_ECHOLNPAIR("Setting up encoder on ", AS_CHAR(axis_codes[encoderAxis]), " axis, addr = ", address);
|
||||||
|
|
||||||
position = get_position();
|
position = get_position();
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ void I2CPositionEncoder::update() {
|
|||||||
/*
|
/*
|
||||||
if (trusted) { //commented out as part of the note below
|
if (trusted) { //commented out as part of the note below
|
||||||
trusted = false;
|
trusted = false;
|
||||||
SERIAL_ECHOLNPGM("Fault detected on ", AS_CHAR(axis_codes[encoderAxis]), " axis encoder. Disengaging error correction until module is trusted again.");
|
SERIAL_ECHOLNPAIR("Fault detected on ", AS_CHAR(axis_codes[encoderAxis]), " axis encoder. Disengaging error correction until module is trusted again.");
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
@@ -92,7 +92,7 @@ void I2CPositionEncoder::update() {
|
|||||||
if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) {
|
if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) {
|
||||||
trusted = true;
|
trusted = true;
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Untrusted encoder module on ", AS_CHAR(axis_codes[encoderAxis]), " axis has been fault-free for set duration, reinstating error correction.");
|
SERIAL_ECHOLNPAIR("Untrusted encoder module on ", AS_CHAR(axis_codes[encoderAxis]), " axis has been fault-free for set duration, reinstating error correction.");
|
||||||
|
|
||||||
//the encoder likely lost its place when the error occurred, so we'll reset and use the printer's
|
//the encoder likely lost its place when the error occurred, so we'll reset and use the printer's
|
||||||
//idea of where it the axis is to re-initialize
|
//idea of where it the axis is to re-initialize
|
||||||
@@ -103,10 +103,10 @@ void I2CPositionEncoder::update() {
|
|||||||
zeroOffset -= (positionInTicks - get_position());
|
zeroOffset -= (positionInTicks - get_position());
|
||||||
|
|
||||||
#ifdef I2CPE_DEBUG
|
#ifdef I2CPE_DEBUG
|
||||||
SERIAL_ECHOLNPGM("Current position is ", pos);
|
SERIAL_ECHOLNPAIR("Current position is ", pos);
|
||||||
SERIAL_ECHOLNPGM("Position in encoder ticks is ", positionInTicks);
|
SERIAL_ECHOLNPAIR("Position in encoder ticks is ", positionInTicks);
|
||||||
SERIAL_ECHOLNPGM("New zero-offset of ", zeroOffset);
|
SERIAL_ECHOLNPAIR("New zero-offset of ", zeroOffset);
|
||||||
SERIAL_ECHOPGM("New position reads as ", get_position());
|
SERIAL_ECHOPAIR("New position reads as ", get_position());
|
||||||
SERIAL_CHAR('(');
|
SERIAL_CHAR('(');
|
||||||
SERIAL_DECIMAL(mm_from_count(get_position()));
|
SERIAL_DECIMAL(mm_from_count(get_position()));
|
||||||
SERIAL_ECHOLNPGM(")");
|
SERIAL_ECHOLNPGM(")");
|
||||||
@@ -149,12 +149,12 @@ void I2CPositionEncoder::update() {
|
|||||||
const int32_t error = get_axis_error_steps(false);
|
const int32_t error = get_axis_error_steps(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//SERIAL_ECHOLNPGM("Axis error steps: ", error);
|
//SERIAL_ECHOLNPAIR("Axis error steps: ", error);
|
||||||
|
|
||||||
#ifdef I2CPE_ERR_THRESH_ABORT
|
#ifdef I2CPE_ERR_THRESH_ABORT
|
||||||
if (ABS(error) > I2CPE_ERR_THRESH_ABORT * planner.settings.axis_steps_per_mm[encoderAxis]) {
|
if (ABS(error) > I2CPE_ERR_THRESH_ABORT * planner.settings.axis_steps_per_mm[encoderAxis]) {
|
||||||
//kill(PSTR("Significant Error"));
|
//kill(PSTR("Significant Error"));
|
||||||
SERIAL_ECHOLNPGM("Axis error over threshold, aborting!", error);
|
SERIAL_ECHOLNPAIR("Axis error over threshold, aborting!", error);
|
||||||
safe_delay(5000);
|
safe_delay(5000);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -173,7 +173,7 @@ void I2CPositionEncoder::update() {
|
|||||||
LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i];
|
LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i];
|
||||||
const int32_t errorP = int32_t(sumP * RECIPROCAL(I2CPE_ERR_PRST_ARRAY_SIZE));
|
const int32_t errorP = int32_t(sumP * RECIPROCAL(I2CPE_ERR_PRST_ARRAY_SIZE));
|
||||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||||
SERIAL_ECHOLNPGM(" : CORRECT ERR ", errorP * planner.steps_to_mm[encoderAxis], "mm");
|
SERIAL_ECHOLNPAIR(" : CORRECT ERR ", errorP * planner.steps_to_mm[encoderAxis], "mm");
|
||||||
babystep.add_steps(encoderAxis, -LROUND(errorP));
|
babystep.add_steps(encoderAxis, -LROUND(errorP));
|
||||||
errPrstIdx = 0;
|
errPrstIdx = 0;
|
||||||
}
|
}
|
||||||
@@ -193,7 +193,7 @@ void I2CPositionEncoder::update() {
|
|||||||
const millis_t ms = millis();
|
const millis_t ms = millis();
|
||||||
if (ELAPSED(ms, nextErrorCountTime)) {
|
if (ELAPSED(ms, nextErrorCountTime)) {
|
||||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||||
SERIAL_ECHOLNPGM(" : LARGE ERR ", error, "; diffSum=", diffSum);
|
SERIAL_ECHOLNPAIR(" : LARGE ERR ", error, "; diffSum=", diffSum);
|
||||||
errorCount++;
|
errorCount++;
|
||||||
nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS;
|
nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS;
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@ void I2CPositionEncoder::set_homed() {
|
|||||||
|
|
||||||
#ifdef I2CPE_DEBUG
|
#ifdef I2CPE_DEBUG
|
||||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||||
SERIAL_ECHOLNPGM(" axis encoder homed, offset of ", zeroOffset, " ticks.");
|
SERIAL_ECHOLNPAIR(" axis encoder homed, offset of ", zeroOffset, " ticks.");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -253,7 +253,7 @@ float I2CPositionEncoder::get_axis_error_mm(const bool report) {
|
|||||||
|
|
||||||
if (report) {
|
if (report) {
|
||||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||||
SERIAL_ECHOLNPGM(" axis target=", target, "mm; actual=", actual, "mm; err=", error, "mm");
|
SERIAL_ECHOLNPAIR(" axis target=", target, "mm; actual=", actual, "mm; err=", error, "mm");
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
@@ -288,7 +288,7 @@ int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) {
|
|||||||
|
|
||||||
if (report) {
|
if (report) {
|
||||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||||
SERIAL_ECHOLNPGM(" axis target=", target, "; actual=", encoderCountInStepperTicksScaled, "; err=", error);
|
SERIAL_ECHOLNPAIR(" axis target=", target, "; actual=", encoderCountInStepperTicksScaled, "; err=", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (suppressOutput) {
|
if (suppressOutput) {
|
||||||
@@ -424,15 +424,15 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) {
|
|||||||
|
|
||||||
travelledDistance = mm_from_count(ABS(stopCount - startCount));
|
travelledDistance = mm_from_count(ABS(stopCount - startCount));
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Attempted travel: ", travelDistance, "mm");
|
SERIAL_ECHOLNPAIR("Attempted travel: ", travelDistance, "mm");
|
||||||
SERIAL_ECHOLNPGM(" Actual travel: ", travelledDistance, "mm");
|
SERIAL_ECHOLNPAIR(" Actual travel: ", travelledDistance, "mm");
|
||||||
|
|
||||||
//Calculate new axis steps per unit
|
//Calculate new axis steps per unit
|
||||||
old_steps_mm = planner.settings.axis_steps_per_mm[encoderAxis];
|
old_steps_mm = planner.settings.axis_steps_per_mm[encoderAxis];
|
||||||
new_steps_mm = (old_steps_mm * travelDistance) / travelledDistance;
|
new_steps_mm = (old_steps_mm * travelDistance) / travelledDistance;
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Old steps/mm: ", old_steps_mm);
|
SERIAL_ECHOLNPAIR("Old steps/mm: ", old_steps_mm);
|
||||||
SERIAL_ECHOLNPGM("New steps/mm: ", new_steps_mm);
|
SERIAL_ECHOLNPAIR("New steps/mm: ", new_steps_mm);
|
||||||
|
|
||||||
//Save new value
|
//Save new value
|
||||||
planner.settings.axis_steps_per_mm[encoderAxis] = new_steps_mm;
|
planner.settings.axis_steps_per_mm[encoderAxis] = new_steps_mm;
|
||||||
@@ -449,7 +449,7 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) {
|
|||||||
|
|
||||||
if (iter > 1) {
|
if (iter > 1) {
|
||||||
total /= (float)iter;
|
total /= (float)iter;
|
||||||
SERIAL_ECHOLNPGM("Average steps/mm: ", total);
|
SERIAL_ECHOLNPAIR("Average steps/mm: ", total);
|
||||||
}
|
}
|
||||||
|
|
||||||
ec = oldec;
|
ec = oldec;
|
||||||
@@ -675,18 +675,18 @@ void I2CPositionEncodersMgr::change_module_address(const uint8_t oldaddr, const
|
|||||||
// First check 'new' address is not in use
|
// First check 'new' address is not in use
|
||||||
Wire.beginTransmission(I2C_ADDRESS(newaddr));
|
Wire.beginTransmission(I2C_ADDRESS(newaddr));
|
||||||
if (!Wire.endTransmission()) {
|
if (!Wire.endTransmission()) {
|
||||||
SERIAL_ECHOLNPGM("?There is already a device with that address on the I2C bus! (", newaddr, ")");
|
SERIAL_ECHOLNPAIR("?There is already a device with that address on the I2C bus! (", newaddr, ")");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now check that we can find the module on the oldaddr address
|
// Now check that we can find the module on the oldaddr address
|
||||||
Wire.beginTransmission(I2C_ADDRESS(oldaddr));
|
Wire.beginTransmission(I2C_ADDRESS(oldaddr));
|
||||||
if (Wire.endTransmission()) {
|
if (Wire.endTransmission()) {
|
||||||
SERIAL_ECHOLNPGM("?No module detected at this address! (", oldaddr, ")");
|
SERIAL_ECHOLNPAIR("?No module detected at this address! (", oldaddr, ")");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Module found at ", oldaddr, ", changing address to ", newaddr);
|
SERIAL_ECHOLNPAIR("Module found at ", oldaddr, ", changing address to ", newaddr);
|
||||||
|
|
||||||
// Change the modules address
|
// Change the modules address
|
||||||
Wire.beginTransmission(I2C_ADDRESS(oldaddr));
|
Wire.beginTransmission(I2C_ADDRESS(oldaddr));
|
||||||
@@ -722,11 +722,11 @@ void I2CPositionEncodersMgr::report_module_firmware(const uint8_t address) {
|
|||||||
// First check there is a module
|
// First check there is a module
|
||||||
Wire.beginTransmission(I2C_ADDRESS(address));
|
Wire.beginTransmission(I2C_ADDRESS(address));
|
||||||
if (Wire.endTransmission()) {
|
if (Wire.endTransmission()) {
|
||||||
SERIAL_ECHOLNPGM("?No module detected at this address! (", address, ")");
|
SERIAL_ECHOLNPAIR("?No module detected at this address! (", address, ")");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Requesting version info from module at address ", address, ":");
|
SERIAL_ECHOLNPAIR("Requesting version info from module at address ", address, ":");
|
||||||
|
|
||||||
Wire.beginTransmission(I2C_ADDRESS(address));
|
Wire.beginTransmission(I2C_ADDRESS(address));
|
||||||
Wire.write(I2CPE_SET_REPORT_MODE);
|
Wire.write(I2CPE_SET_REPORT_MODE);
|
||||||
@@ -773,13 +773,13 @@ int8_t I2CPositionEncodersMgr::parse() {
|
|||||||
else if (parser.seenval('I')) {
|
else if (parser.seenval('I')) {
|
||||||
|
|
||||||
if (!parser.has_value()) {
|
if (!parser.has_value()) {
|
||||||
SERIAL_ECHOLNPGM("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1, "]");
|
SERIAL_ECHOLNPAIR("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1, "]");
|
||||||
return I2CPE_PARSE_ERR;
|
return I2CPE_PARSE_ERR;
|
||||||
};
|
};
|
||||||
|
|
||||||
I2CPE_idx = parser.value_byte();
|
I2CPE_idx = parser.value_byte();
|
||||||
if (I2CPE_idx >= I2CPE_ENCODER_CNT) {
|
if (I2CPE_idx >= I2CPE_ENCODER_CNT) {
|
||||||
SERIAL_ECHOLNPGM("?Index out of range. [0-", I2CPE_ENCODER_CNT - 1, "]");
|
SERIAL_ECHOLNPAIR("?Index out of range. [0-", I2CPE_ENCODER_CNT - 1, "]");
|
||||||
return I2CPE_PARSE_ERR;
|
return I2CPE_PARSE_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -954,7 +954,7 @@ void I2CPositionEncodersMgr::M864() {
|
|||||||
else return;
|
else return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Changing module at address ", I2CPE_addr, " to address ", newAddress);
|
SERIAL_ECHOLNPAIR("Changing module at address ", I2CPE_addr, " to address ", newAddress);
|
||||||
|
|
||||||
change_module_address(I2CPE_addr, newAddress);
|
change_module_address(I2CPE_addr, newAddress);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ class I2CPositionEncodersMgr {
|
|||||||
|
|
||||||
static void report_status(const int8_t idx) {
|
static void report_status(const int8_t idx) {
|
||||||
CHECK_IDX();
|
CHECK_IDX();
|
||||||
SERIAL_ECHOLNPGM("Encoder ", idx, ": ");
|
SERIAL_ECHOLNPAIR("Encoder ", idx, ": ");
|
||||||
encoders[idx].get_raw_count();
|
encoders[idx].get_raw_count();
|
||||||
encoders[idx].passes_test(true);
|
encoders[idx].passes_test(true);
|
||||||
}
|
}
|
||||||
@@ -261,32 +261,32 @@ class I2CPositionEncodersMgr {
|
|||||||
|
|
||||||
static void report_error_count(const int8_t idx, const AxisEnum axis) {
|
static void report_error_count(const int8_t idx, const AxisEnum axis) {
|
||||||
CHECK_IDX();
|
CHECK_IDX();
|
||||||
SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(axis_codes[axis]), " axis is ", encoders[idx].get_error_count());
|
SERIAL_ECHOLNPAIR("Error count on ", AS_CHAR(axis_codes[axis]), " axis is ", encoders[idx].get_error_count());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reset_error_count(const int8_t idx, const AxisEnum axis) {
|
static void reset_error_count(const int8_t idx, const AxisEnum axis) {
|
||||||
CHECK_IDX();
|
CHECK_IDX();
|
||||||
encoders[idx].set_error_count(0);
|
encoders[idx].set_error_count(0);
|
||||||
SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(axis_codes[axis]), " axis has been reset.");
|
SERIAL_ECHOLNPAIR("Error count on ", AS_CHAR(axis_codes[axis]), " axis has been reset.");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void enable_ec(const int8_t idx, const bool enabled, const AxisEnum axis) {
|
static void enable_ec(const int8_t idx, const bool enabled, const AxisEnum axis) {
|
||||||
CHECK_IDX();
|
CHECK_IDX();
|
||||||
encoders[idx].set_ec_enabled(enabled);
|
encoders[idx].set_ec_enabled(enabled);
|
||||||
SERIAL_ECHOPGM("Error correction on ", AS_CHAR(axis_codes[axis]));
|
SERIAL_ECHOPAIR("Error correction on ", AS_CHAR(axis_codes[axis]));
|
||||||
SERIAL_ECHO_TERNARY(encoders[idx].get_ec_enabled(), " axis is ", "en", "dis", "abled.\n");
|
SERIAL_ECHO_TERNARY(encoders[idx].get_ec_enabled(), " axis is ", "en", "dis", "abled.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) {
|
static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) {
|
||||||
CHECK_IDX();
|
CHECK_IDX();
|
||||||
encoders[idx].set_ec_threshold(newThreshold);
|
encoders[idx].set_ec_threshold(newThreshold);
|
||||||
SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(axis_codes[axis]), " axis set to ", newThreshold, "mm.");
|
SERIAL_ECHOLNPAIR("Error correct threshold for ", AS_CHAR(axis_codes[axis]), " axis set to ", newThreshold, "mm.");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void get_ec_threshold(const int8_t idx, const AxisEnum axis) {
|
static void get_ec_threshold(const int8_t idx, const AxisEnum axis) {
|
||||||
CHECK_IDX();
|
CHECK_IDX();
|
||||||
const float threshold = encoders[idx].get_ec_threshold();
|
const float threshold = encoders[idx].get_ec_threshold();
|
||||||
SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(axis_codes[axis]), " axis is ", threshold, "mm.");
|
SERIAL_ECHOLNPAIR("Error correct threshold for ", AS_CHAR(axis_codes[axis]), " axis is ", threshold, "mm.");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int8_t idx_from_axis(const AxisEnum axis) {
|
static int8_t idx_from_axis(const AxisEnum axis) {
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ void MarlinEthernet::check() {
|
|||||||
" | Author: " STRING_CONFIG_H_AUTHOR
|
" | Author: " STRING_CONFIG_H_AUTHOR
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
telnetClient.println(" Compiled: " __DATE__);
|
telnetClient.println("Compiled: " __DATE__);
|
||||||
|
|
||||||
SERIAL_ECHOLNPGM("Client connected");
|
SERIAL_ECHOLNPGM("Client connected");
|
||||||
have_telnet_client = true;
|
have_telnet_client = true;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ FWRetract fwretract; // Single instance - this calls the constructor
|
|||||||
#include "../module/planner.h"
|
#include "../module/planner.h"
|
||||||
#include "../module/stepper.h"
|
#include "../module/stepper.h"
|
||||||
|
|
||||||
#include "../gcode/gcode.h"
|
#include "../gcode/parser.h"
|
||||||
|
|
||||||
#if ENABLED(RETRACT_SYNC_MIXING)
|
#if ENABLED(RETRACT_SYNC_MIXING)
|
||||||
#include "mixing.h"
|
#include "mixing.h"
|
||||||
@@ -106,20 +106,20 @@ void FWRetract::retract(const bool retracting OPTARG(HAS_MULTI_EXTRUDER, bool sw
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* // debugging
|
/* // debugging
|
||||||
SERIAL_ECHOLNPGM(
|
SERIAL_ECHOLNPAIR(
|
||||||
"retracting ", AS_DIGIT(retracting),
|
"retracting ", AS_DIGIT(retracting),
|
||||||
" swapping ", swapping,
|
" swapping ", swapping,
|
||||||
" active extruder ", active_extruder
|
" active extruder ", active_extruder
|
||||||
);
|
);
|
||||||
LOOP_L_N(i, EXTRUDERS) {
|
LOOP_L_N(i, EXTRUDERS) {
|
||||||
SERIAL_ECHOLNPGM("retracted[", i, "] ", AS_DIGIT(retracted[i]));
|
SERIAL_ECHOLNPAIR("retracted[", i, "] ", AS_DIGIT(retracted[i]));
|
||||||
#if HAS_MULTI_EXTRUDER
|
#if HAS_MULTI_EXTRUDER
|
||||||
SERIAL_ECHOLNPGM("retracted_swap[", i, "] ", AS_DIGIT(retracted_swap[i]));
|
SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", AS_DIGIT(retracted_swap[i]));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
SERIAL_ECHOLNPGM("current_position.z ", current_position.z);
|
SERIAL_ECHOLNPAIR("current_position.z ", current_position.z);
|
||||||
SERIAL_ECHOLNPGM("current_position.e ", current_position.e);
|
SERIAL_ECHOLNPAIR("current_position.e ", current_position.e);
|
||||||
SERIAL_ECHOLNPGM("current_hop ", current_hop);
|
SERIAL_ECHOLNPAIR("current_hop ", current_hop);
|
||||||
//*/
|
//*/
|
||||||
|
|
||||||
const float base_retract = TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS))
|
const float base_retract = TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS))
|
||||||
@@ -181,18 +181,18 @@ void FWRetract::retract(const bool retracting OPTARG(HAS_MULTI_EXTRUDER, bool sw
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* // debugging
|
/* // debugging
|
||||||
SERIAL_ECHOLNPGM("retracting ", AS_DIGIT(retracting));
|
SERIAL_ECHOLNPAIR("retracting ", AS_DIGIT(retracting));
|
||||||
SERIAL_ECHOLNPGM("swapping ", AS_DIGIT(swapping));
|
SERIAL_ECHOLNPAIR("swapping ", AS_DIGIT(swapping));
|
||||||
SERIAL_ECHOLNPGM("active_extruder ", active_extruder);
|
SERIAL_ECHOLNPAIR("active_extruder ", active_extruder);
|
||||||
LOOP_L_N(i, EXTRUDERS) {
|
LOOP_L_N(i, EXTRUDERS) {
|
||||||
SERIAL_ECHOLNPGM("retracted[", i, "] ", AS_DIGIT(retracted[i]));
|
SERIAL_ECHOLNPAIR("retracted[", i, "] ", AS_DIGIT(retracted[i]));
|
||||||
#if HAS_MULTI_EXTRUDER
|
#if HAS_MULTI_EXTRUDER
|
||||||
SERIAL_ECHOLNPGM("retracted_swap[", i, "] ", AS_DIGIT(retracted_swap[i]));
|
SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", AS_DIGIT(retracted_swap[i]));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
SERIAL_ECHOLNPGM("current_position.z ", current_position.z);
|
SERIAL_ECHOLNPAIR("current_position.z ", current_position.z);
|
||||||
SERIAL_ECHOLNPGM("current_position.e ", current_position.e);
|
SERIAL_ECHOLNPAIR("current_position.e ", current_position.e);
|
||||||
SERIAL_ECHOLNPGM("current_hop ", current_hop);
|
SERIAL_ECHOLNPAIR("current_hop ", current_hop);
|
||||||
//*/
|
//*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,8 +214,9 @@ void FWRetract::M207() {
|
|||||||
if (parser.seenval('W')) settings.swap_retract_length = parser.value_axis_units(E_AXIS);
|
if (parser.seenval('W')) settings.swap_retract_length = parser.value_axis_units(E_AXIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FWRetract::M207_report() {
|
void FWRetract::M207_report(const bool forReplay/*=false*/) {
|
||||||
SERIAL_ECHOLNPGM_P(
|
if (!forReplay) { SERIAL_ECHO_MSG("; Retract: S<length> F<units/m> Z<lift>"); SERIAL_ECHO_START(); }
|
||||||
|
SERIAL_ECHOLNPAIR_P(
|
||||||
PSTR(" M207 S"), LINEAR_UNIT(settings.retract_length)
|
PSTR(" M207 S"), LINEAR_UNIT(settings.retract_length)
|
||||||
, PSTR(" W"), LINEAR_UNIT(settings.swap_retract_length)
|
, PSTR(" W"), LINEAR_UNIT(settings.swap_retract_length)
|
||||||
, PSTR(" F"), LINEAR_UNIT(MMS_TO_MMM(settings.retract_feedrate_mm_s))
|
, PSTR(" F"), LINEAR_UNIT(MMS_TO_MMM(settings.retract_feedrate_mm_s))
|
||||||
@@ -239,8 +240,9 @@ void FWRetract::M208() {
|
|||||||
if (parser.seen('W')) settings.swap_retract_recover_extra = parser.value_axis_units(E_AXIS);
|
if (parser.seen('W')) settings.swap_retract_recover_extra = parser.value_axis_units(E_AXIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FWRetract::M208_report() {
|
void FWRetract::M208_report(const bool forReplay/*=false*/) {
|
||||||
SERIAL_ECHOLNPGM(
|
if (!forReplay) { SERIAL_ECHO_MSG("; Recover: S<length> F<units/m>"); SERIAL_ECHO_START(); }
|
||||||
|
SERIAL_ECHOLNPAIR(
|
||||||
" M208 S", LINEAR_UNIT(settings.retract_recover_extra)
|
" M208 S", LINEAR_UNIT(settings.retract_recover_extra)
|
||||||
, " W", LINEAR_UNIT(settings.swap_retract_recover_extra)
|
, " W", LINEAR_UNIT(settings.swap_retract_recover_extra)
|
||||||
, " F", LINEAR_UNIT(MMS_TO_MMM(settings.retract_recover_feedrate_mm_s))
|
, " F", LINEAR_UNIT(MMS_TO_MMM(settings.retract_recover_feedrate_mm_s))
|
||||||
@@ -260,8 +262,9 @@ void FWRetract::M208_report() {
|
|||||||
enable_autoretract(parser.value_bool());
|
enable_autoretract(parser.value_bool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FWRetract::M209_report() {
|
void FWRetract::M209_report(const bool forReplay/*=false*/) {
|
||||||
SERIAL_ECHOLNPGM(" M209 S", AS_DIGIT(autoretract_enabled));
|
if (!forReplay) { SERIAL_ECHO_MSG("; Auto-Retract: S=0 to disable, 1 to interpret E-only moves as retract/recover"); SERIAL_ECHO_START(); }
|
||||||
|
SERIAL_ECHOLNPAIR(" M209 S", AS_DIGIT(autoretract_enabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // FWRETRACT_AUTORETRACT
|
#endif // FWRETRACT_AUTORETRACT
|
||||||
|
|||||||
@@ -76,13 +76,13 @@ public:
|
|||||||
|
|
||||||
static void retract(const bool retracting OPTARG(HAS_MULTI_EXTRUDER, bool swapping = false));
|
static void retract(const bool retracting OPTARG(HAS_MULTI_EXTRUDER, bool swapping = false));
|
||||||
|
|
||||||
static void M207_report();
|
|
||||||
static void M207();
|
static void M207();
|
||||||
static void M208_report();
|
static void M207_report(const bool forReplay=false);
|
||||||
static void M208();
|
static void M208();
|
||||||
|
static void M208_report(const bool forReplay=false);
|
||||||
#if ENABLED(FWRETRACT_AUTORETRACT)
|
#if ENABLED(FWRETRACT_AUTORETRACT)
|
||||||
static void M209_report();
|
|
||||||
static void M209();
|
static void M209();
|
||||||
|
static void M209_report(const bool forReplay=false);
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -68,13 +68,13 @@ Joystick joystick;
|
|||||||
void Joystick::report() {
|
void Joystick::report() {
|
||||||
SERIAL_ECHOPGM("Joystick");
|
SERIAL_ECHOPGM("Joystick");
|
||||||
#if HAS_JOY_ADC_X
|
#if HAS_JOY_ADC_X
|
||||||
SERIAL_ECHOPGM_P(SP_X_STR, JOY_X(x.raw));
|
SERIAL_ECHOPAIR_P(SP_X_STR, JOY_X(x.raw));
|
||||||
#endif
|
#endif
|
||||||
#if HAS_JOY_ADC_Y
|
#if HAS_JOY_ADC_Y
|
||||||
SERIAL_ECHOPGM_P(SP_Y_STR, JOY_Y(y.raw));
|
SERIAL_ECHOPAIR_P(SP_Y_STR, JOY_Y(y.raw));
|
||||||
#endif
|
#endif
|
||||||
#if HAS_JOY_ADC_Z
|
#if HAS_JOY_ADC_Z
|
||||||
SERIAL_ECHOPGM_P(SP_Z_STR, JOY_Z(z.raw));
|
SERIAL_ECHOPAIR_P(SP_Z_STR, JOY_Z(z.raw));
|
||||||
#endif
|
#endif
|
||||||
#if HAS_JOY_ADC_EN
|
#if HAS_JOY_ADC_EN
|
||||||
SERIAL_ECHO_TERNARY(READ(JOY_EN_PIN), " EN=", "HIGH (dis", "LOW (en", "abled)");
|
SERIAL_ECHO_TERNARY(READ(JOY_EN_PIN), " EN=", "HIGH (dis", "LOW (en", "abled)");
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ void PCA9533_init() {
|
|||||||
PCA9533_reset();
|
PCA9533_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PCA9533_writeAllRegisters(uint8_t psc0, uint8_t pwm0, uint8_t psc1, uint8_t pwm1, uint8_t ls0) {
|
static void PCA9533_writeAllRegisters(uint8_t psc0, uint8_t pwm0, uint8_t psc1, uint8_t pwm1, uint8_t ls0){
|
||||||
uint8_t data[6] = { PCA9533_REG_PSC0 | PCA9533_REGM_AI, psc0, pwm0, psc1, pwm1, ls0 };
|
uint8_t data[6] = { PCA9533_REG_PSC0 | PCA9533_REGM_AI, psc0, pwm0, psc1, pwm1, ls0 };
|
||||||
Wire.beginTransmission(PCA9533_Addr >> 1);
|
Wire.beginTransmission(PCA9533_Addr >> 1);
|
||||||
Wire.write(data, 6);
|
Wire.write(data, 6);
|
||||||
@@ -44,7 +44,7 @@ static void PCA9533_writeAllRegisters(uint8_t psc0, uint8_t pwm0, uint8_t psc1,
|
|||||||
delayMicroseconds(1);
|
delayMicroseconds(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PCA9533_writeRegister(uint8_t reg, uint8_t val) {
|
static void PCA9533_writeRegister(uint8_t reg, uint8_t val){
|
||||||
uint8_t data[2] = { reg, val };
|
uint8_t data[2] = { reg, val };
|
||||||
Wire.beginTransmission(PCA9533_Addr >> 1);
|
Wire.beginTransmission(PCA9533_Addr >> 1);
|
||||||
Wire.write(data, 2);
|
Wire.write(data, 2);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user