Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
67d82ff
🐛 Followup to JyersUI
thinkyhead Sep 10, 2021
ce6d622
🩹 Fix TOUCH_UI_FTDI_EVE warnings
thinkyhead Sep 11, 2021
69ab2bc
[cron] Bump distribution date (2021-09-11)
thinkyhead Sep 11, 2021
209dca1
🚸 Enhance FTDI Eve Touch UI file select dialog (#22742)
marciot Sep 11, 2021
0a1211f
🐛 Fix LPC1768 SD-based EEPROM debug
thinkyhead Sep 11, 2021
953d283
🐛 Followup to E3V2 Enhanced
thinkyhead Sep 11, 2021
453e609
🐛 Followup to JyersUI
thinkyhead Sep 11, 2021
6b9b2c5
🩹 Warn about user feedback requirement
thinkyhead Sep 11, 2021
011329f
🐛 No probe enum for DELTA + SENSORLESS_PROBING
thinkyhead Sep 11, 2021
08e581d
🎨 Apply more HAS_DELTA_SENSORLESS_PROBING
thinkyhead Sep 11, 2021
afe4cb7
[cron] Bump distribution date (2021-09-12)
thinkyhead Sep 12, 2021
3a457c9
🐛 Fix JyersUI for LPC176x (#22745)
tome9111991 Sep 12, 2021
c9d54bc
🐛 Fix Trigorilla Pro HAL/STM32 build offset (#22761)
ellensp Sep 12, 2021
37c488f
🚸 G33 R and O options (#22707)
LVD-AC Sep 13, 2021
29d3996
📌 Creality 4.3.1 board variants (#22704)
thinkyhead Sep 13, 2021
84f6662
[cron] Bump distribution date (2021-09-13)
thinkyhead Sep 13, 2021
ea7e777
🎨 Tweak custom menu item code
thinkyhead Sep 13, 2021
2446005
✨ MKS Robin Nano V1.3 (STM32F407VET6) (#22749)
mks-viva Sep 13, 2021
d69c053
🐛 Fix ENABLED => EITHER typo (#22756)
Vertabreak Sep 13, 2021
000d412
🐛 Fix CUSTOM_MENU_MAIN_SCRIPT_DONE
thinkyhead Sep 13, 2021
798a8a7
🔧 SPINDLE_LASER_PWM => SPINDLE_LASER_USE_PWM
thinkyhead Sep 13, 2021
3587ef2
🐛 Fix old spindle/laser options
thinkyhead Sep 13, 2021
370ea11
🌐 Update Slovak language (#22752)
rmoravcik Sep 13, 2021
23d10ce
🎨 Use ExtUI API where applicable
Desuuuu Sep 10, 2021
5a04cf0
🔖 Configurations version 02000902
thinkyhead Sep 13, 2021
ae22a92
[cron] Bump distribution date (2021-09-14)
thinkyhead Sep 14, 2021
c2e4b16
✨ TFT Screen/Backlight Sleep (#22617)
tpruvot Sep 14, 2021
21e8f99
✨ M282 - Detach Servo (#22760)
Dakkaron Sep 15, 2021
9c8ad57
[cron] Bump distribution date (2021-09-15)
thinkyhead Sep 15, 2021
8235ae9
🩹 Fix DWIN Enhanced Tune menu during homing (#22773)
mriscoc Sep 15, 2021
a1e1555
🐛 Fix MKS Monster8 EEPROM issue (serial timer) (#22777)
mks-viva Sep 15, 2021
cca3250
✏️ Fix TFT field names (#22776)
thisiskeithb Sep 15, 2021
5b5a879
🎨 Consolidate Ender-3 V2 DWIN common code (#22778)
thinkyhead Sep 16, 2021
e31d521
🎨 Handle more pre-defined pins in pins_postprocess (#22771)
thinkyhead Sep 16, 2021
0cc17b9
[cron] Bump distribution date (2021-09-16)
thinkyhead Sep 16, 2021
02ae11e
🔧 Add MANUAL_FEEDRATE sanity-check
thinkyhead Sep 16, 2021
08a40c4
✨ Improve pause/filament change for ExtUI (#22655)
InsanityAutomation Sep 16, 2021
323b38e
💡 Adjust headers, formatting
thinkyhead Sep 16, 2021
8df3e62
🚸 Fix and improve MKS LVGL UI (#22783)
Sep 16, 2021
46dfc7b
[cron] Bump distribution date (2021-09-17)
thinkyhead Sep 17, 2021
11fce69
[cron] Bump distribution date (2021-09-18)
thinkyhead Sep 18, 2021
fede20f
💬 Add non-translated STR_DONE
thinkyhead Sep 17, 2021
ad38699
🚸 Better bed position
thinkyhead Apr 12, 2021
f46e05f
🚸 Move fade item up
thinkyhead Sep 18, 2021
d7e597f
🐛 STM32 ADC Resolution = 12 bit (or ADC_RESOLUTION) (#22789)
CRCinAU Sep 18, 2021
f367a39
📝 Update some pins comments
thinkyhead Sep 18, 2021
c88e85c
🎨 Replace some infrequently-used macros
thinkyhead Sep 18, 2021
89125cd
🚸 Wake up TFT for some events (#22788)
tpruvot Sep 18, 2021
a6b69ab
[cron] Bump distribution date (2021-09-19)
thinkyhead Sep 19, 2021
10fda22
🐛 STM32 ADC followup (#22798)
tpruvot Sep 19, 2021
c1d7e23
🌐 Reduce language file sizes
thinkyhead Sep 19, 2021
0082849
🔨 Case-insensitive tests list
thinkyhead Sep 19, 2021
216a66b
🌐 Skip non-essential translations
thinkyhead Sep 20, 2021
e60e4b8
🌐 Update Greek language (#22799)
lefterisgar Sep 20, 2021
f3864a1
[cron] Bump distribution date (2021-09-20)
thinkyhead Sep 20, 2021
3344071
Polargraph / Makelangelo kinematics (#22790)
i-make-robots Sep 20, 2021
5830183
🩹 Remove extra #include, misc. style
thinkyhead Sep 20, 2021
5b934e0
[cron] Bump distribution date (2021-09-21)
thinkyhead Sep 21, 2021
58adb84
🔨 Improve pins_set script
thinkyhead Sep 21, 2021
b88117d
🎨 Fix L64xx enable, clean up conditionals
thinkyhead Sep 21, 2021
0387f94
[cron] Bump distribution date (2021-09-22)
thinkyhead Sep 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 18 additions & 6 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*
* Advanced settings can be found in Configuration_adv.h
*/
#define CONFIGURATION_H_VERSION 02000901
#define CONFIGURATION_H_VERSION 02000902

//===========================================================================
//============================= Getting Started =============================
Expand Down Expand Up @@ -761,6 +761,13 @@
// Enable for a belt style printer with endless "Z" motion
//#define BELTPRINTER

// Enable for Polargraph Kinematics
//#define POLARGRAPH
#if ENABLED(POLARGRAPH)
#define POLARGRAPH_MAX_BELT_LEN 1035.0
#define POLAR_SEGMENTS_PER_SECOND 5
#endif

//===========================================================================
//============================== Endstop Settings ===========================
//===========================================================================
Expand Down Expand Up @@ -2044,10 +2051,10 @@
*
* Select the language to display on the LCD. These languages are available:
*
* en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, hu, it,
* en, an, bg, ca, cz, da, de, el, el_CY, es, eu, fi, fr, gl, hr, hu, it,
* jp_kana, ko_KR, nl, pl, pt, pt_br, ro, ru, sk, sv, tr, uk, vi, zh_CN, zh_TW
*
* :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'hu':'Hungarian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ro':'Romanian', 'ru':'Russian', 'sk':'Slovak', 'sv':'Swedish', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)' }
* :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek (Greece)', 'el_CY':'Greek (Cyprus)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'hu':'Hungarian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ro':'Romanian', 'ru':'Russian', 'sk':'Slovak', 'sv':'Swedish', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)' }
*/
#define LCD_LANGUAGE en

Expand Down Expand Up @@ -2566,7 +2573,7 @@
// - Copy the downloaded DWIN_SET folder to the SD card.
//
// RELOADED (T5UID1)
// - Download https://github.com/Desuuuu/DGUS-reloaded
// - Download https://github.com/Desuuuu/DGUS-reloaded/releases
// - Copy the downloaded DWIN_SET folder to the SD card.
//
//#define DGUS_LCD_UI_ORIGIN
Expand Down Expand Up @@ -2780,6 +2787,8 @@
#define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus

//#define TOUCH_IDLE_SLEEP 300 // (secs) Turn off the TFT backlight if set (5mn)

#define TOUCH_SCREEN_CALIBRATION

//#define TOUCH_CALIBRATION_X 12316
Expand Down Expand Up @@ -2934,9 +2943,9 @@
* Set this manually if there are extra servos needing manual control.
* Set to 0 to turn off servo support.
*/
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
//#define NUM_SERVOS 3 // Note: Servo index starts with 0 for M280-M282 commands

// (ms) Delay before the next move will start, to give the servo time to reach its target angle.
// (ms) Delay before the next move will start, to give the servo time to reach its target angle.
// 300ms is a good value but you can try less delay.
// If the servo can't reach the requested position, increase it.
#define SERVO_DELAY { 300 }
Expand All @@ -2946,3 +2955,6 @@

// Edit servo angles with M281 and save to EEPROM with M500
//#define EDITABLE_SERVO_ANGLES

// Disable servo with M282 to reduce power consumption, noise, and heat when not in use
//#define SERVO_DETACH_GCODE
34 changes: 21 additions & 13 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* Basic settings can be found in Configuration.h
*/
#define CONFIGURATION_ADV_H_VERSION 02000901
#define CONFIGURATION_ADV_H_VERSION 02000902

//===========================================================================
//============================= Thermal Settings ============================
Expand Down Expand Up @@ -2425,6 +2425,8 @@
#define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety.
#define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed.
#define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change.
//#define FILAMENT_CHANGE_RESUME_ON_INSERT // Automatically continue / load filament when runout sensor is triggered again.
//#define PAUSE_REHEAT_FAST_RESUME // Reduce number of waits by not prompting again post-timeout before continuing.

//#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
Expand Down Expand Up @@ -3323,11 +3325,13 @@
//#define SPINDLE_FEATURE
//#define LASER_FEATURE
#if EITHER(SPINDLE_FEATURE, LASER_FEATURE)
#define SPINDLE_LASER_ACTIVE_STATE LOW // Set to "HIGH" if the on/off function is active HIGH
#define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power
#define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower
#define SPINDLE_LASER_ACTIVE_STATE LOW // Set to "HIGH" if SPINDLE_LASER_ENA_PIN is active HIGH

#define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC)
#define SPINDLE_LASER_USE_PWM // Enable if your controller supports setting the speed/power
#if ENABLED(SPINDLE_LASER_USE_PWM)
#define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower
#define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC)
#endif

//#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11
#if ENABLED(AIR_EVACUATION)
Expand Down Expand Up @@ -3383,17 +3387,21 @@
* Speed/Power = (PWMDC / 255 * 100 - SPEED_POWER_INTERCEPT) / SPEED_POWER_SLOPE
* PWMDC = (spdpwr - SPEED_POWER_MIN) / (SPEED_POWER_MAX - SPEED_POWER_MIN) / SPEED_POWER_SLOPE
*/
#define SPEED_POWER_INTERCEPT 0 // (%) 0-100 i.e., Minimum power percentage
#define SPEED_POWER_MIN 5000 // (RPM)
#define SPEED_POWER_MAX 30000 // (RPM) SuperPID router controller 0 - 30,000 RPM
#define SPEED_POWER_STARTUP 25000 // (RPM) M3/M4 speed/power default (with no arguments)
#if ENABLED(SPINDLE_LASER_USE_PWM)
#define SPEED_POWER_INTERCEPT 0 // (%) 0-100 i.e., Minimum power percentage
#define SPEED_POWER_MIN 5000 // (RPM)
#define SPEED_POWER_MAX 30000 // (RPM) SuperPID router controller 0 - 30,000 RPM
#define SPEED_POWER_STARTUP 25000 // (RPM) M3/M4 speed/power default (with no arguments)
#endif

#else

#define SPEED_POWER_INTERCEPT 0 // (%) 0-100 i.e., Minimum power percentage
#define SPEED_POWER_MIN 0 // (%) 0-100
#define SPEED_POWER_MAX 100 // (%) 0-100
#define SPEED_POWER_STARTUP 80 // (%) M3/M4 speed/power default (with no arguments)
#if ENABLED(SPINDLE_LASER_USE_PWM)
#define SPEED_POWER_INTERCEPT 0 // (%) 0-100 i.e., Minimum power percentage
#define SPEED_POWER_MIN 0 // (%) 0-100
#define SPEED_POWER_MAX 100 // (%) 0-100
#define SPEED_POWER_STARTUP 80 // (%) M3/M4 speed/power default (with no arguments)
#endif

// Define the minimum and maximum test pulse time values for a laser test fire function
#define LASER_TEST_PULSE_MIN 1 // Used with Laser Control Menu
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2021-09-10"
//#define STRING_DISTRIBUTION_DATE "2021-09-22"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/AVR/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
/**
* Sanity checks for Spindle / Laser PWM
*/
#if ENABLED(SPINDLE_LASER_PWM)
#if ENABLED(SPINDLE_LASER_USE_PWM)
#include "../ServoTimers.h" // Needed to check timer availability (_useTimer3)
#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."
#elif NUM_SERVOS > 0 && defined(_useTimer3) && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5)
#error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system."
#endif
#elif defined(SPINDLE_LASER_FREQUENCY)
#error "SPINDLE_LASER_FREQUENCY requires SPINDLE_LASER_PWM."
#error "SPINDLE_LASER_FREQUENCY requires SPINDLE_LASER_USE_PWM."
#endif

/**
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/HAL/AVR/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* Marlin 3D Printer Firmware
* 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
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* Marlin 3D Printer Firmware
* 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
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/HAL/AVR/pinsDebug_plus_70.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* Marlin 3D Printer Firmware
* 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
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*
*/


/**
* Based on u8g_com_msp430_hw_spi.c
*
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/HAL/DUE/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* Marlin 3D Printer Firmware
* 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
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/HAL/ESP32/spi_pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* Marlin 3D Printer Firmware
* 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
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LINUX/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/

// Emulating RAMPS
#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
#if ENABLED(SPINDLE_LASER_USE_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"
#endif

Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/HAL/LINUX/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* Marlin 3D Printer Firmware
* 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
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand All @@ -16,6 +19,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

#ifdef __PLAT_LINUX__

//#define GPIO_LOGGING // Full GPIO and Positional Logging
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/HAL/LINUX/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* Marlin 3D Printer Firmware
* 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
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/HAL/LPC1768/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,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."
#endif
#if HAS_DGUS_LCD
#define SERIAL_GET_TX_BUFFER_FREE() MSerial0.available()
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.available()
#endif
#endif

Expand Down Expand Up @@ -156,17 +156,17 @@ int freeMemory();

using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
extern uint32_t HAL_adc_reading;
[[gnu::always_inline]] inline void HAL_start_adc(const pin_t pin) {
[[gnu::always_inline]] inline void HAL_adc_start_conversion(const pin_t pin) {
HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
}
[[gnu::always_inline]] inline uint16_t HAL_read_adc() {
[[gnu::always_inline]] inline uint16_t HAL_adc_get_result() {
return HAL_adc_reading;
}

#define HAL_adc_init()
#define HAL_ANALOG_SELECT(pin) FilteredADC::enable_channel(pin)
#define HAL_START_ADC(pin) HAL_start_adc(pin)
#define HAL_READ_ADC() HAL_read_adc()
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_get_result()
#define HAL_ADC_READY() (true)

// Test whether the pin is valid
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/HAL/LPC1768/MarlinSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class MarlinSerial : public HardwareSerial<RX_BUFFER_SIZE, TX_BUFFER_SIZE> {

void end() {}

uint8_t availableForWrite(void) { /* flushTX(); */ return TX_BUFFER_SIZE; }

#if ENABLED(EMERGENCY_PARSER)
bool recv_callback(const char c) override;
#endif
Expand Down
42 changes: 26 additions & 16 deletions Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/**
* Marlin 3D Printer Firmware
*
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins [email protected]
* Copyright (c) 2015-2016 Nico Tonnhofer [email protected]
* Copyright (c) 2016 Victor Perez [email protected]
*
* 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
* it under the terms of the GNU General Public License as published by
Expand All @@ -20,12 +19,19 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

/**
* Implementation of EEPROM settings in SD Card
*/

#ifdef TARGET_LPC1768

#include "../../inc/MarlinConfig.h"

#if ENABLED(SDCARD_EEPROM_EMULATION)

//#define DEBUG_SD_EEPROM_EMULATION

#include "../shared/eeprom_api.h"

#include <chanfs/diskio.h>
Expand All @@ -38,9 +44,11 @@ FATFS fat_fs;
FIL eeprom_file;
bool eeprom_file_open = false;

#define EEPROM_FILENAME "eeprom.dat"
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(0x1000) // 4KiB of Emulated EEPROM
#endif

size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }

bool PersistentStore::access_start() {
Expand All @@ -50,7 +58,7 @@ bool PersistentStore::access_start() {
MSC_Release_Lock();
return false;
}
FRESULT res = f_open(&eeprom_file, "eeprom.dat", FA_OPEN_ALWAYS | FA_WRITE | FA_READ);
FRESULT res = f_open(&eeprom_file, EEPROM_FILENAME, FA_OPEN_ALWAYS | FA_WRITE | FA_READ);
if (res) MSC_Release_Lock();

if (res == FR_OK) {
Expand Down Expand Up @@ -81,18 +89,20 @@ bool PersistentStore::access_finish() {
// This extra chit-chat goes away soon, but is helpful for now
// 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) {
PGM_P const rw_str = write ? PSTR("write") : PSTR("read");
SERIAL_CHAR(' ');
SERIAL_ECHOPGM_P(rw_str);
SERIAL_ECHOLNPGM("_data(", pos, ",", value, ",", size, ", ...)");
if (total) {
SERIAL_ECHOPGM(" f_");
#if ENABLED(DEBUG_SD_EEPROM_EMULATION)
PGM_P const rw_str = write ? PSTR("write") : PSTR("read");
SERIAL_CHAR(' ');
SERIAL_ECHOPGM_P(rw_str);
SERIAL_ECHOPGM("()=", s, "\n size=", size, "\n bytes_");
SERIAL_ECHOLNPGM_P(write ? PSTR("written=") : PSTR("read="), total);
}
else
SERIAL_ECHOLNPGM(" f_lseek()=", s);
SERIAL_ECHOLNPGM("_data(", pos, ",", *value, ",", size, ", ...)");
if (total) {
SERIAL_ECHOPGM(" f_");
SERIAL_ECHOPGM_P(rw_str);
SERIAL_ECHOPGM("()=", s, "\n size=", size, "\n bytes_");
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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LPC1768/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
//#if ENABLED(SPINDLE_LASER_USE_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"
//#endif

Expand Down
Loading