Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fc31016788 |
@@ -1,73 +0,0 @@
|
||||
#
|
||||
# ci-unit-tests.yml
|
||||
# Build and execute unit tests to catch functional issues in code
|
||||
#
|
||||
|
||||
name: CI - Unit Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
# Cannot be enabled on 2.1.x until it contains the unit test framework
|
||||
#- 2.1.x
|
||||
paths-ignore:
|
||||
- config/**
|
||||
- data/**
|
||||
- docs/**
|
||||
- '**/*.md'
|
||||
push:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
# Cannot be enabled on 2.1.x until it contains the unit test framework
|
||||
#- 2.1.x
|
||||
paths-ignore:
|
||||
- config/**
|
||||
- data/**
|
||||
- docs/**
|
||||
- '**/*.md'
|
||||
|
||||
jobs:
|
||||
# This runs all unit tests as a single job. While it should be possible to break this up into
|
||||
# multiple jobs, they currently run quickly and finish long before the compilation tests.
|
||||
run_unit_tests:
|
||||
name: Unit Test
|
||||
# These tests will only be able to run on the bugfix-2.1.x branch, until the next release
|
||||
# pulls them into additional branches.
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
|
||||
- name: Select Python 3.9
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
architecture: 'x64'
|
||||
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
pip install -U platformio
|
||||
pio upgrade --dev
|
||||
pio pkg update --global
|
||||
|
||||
- name: Run All Unit Tests
|
||||
run: |
|
||||
make unit-test-all-local
|
||||
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# ci-build-tests.yml
|
||||
# test-builds.yml
|
||||
# Do test builds to catch compile errors
|
||||
#
|
||||
|
||||
name: CI - Build Tests
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -27,7 +27,7 @@ on:
|
||||
|
||||
jobs:
|
||||
test_builds:
|
||||
name: Build Test
|
||||
name: Run All Tests
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
Binary file not shown.
Binary file not shown.
@@ -12,12 +12,7 @@ help:
|
||||
@echo "make tests-single-local-docker : Run a single test locally, using docker"
|
||||
@echo "make tests-all-local : Run all tests locally"
|
||||
@echo "make tests-all-local-docker : Run all tests locally, using docker"
|
||||
# @echo "make unit-test-single-ci : Run a single code test from inside the CI"
|
||||
# @echo "make unit-test-single-local : Run a single code test locally"
|
||||
# @echo "make unit-test-single-local-docker : Run a single code test locally, using docker-compose"
|
||||
@echo "make unit-test-all-local : Run all code tests locally"
|
||||
@echo "make unit-test-all-local-docker : Run all code tests locally, using docker-compose"
|
||||
@echo "make setup-local-docker : Setup local docker-compose"
|
||||
@echo "make setup-local-docker : Build the local docker image"
|
||||
@echo ""
|
||||
@echo "Options for testing:"
|
||||
@echo " TEST_TARGET Set when running tests-single-*, to select the"
|
||||
@@ -48,7 +43,7 @@ tests-single-local:
|
||||
tests-single-local-docker:
|
||||
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local-docker" ; return 1; fi
|
||||
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
|
||||
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)"
|
||||
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)"
|
||||
|
||||
tests-all-local:
|
||||
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
|
||||
@@ -57,31 +52,10 @@ tests-all-local:
|
||||
|
||||
tests-all-local-docker:
|
||||
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
|
||||
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)
|
||||
|
||||
#unit-test-single-ci:
|
||||
# export GIT_RESET_HARD=true
|
||||
# $(MAKE) unit-test-single-local TEST_TARGET=$(TEST_TARGET)
|
||||
|
||||
# TODO: How can we limit tests with ONLY_TEST with platformio?
|
||||
#unit-test-single-local:
|
||||
# @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make unit-test-all-local" ; return 1; fi
|
||||
# platformio run -t marlin_$(TEST_TARGET)
|
||||
|
||||
#unit-test-single-local-docker:
|
||||
# @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make unit-test-all-local-docker" ; return 1; fi
|
||||
# @if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
|
||||
# $(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make unit-test-single-local TEST_TARGET=$(TEST_TARGET) ONLY_TEST="$(ONLY_TEST)"
|
||||
|
||||
unit-test-all-local:
|
||||
platformio run -t test-marlin -e linux_native_test
|
||||
|
||||
unit-test-all-local-docker:
|
||||
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
|
||||
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make unit-test-all-local
|
||||
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)
|
||||
|
||||
setup-local-docker:
|
||||
$(CONTAINER_RT_BIN) buildx build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
|
||||
$(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
|
||||
|
||||
PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')
|
||||
|
||||
|
||||
+349
-1802
File diff suppressed because it is too large
Load Diff
+249
-395
File diff suppressed because it is too large
Load Diff
+36
-140
@@ -28,103 +28,55 @@
|
||||
/**
|
||||
* Marlin release version identifier
|
||||
*/
|
||||
#define SHORT_BUILD_VERSION "DW7.4.9"
|
||||
#define SHORT_BUILD_VERSION "2.1.2_Beta3"
|
||||
|
||||
/**
|
||||
* Verbose version identifier which should contain a reference to the location
|
||||
* from where the binary was downloaded or the source code was compiled.
|
||||
*/
|
||||
|
||||
#if(ENABLED(MachineMini))
|
||||
#define VerChar1 "M"
|
||||
#elif(ENABLED(MachineEnder2))
|
||||
#define VerChar1 "E2"
|
||||
#elif(ENABLED(MachineEnder2Pro))
|
||||
#define VerChar1 "E2P"
|
||||
#elif(ENABLED(MachineEnder3))
|
||||
#define VerChar1 "E3"
|
||||
#elif ENABLED(MachineEnder3V2)
|
||||
#define VerChar1 "E3V2"
|
||||
#elif ENABLED(MachineEnder3S1)
|
||||
#define VerChar1 "E3S1"
|
||||
#elif ENABLED(MachineEnder3Max)
|
||||
#define VerChar1 "E3M"
|
||||
#elif(ENABLED(MachineEnder4))
|
||||
#define VerChar1 "E4"
|
||||
#elif(ENABLED(MachineEnder5))
|
||||
#define VerChar1 "E5"
|
||||
#elif(ENABLED(MachineEnder6))
|
||||
#define VerChar1 "E6"
|
||||
#elif(ENABLED(MachineEnder7))
|
||||
#define VerChar1 "E7"
|
||||
#elif(ENABLED(MachineSermoonD1))
|
||||
#define VerChar1 "D1"
|
||||
#elif(ENABLED(MachineEnder5Plus))
|
||||
#define VerChar1 "E5P"
|
||||
#elif(ENABLED(MachineCR20))
|
||||
#define VerChar1 "2"
|
||||
#elif(ENABLED(MachineCR10Orig))
|
||||
#define VerChar1 "O"
|
||||
#elif(ENABLED(MachineCR10Std))
|
||||
#define VerChar1 "S"
|
||||
#elif(ENABLED(MachineCRX))
|
||||
#define VerChar1 "X"
|
||||
#elif(ENABLED(MachineCR6))
|
||||
#define VerChar1 "CR6"
|
||||
#elif(ENABLED(MachineCR5))
|
||||
#define VerChar1 "CR5"
|
||||
#elif(ENABLED(MachineCR6Max))
|
||||
#define VerChar1 "CR6M"
|
||||
#elif(ENABLED(MachineS4))
|
||||
#define VerChar1 "4"
|
||||
#elif(ENABLED(MachineS5) || ENABLED(MachineCR10Max))
|
||||
#define VerChar1 "5"
|
||||
#elif ENABLED(MachineCR2020)
|
||||
#define VerChar1 "20"
|
||||
#elif(ENABLED(MachineCR30))
|
||||
#define VerChar1 "CR30"
|
||||
#if(ENABLED(DriverA4988))
|
||||
#define VerChar1 "A"
|
||||
#elif(ENABLED(Driver2209))
|
||||
#define VerChar1 "T"
|
||||
#endif
|
||||
|
||||
#if(ENABLED(HotendStock))
|
||||
#define VerChar2 "S"
|
||||
#elif(ENABLED(HotendE3D))
|
||||
#define VerChar2 "E"
|
||||
#elif ENABLED(HotendMosquito)
|
||||
#define VerChar2 "M"
|
||||
#endif
|
||||
|
||||
#if(ENABLED(HotendAllMetal))
|
||||
#define VerChar3 "M"
|
||||
#if(ENABLED(BL_Touch))
|
||||
#define VerChar2 "B"
|
||||
#else
|
||||
#define VerChar3 "S"
|
||||
#define VerChar2 "E"
|
||||
#endif
|
||||
|
||||
#if(ENABLED(LOWRES_DWIN))
|
||||
#define VerChar3 "L"
|
||||
#else
|
||||
#define VerChar3 "H"
|
||||
#endif
|
||||
|
||||
|
||||
#if(ENABLED(BedAC))
|
||||
#define VerChar4 "A"
|
||||
#elif(ENABLED(BedDC))
|
||||
#define VerChar4 "D"
|
||||
#if(ENABLED(ACBed))
|
||||
#define VerChar4 "A"
|
||||
#else
|
||||
#define VerChar4 "N"
|
||||
#define VerChar4 "D"
|
||||
#endif
|
||||
|
||||
#if(ENABLED(ABL_EZABL))
|
||||
#define VerChar5 "A"
|
||||
#elif(ENABLED(ABL_BLTOUCH))
|
||||
#define VerChar5 "B"
|
||||
#if(ENABLED(OpticalY))
|
||||
#define VerChar5 "O"
|
||||
#else
|
||||
#define VerChar5 "N"
|
||||
#define VerChar5 "M"
|
||||
#endif
|
||||
|
||||
#if(ENABLED(ABL_UBL))
|
||||
#define VerChar6 "U"
|
||||
#elif(ENABLED(ABL_BI))
|
||||
#define VerChar6 "B"
|
||||
#if(ENABLED(TitanExtruder))
|
||||
#define VerChar6 "T"
|
||||
#elif ANY(BMGExtruderV2, BMGExtruderV3)
|
||||
#define VerChar6 "B"
|
||||
#elif ENABLED(BondtechLGX)
|
||||
#define VerChar6 "L"
|
||||
#else
|
||||
#define VerChar6 "N"
|
||||
#define VerChar6 "S"
|
||||
#endif
|
||||
|
||||
#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " TM3D " VerChar1 VerChar2 VerChar3 VerChar4 VerChar5 VerChar6
|
||||
#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION "_" VerChar1 VerChar2 VerChar3 VerChar4 VerChar5 VerChar6
|
||||
|
||||
/**
|
||||
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
|
||||
@@ -136,68 +88,12 @@
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
*/
|
||||
#if(ENABLED(MachineMini))
|
||||
#define CUSTOM_MACHINE_NAME "Mini SuPeR"
|
||||
#elif(ENABLED(MachineCR10Smart))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D CR10Smart"
|
||||
#elif(ENABLED(MachineCR10SmartPro))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D CR10SmartPro"
|
||||
#elif(ENABLED(MachineEnder2))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D Ender2"
|
||||
#elif(ENABLED(MachineEnder2Pro))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D Ender2 Pro"
|
||||
#elif(ENABLED(MachineEnder3))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D Ender3"
|
||||
#elif(ENABLED(MachineEnder3Max))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D E3Max"
|
||||
#elif(ENABLED(MachineEnder6))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D Ender6"
|
||||
#elif(ENABLED(MachineEnder7))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D Ender7"
|
||||
#elif(ENABLED(MachineEnder3V2))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D Ender3V2"
|
||||
#elif(ENABLED(MachineEnder3S1))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D Ender3S1"
|
||||
#elif(ENABLED(MachineEnder4))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D Ender4"
|
||||
#elif(ENABLED(MachineEnder5))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D Ender5"
|
||||
#elif(ENABLED(MachineEnder5Plus))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D E5 Plus"
|
||||
#elif(ENABLED(MachineCR20))
|
||||
#define CUSTOM_MACHINE_NAME "SuPeR CR-20"
|
||||
#elif(ENABLED(MachineCR10Orig))
|
||||
#define CUSTOM_MACHINE_NAME "SuPeR CR-10"
|
||||
#elif(ENABLED(MachineCRX))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D CR-X"
|
||||
#elif ENABLED(MachineCR10SProV2)
|
||||
#define CUSTOM_MACHINE_NAME "TM3D 10SProV2"
|
||||
#elif(ENABLED(MachineCR10SPro))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D 10S Pro"
|
||||
#elif(ENABLED(MachineCR10Max))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D Max"
|
||||
#elif(ENABLED(MachineCR10SV3))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D CR10V3"
|
||||
#elif(ENABLED(MachineCR10SV2))
|
||||
#define CUSTOM_MACHINE_NAME "TM3D CR10V2"
|
||||
#elif(ENABLED(MachineCR10Std))
|
||||
#define CUSTOM_MACHINE_NAME "300 SuPeR"
|
||||
#elif(ENABLED(MachineS4))
|
||||
#define CUSTOM_MACHINE_NAME "400 SuPeR"
|
||||
#elif(ENABLED(MachineS5))
|
||||
#define CUSTOM_MACHINE_NAME "500 SuPeR"
|
||||
#elif ENABLED(MachineCR2020)
|
||||
#define CUSTOM_MACHINE_NAME "TM3D 2020"
|
||||
#elif ENABLED(MachineSermoonD1)
|
||||
#define CUSTOM_MACHINE_NAME "SermoonD1"
|
||||
#elif ENABLED(MachineCR5)
|
||||
#define CUSTOM_MACHINE_NAME "CR5 Pro"
|
||||
#elif ENABLED(MachineCR6)
|
||||
#define CUSTOM_MACHINE_NAME "CR6"
|
||||
#elif ENABLED(MachineCR6Max)
|
||||
#define CUSTOM_MACHINE_NAME "CR6 Max"
|
||||
#elif ENABLED(MachineCR30)
|
||||
#define CUSTOM_MACHINE_NAME "CR30 Printmill"
|
||||
#if(ENABLED(MachineTLD3P))
|
||||
#define CUSTOM_MACHINE_NAME "LNL D3Pro"
|
||||
#elif(ENABLED(MachineTLD5))
|
||||
#define CUSTOM_MACHINE_NAME "LNL D5Pro"
|
||||
#elif(ENABLED(MachineTLD6))
|
||||
#define CUSTOM_MACHINE_NAME "LNL D6Pro"
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -206,7 +102,7 @@
|
||||
* has a distinct Github fork— the Source Code URL should just be the main
|
||||
* Marlin repository.
|
||||
*/
|
||||
#define SOURCE_CODE_URL "https://github.com/InsanityAutomation/Marlin/tree/CrealityDwin_2.0"
|
||||
#define SOURCE_CODE_URL "https://github.com/InsanityAutomation/Marlin/tree/Tenlog_DWIN"
|
||||
|
||||
/**
|
||||
* Default generic printer UUID.
|
||||
@@ -217,7 +113,7 @@
|
||||
* The WEBSITE_URL is the location where users can get more information such as
|
||||
* documentation about a specific Marlin release.
|
||||
*/
|
||||
#define WEBSITE_URL "tinymachines3d.com"
|
||||
#define WEBSITE_URL "http://www.lnl3d.com "
|
||||
|
||||
/**
|
||||
* Set the vendor info the serial USB interface, if changable
|
||||
|
||||
@@ -141,8 +141,8 @@ typedef Servo hal_servo_t;
|
||||
#error "LCD_SERIAL_PORT must be from 0 to 3."
|
||||
#endif
|
||||
#define LCD_SERIAL lcdSerial
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH) || ENABLED(EXTENSIBLE_UI)
|
||||
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH) || ENABLED(DWINOS_4)
|
||||
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -629,7 +629,7 @@ MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
|
||||
template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
|
||||
MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser);
|
||||
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH) || ENABLED(EXTENSIBLE_UI)
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH) || ENABLED(DWINOS_4)
|
||||
template<typename Cfg>
|
||||
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
|
||||
const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
static ring_buffer_pos_t available();
|
||||
static void write(const uint8_t c);
|
||||
static void flushTX();
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH) || ENABLED(EXTENSIBLE_UI)
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH) || ENABLED(DWINOS_4)
|
||||
static ring_buffer_pos_t get_tx_buffer_free();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -123,11 +123,6 @@ void MarlinHAL::init() {
|
||||
|
||||
// Register min serial
|
||||
TERN_(POSTMORTEM_DEBUGGING, install_min_serial());
|
||||
|
||||
// warn if low memory after init
|
||||
if (freeMemory() < 1024) {
|
||||
SERIAL_WARN_MSG("HAL: low memory after init!\n");
|
||||
}
|
||||
}
|
||||
|
||||
void MarlinHAL::init_board() {}
|
||||
@@ -152,31 +147,7 @@ void MarlinHAL::delay_ms(const int ms) {
|
||||
delay(ms);
|
||||
}
|
||||
|
||||
void MarlinHAL::idletask() {
|
||||
#if ENABLED(MARLIN_DEV_MODE)
|
||||
// check & print serial RX errors
|
||||
MSerialT *serials[] = { &MSerial1, &MSerial2 };
|
||||
for (int serial = 0; serial < 2; serial++) {
|
||||
usart_receive_error_t err = serials[serial]->getReceiveError();
|
||||
if (err != usart_receive_error_t::None) {
|
||||
// "Warning: MSerial[n] RX [Framing|Parity|Overrun] Error"
|
||||
SERIAL_WARN_START();
|
||||
SERIAL_ECHOPGM(" MSerial");
|
||||
SERIAL_ECHO(serial + 1);
|
||||
SERIAL_ECHOPGM(" RX ");
|
||||
switch(err) {
|
||||
case usart_receive_error_t::FramingError: SERIAL_ECHOPGM("Framing"); break;
|
||||
case usart_receive_error_t::ParityError: SERIAL_ECHOPGM("Parity"); break;
|
||||
case usart_receive_error_t::OverrunError: SERIAL_ECHOPGM("Overrun"); break;
|
||||
case usart_receive_error_t::RxDataDropped: SERIAL_ECHOPGM("DataDropped"); break;
|
||||
default: break;
|
||||
}
|
||||
SERIAL_ECHOPGM(" Error");
|
||||
SERIAL_EOL();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void MarlinHAL::idletask() {}
|
||||
|
||||
uint8_t MarlinHAL::get_reset_source() {
|
||||
// Query reset cause from RMU
|
||||
|
||||
@@ -46,34 +46,14 @@ constexpr bool serial_handles_emergency(int port) {
|
||||
//
|
||||
// Define serial ports
|
||||
//
|
||||
|
||||
// serial port where RX and TX use IRQs
|
||||
#define DEFINE_IRQ_SERIAL_MARLIN(name, n) \
|
||||
#define DEFINE_HWSERIAL_MARLIN(name, n) \
|
||||
MSerialT name(serial_handles_emergency(n), \
|
||||
&USART##n##_config, \
|
||||
BOARD_USART##n##_TX_PIN, \
|
||||
BOARD_USART##n##_RX_PIN);
|
||||
|
||||
// serial port where RX uses DMA and TX uses IRQs
|
||||
// all serial ports use DMA1
|
||||
// since there are 4 USARTs and 4 DMA channels, we can use the USART number as the DMA channel
|
||||
#define DEFINE_DMA_SERIAL_MARLIN(name, n) \
|
||||
MSerialT name(serial_handles_emergency(n), \
|
||||
&USART##n##_config, \
|
||||
BOARD_USART##n##_TX_PIN, \
|
||||
BOARD_USART##n##_RX_PIN, \
|
||||
M4_DMA1, \
|
||||
((en_dma_channel_t)(n - 1))); // map USART1 to DMA channel 0, USART2 to DMA channel 1, etc.
|
||||
|
||||
#define DEFINE_SERIAL_MARLIN(name, n) TERN(SERIAL_DMA, DEFINE_DMA_SERIAL_MARLIN(name, n), DEFINE_IRQ_SERIAL_MARLIN(name, n))
|
||||
|
||||
DEFINE_SERIAL_MARLIN(MSerial1, 1);
|
||||
DEFINE_SERIAL_MARLIN(MSerial2, 2);
|
||||
|
||||
// TODO: remove this warning when SERIAL_DMA has been tested some more
|
||||
#if ENABLED(SERIAL_DMA)
|
||||
#warning "SERIAL_DMA may be unstable on HC32F460."
|
||||
#endif
|
||||
DEFINE_HWSERIAL_MARLIN(MSerial1, 1);
|
||||
DEFINE_HWSERIAL_MARLIN(MSerial2, 2);
|
||||
|
||||
//
|
||||
// Serial port assertions
|
||||
|
||||
@@ -25,42 +25,17 @@
|
||||
#include <drivers/usart/Usart.h>
|
||||
|
||||
// Optionally set uart IRQ priority to reduce overflow errors
|
||||
//#define UART_RX_IRQ_PRIO 1
|
||||
//#define UART_TX_IRQ_PRIO 1
|
||||
//#define UART_RX_DMA_IRQ_PRIO 1
|
||||
// #define UART_IRQ_PRIO 1
|
||||
|
||||
struct MarlinSerial : public Usart {
|
||||
MarlinSerial(
|
||||
struct usart_config_t *usart_device,
|
||||
gpio_pin_t tx_pin,
|
||||
gpio_pin_t rx_pin
|
||||
#if ENABLED(SERIAL_DMA)
|
||||
, M4_DMA_TypeDef *dma_unit = nullptr,
|
||||
en_dma_channel_t rx_dma_channel = DmaCh0
|
||||
#endif
|
||||
) : Usart(usart_device, tx_pin, rx_pin) {
|
||||
#if ENABLED(SERIAL_DMA)
|
||||
if (dma_unit != nullptr) {
|
||||
enableRxDma(dma_unit, rx_dma_channel);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
MarlinSerial(struct usart_config_t *usart_device, gpio_pin_t tx_pin, gpio_pin_t rx_pin) : Usart(usart_device, tx_pin, rx_pin) {}
|
||||
|
||||
#if defined(UART_RX_IRQ_PRIO) || defined(UART_TX_IRQ_PRIO) || defined(UART_RX_DMA_IRQ_PRIO)
|
||||
#ifdef UART_IRQ_PRIO
|
||||
void setPriority() {
|
||||
#if defined(UART_RX_IRQ_PRIO)
|
||||
NVIC_SetPriority(c_dev()->interrupts.rx_data_available.interrupt_number, UART_RX_IRQ_PRIO);
|
||||
NVIC_SetPriority(c_dev()->interrupts.rx_error.interrupt_number, UART_RX_IRQ_PRIO);
|
||||
#endif
|
||||
|
||||
#if defined(UART_TX_IRQ_PRIO)
|
||||
NVIC_SetPriority(c_dev()->interrupts.tx_buffer_empty.interrupt_number, UART_TX_IRQ_PRIO);
|
||||
NVIC_SetPriority(c_dev()->interrupts.tx_complete.interrupt_number, UART_TX_IRQ_PRIO);
|
||||
#endif
|
||||
|
||||
#if defined(UART_RX_DMA_IRQ_PRIO) && ENABLED(SERIAL_DMA)
|
||||
NVIC_SetPriority(c_dev()->dma.rx.rx_data_available_dma_btc.interrupt_number, UART_RX_DMA_IRQ_PRIO);
|
||||
#endif
|
||||
NVIC_SetPriority(c_dev()->interrupts.rx_data_available.interrupt_number, UART_IRQ_PRIO);
|
||||
NVIC_SetPriority(c_dev()->interrupts.rx_error.interrupt_number, UART_IRQ_PRIO);
|
||||
NVIC_SetPriority(c_dev()->interrupts.tx_buffer_empty.interrupt_number, UART_IRQ_PRIO);
|
||||
NVIC_SetPriority(c_dev()->interrupts.tx_complete.interrupt_number, UART_IRQ_PRIO);
|
||||
}
|
||||
|
||||
void begin(uint32_t baud) {
|
||||
@@ -72,12 +47,7 @@ struct MarlinSerial : public Usart {
|
||||
Usart::begin(baud, config);
|
||||
setPriority();
|
||||
}
|
||||
|
||||
void begin(uint32_t baud, const stc_usart_uart_init_t *config, const bool rxNoiseFilter = true) {
|
||||
Usart::begin(baud, config, rxNoiseFilter);
|
||||
setPriority();
|
||||
}
|
||||
#endif // UART_RX_IRQ_PRIO || UART_TX_IRQ_PRIO || UART_RX_DMA_IRQ_PRIO
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef Serial1Class<MarlinSerial> MSerialT;
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/**
|
||||
* app_config.h is included by the hc32f460 arduino build script for every source file.
|
||||
* it is used to configure the arduino core (and ddl) automatically according
|
||||
* to the settings in Configuration.h and Configuration_adv.h.
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef _HC32_APP_CONFIG_H_
|
||||
#define _HC32_APP_CONFIG_H_
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
//
|
||||
// dev mode
|
||||
//
|
||||
#if ENABLED(MARLIN_DEV_MODE)
|
||||
#define __DEBUG 1
|
||||
#define __CORE_DEBUG 1
|
||||
#endif
|
||||
|
||||
//
|
||||
// Fault Handlers and Panic
|
||||
//
|
||||
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
// disable arduino core fault handler, as we define our own
|
||||
#define CORE_DISABLE_FAULT_HANDLER 1
|
||||
#endif
|
||||
|
||||
// force-enable panic handler so that we can use our custom one (in MinSerial)
|
||||
#define PANIC_ENABLE 1
|
||||
|
||||
// use short filenames in ddl debug and core panic output
|
||||
#define __DEBUG_SHORT_FILENAMES 1
|
||||
#define __PANIC_SHORT_FILENAMES 1
|
||||
|
||||
// omit panic messages in core panic output
|
||||
#define __OMIT_PANIC_MESSAGE 1
|
||||
|
||||
//
|
||||
// Usart
|
||||
//
|
||||
|
||||
// disable serial globals (Serial1, Serial2, ...), as we define our own
|
||||
#define DISABLE_SERIAL_GLOBALS 1
|
||||
|
||||
// increase the size of the Usart buffers (both RX and TX)
|
||||
// NOTE:
|
||||
// the heap usage will increase by (SERIAL_BUFFER_SIZE - 64) * "number of serial ports used"
|
||||
// if running out of heap, the system may become unstable
|
||||
//#define SERIAL_BUFFER_SIZE 256
|
||||
|
||||
// enable support for Usart Clock Divider / Oversampling auto config
|
||||
#define USART_AUTO_CLKDIV_OS_CONFIG 1
|
||||
|
||||
// enable USART_RX_DMA_SUPPORT core option when SERIAL_DMA is enabled
|
||||
#if ENABLED(SERIAL_DMA)
|
||||
#define USART_RX_DMA_SUPPORT 1
|
||||
#endif
|
||||
|
||||
//
|
||||
// Misc.
|
||||
//
|
||||
|
||||
// redirect printf to host serial
|
||||
#define REDIRECT_PRINTF_TO_SERIAL 1
|
||||
|
||||
// FIXME override F_CPU to PCLK1, as marlin freaks out otherwise
|
||||
#define F_CPU (SYSTEM_CLOCK_FREQUENCIES.pclk1)
|
||||
|
||||
#endif // _HC32_APP_CONFIG_H_
|
||||
@@ -20,20 +20,6 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#include <core_util.h>
|
||||
|
||||
#if !defined(ARDUINO_CORE_VERSION_INT) || !defined(GET_VERSION_INT)
|
||||
// version macros were introduced in arduino core version 1.1.0
|
||||
// below that version, we polyfill them
|
||||
#define GET_VERSION_INT(major, minor, patch) ((major * 100000) + (minor * 1000) + patch)
|
||||
#define ARDUINO_CORE_VERSION_INT GET_VERSION_INT(1, 0, 0)
|
||||
#endif
|
||||
|
||||
#if ARDUINO_CORE_VERSION_INT < GET_VERSION_INT(1, 1, 0)
|
||||
// because we use app_config.h introduced in arduino core version 1.1.0, the
|
||||
// HAL is not compatible with older versions
|
||||
#error "The HC32 HAL is not compatible with Arduino Core versions < 1.1.0. Consider updating the Arduino Core."
|
||||
#endif
|
||||
|
||||
#ifndef BOARD_XTAL_FREQUENCY
|
||||
#error "BOARD_XTAL_FREQUENCY is required for HC32F460."
|
||||
@@ -88,18 +74,3 @@
|
||||
#error "HC32 HAL uses a custom panic handler. Do not define PANIC_USARTx_TX_PIN."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(SERIAL_DMA)
|
||||
#if !defined(USART_RX_DMA_SUPPORT)
|
||||
#error "SERIAL_DMA requires USART_RX_DMA_SUPPORT to be enabled in the arduino core."
|
||||
#endif
|
||||
|
||||
// USART_RX_DMA_SUPPORT does not implement core_hook_usart_rx_irq, which is required for the emergency parser
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
#error "EMERGENCY_PARSER is not supported with SERIAL_DMA. Please disable either SERIAL_DMA or EMERGENCY_PARSER."
|
||||
#endif
|
||||
|
||||
#if ARDUINO_CORE_VERSION_INT < GET_VERSION_INT(1, 1, 0)
|
||||
#error "SERIAL_DMA is not supported with arduino core version < 1.1.0."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
fn \
|
||||
}
|
||||
|
||||
stc_sd_handle_t *handle = nullptr;
|
||||
stc_sd_handle_t *handle;
|
||||
|
||||
bool SDIO_Init() {
|
||||
// Configure SDIO pins
|
||||
@@ -66,45 +66,36 @@ bool SDIO_Init() {
|
||||
GPIO_SetFunc(BOARD_SDIO_CMD, Func_Sdio);
|
||||
GPIO_SetFunc(BOARD_SDIO_DET, Func_Sdio);
|
||||
|
||||
// If a handle is already initialized, free it before creating a new one
|
||||
// otherwise, we will leak memory, which will eventually crash the system
|
||||
if (handle != nullptr) {
|
||||
delete handle->pstcDmaInitCfg;
|
||||
delete handle->pstcCardInitCfg;
|
||||
delete handle;
|
||||
handle = nullptr;
|
||||
}
|
||||
|
||||
// Create DMA configuration
|
||||
stc_sdcard_dma_init_t *dmaConf = new stc_sdcard_dma_init_t;
|
||||
dmaConf->DMAx = SDIO_DMA_PERIPHERAL;
|
||||
dmaConf->enDmaCh = SDIO_DMA_CHANNEL;
|
||||
|
||||
// Create card configuration
|
||||
// This should be a fairly safe configuration for most cards
|
||||
stc_sdcard_init_t *cardConf = new stc_sdcard_init_t;
|
||||
cardConf->enBusWidth = SdiocBusWidth4Bit;
|
||||
cardConf->enClkFreq = SdiocClk400K;
|
||||
cardConf->enSpeedMode = SdiocNormalSpeedMode;
|
||||
cardConf->pstcInitCfg = nullptr;
|
||||
|
||||
// Create handle in DMA mode
|
||||
handle = new stc_sd_handle_t;
|
||||
handle->SDIOCx = SDIO_PERIPHERAL;
|
||||
handle->enDevMode = SdCardDmaMode;
|
||||
handle->pstcDmaInitCfg = dmaConf;
|
||||
//handle->pstcCardInitCfg = cardConf; // assigned in SDCARD_Init
|
||||
|
||||
// Create card configuration
|
||||
// This should be a fairly safe configuration for most cards
|
||||
stc_sdcard_init_t cardConf = {
|
||||
.enBusWidth = SdiocBusWidth4Bit,
|
||||
.enClkFreq = SdiocClk400K,
|
||||
.enSpeedMode = SdiocNormalSpeedMode,
|
||||
//.pstcInitCfg = NULL,
|
||||
};
|
||||
|
||||
// Initialize sd card
|
||||
en_result_t rc = SDCARD_Init(handle, cardConf);
|
||||
en_result_t rc = SDCARD_Init(handle, &cardConf);
|
||||
if (rc != Ok) printf("SDIO_Init() error (rc=%u)\n", rc);
|
||||
|
||||
return rc == Ok;
|
||||
}
|
||||
|
||||
bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) {
|
||||
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false);
|
||||
CORE_ASSERT(dst != nullptr, "SDIO_ReadBlock dst is NULL", return false);
|
||||
CORE_ASSERT(handle != NULL, "SDIO not initialized");
|
||||
CORE_ASSERT(dst != NULL, "SDIO_ReadBlock dst is NULL");
|
||||
|
||||
WITH_RETRY(SDIO_READ_RETRIES, {
|
||||
en_result_t rc = SDCARD_ReadBlocks(handle, block, 1, dst, SDIO_READ_TIMEOUT);
|
||||
@@ -116,8 +107,8 @@ bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) {
|
||||
}
|
||||
|
||||
bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
|
||||
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false);
|
||||
CORE_ASSERT(src != nullptr, "SDIO_WriteBlock src is NULL", return false);
|
||||
CORE_ASSERT(handle != NULL, "SDIO not initialized");
|
||||
CORE_ASSERT(src != NULL, "SDIO_WriteBlock src is NULL");
|
||||
|
||||
WITH_RETRY(SDIO_WRITE_RETRIES, {
|
||||
en_result_t rc = SDCARD_WriteBlocks(handle, block, 1, (uint8_t *)src, SDIO_WRITE_TIMEOUT);
|
||||
@@ -129,12 +120,12 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
|
||||
}
|
||||
|
||||
bool SDIO_IsReady() {
|
||||
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false);
|
||||
CORE_ASSERT(handle != NULL, "SDIO not initialized");
|
||||
return bool(handle->stcCardStatus.READY_FOR_DATA);
|
||||
}
|
||||
|
||||
uint32_t SDIO_GetCardSize() {
|
||||
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return 0);
|
||||
CORE_ASSERT(handle != NULL, "SDIO not initialized");
|
||||
|
||||
// Multiply number of blocks with block size to get size in bytes
|
||||
const uint64_t cardSizeBytes = uint64_t(handle->stcSdCardInfo.u32LogBlockNbr) * uint64_t(handle->stcSdCardInfo.u32LogBlockSize);
|
||||
|
||||
@@ -37,10 +37,7 @@ Timer::Timer() {
|
||||
}
|
||||
|
||||
Timer::~Timer() {
|
||||
if (timerid != 0) {
|
||||
timer_delete(timerid);
|
||||
timerid = 0;
|
||||
}
|
||||
timer_delete(timerid);
|
||||
}
|
||||
|
||||
void Timer::init(uint32_t sig_id, uint32_t sim_freq, callback_fn* fn) {
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#ifdef __PLAT_LINUX__
|
||||
#ifndef UNIT_TEST
|
||||
|
||||
//#define GPIO_LOGGING // Full GPIO and Positional Logging
|
||||
|
||||
@@ -136,5 +135,4 @@ int main() {
|
||||
read_serial.join();
|
||||
}
|
||||
|
||||
#endif // UNIT_TEST
|
||||
#endif // __PLAT_LINUX__
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
#else
|
||||
#error "LCD_SERIAL_PORT must be from 1 to 9, or -1 for Native USB."
|
||||
#endif
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH) || ENABLED(EXTENSIBLE_UI)
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH) || ENABLED(DWINOS_4)
|
||||
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
|
||||
#else // Arduino non-DMA
|
||||
|
||||
FORCE_INLINE static uint8_t buffer_overruns() { return 0; }
|
||||
typedef void (*usart_rx_callback_t)(serial_t * obj);
|
||||
|
||||
struct MarlinSerial : public HardwareSerial {
|
||||
@@ -54,8 +53,6 @@
|
||||
inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); }
|
||||
|
||||
void _rx_complete_irq(serial_t *obj);
|
||||
FORCE_INLINE static uint8_t buffer_overruns() { return 0; } // Not implemented. Void to avoid platform-dependent code.
|
||||
FORCE_INLINE uint32_t dropped() { return 0; }
|
||||
|
||||
protected:
|
||||
usart_rx_callback_t _rx_callback;
|
||||
|
||||
@@ -474,16 +474,11 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
|
||||
|
||||
#if HAS_KILL
|
||||
|
||||
// Check if the kill button was pressed and wait to ensure the signal is not noise
|
||||
// typically caused by poor insulation and grounding on LCD cables.
|
||||
// Lower numbers here will increase response time and therefore safety rating.
|
||||
// It is recommended to set this as low as possibe without false triggers.
|
||||
// Check if the kill button was pressed and wait just in case it was an accidental
|
||||
// key kill key press
|
||||
// -------------------------------------------------------------------------------
|
||||
#ifndef KILL_DELAY
|
||||
#define KILL_DELAY 250
|
||||
#endif
|
||||
|
||||
static int killCount = 0; // make the inactivity button a bit less responsive
|
||||
const int KILL_DELAY = 750;
|
||||
if (kill_state())
|
||||
killCount++;
|
||||
else if (killCount > 0)
|
||||
|
||||
@@ -131,7 +131,6 @@
|
||||
#define BOARD_PXMALION_CORE_I3 1164 // Pxmalion Core I3
|
||||
#define BOARD_PANOWIN_CUTLASS 1165 // Panowin Cutlass (as found in the Panowin F1)
|
||||
#define BOARD_KODAMA_BARDO 1166 // Kodama Bardo V1.x (as found in the Kodama Trinus)
|
||||
#define BOARD_DAGOMA_D6 1167 // Dagoma D6 (as found in the Dagoma DiscoUltimate V2 TMC)
|
||||
|
||||
//
|
||||
// RAMBo and derivatives
|
||||
|
||||
@@ -57,7 +57,9 @@ enum PauseMessage : char {
|
||||
};
|
||||
|
||||
#if M600_PURGE_MORE_RESUMABLE
|
||||
// Input methods can Purge More, Resume, or request input
|
||||
/**
|
||||
* Input methods can Purge More, Resume, or request input
|
||||
*/
|
||||
enum PauseMenuResponse : char {
|
||||
PAUSE_RESPONSE_WAIT_FOR,
|
||||
PAUSE_RESPONSE_EXTRUDE_MORE,
|
||||
@@ -107,7 +109,7 @@ void wait_for_confirmation(
|
||||
void resume_print(
|
||||
const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move
|
||||
const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move
|
||||
const_float_t purge_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length
|
||||
const_float_t extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length
|
||||
const int8_t max_beep_count=0, // Beep alert for attention
|
||||
const celsius_t targetTemp=0 // (°C) A target temperature for the hotend
|
||||
DXC_PARAMS // Dual-X-Carriage extruder index
|
||||
@@ -116,7 +118,7 @@ void resume_print(
|
||||
bool load_filament(
|
||||
const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move
|
||||
const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move
|
||||
const_float_t purge_length=0, // (mm) Purge length
|
||||
const_float_t extrude_length=0, // (mm) Purge length
|
||||
const int8_t max_beep_count=0, // Beep alert for attention
|
||||
const bool show_lcd=false, // Set LCD status messages?
|
||||
const bool pause_for_user=false, // Pause for user before returning?
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
#include "../../../module/probe.h"
|
||||
#include "../../queue.h"
|
||||
|
||||
#if HAS_MULTI_HOTEND
|
||||
#include "../../../module/tool_change.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
|
||||
#include "../../../libs/least_squares_fit.h"
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,7 @@ void GcodeSuite::M111() {
|
||||
SERIAL_ECHOPGM(STR_DEBUG_OFF);
|
||||
#if !(defined(__AVR__) && defined(USBCON))
|
||||
#if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS)
|
||||
//SERIAL_ECHOPGM("\nBuffer Overruns: ", MYSERIAL1.buffer_overruns());
|
||||
SERIAL_ECHOPGM("\nBuffer Overruns: ", MYSERIAL1.buffer_overruns());
|
||||
#endif
|
||||
#if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS)
|
||||
SERIAL_ECHOPGM("\nFraming Errors: ", MYSERIAL1.framing_errors());
|
||||
|
||||
@@ -72,7 +72,6 @@ void GcodeSuite::M413_report(const bool forReplay/*=true*/) {
|
||||
, " B", recovery.bed_temp_threshold
|
||||
#endif
|
||||
);
|
||||
SERIAL_ECHO(" ; ");
|
||||
serialprintln_onoff(recovery.enabled);
|
||||
}
|
||||
|
||||
|
||||
@@ -235,11 +235,9 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
|
||||
#error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
|
||||
#endif
|
||||
|
||||
// Serial DMA is only available for some STM32 MCUs and HC32
|
||||
// Serial DMA is only available for some STM32 MCUs
|
||||
#if ENABLED(SERIAL_DMA)
|
||||
#if defined(ARDUINO_ARCH_HC32)
|
||||
// checks for HC32 are located in HAL/HC32/inc/SanityCheck.h
|
||||
#elif !HAL_STM32 || NONE(STM32F0xx, STM32F1xx, STM32F2xx, STM32F4xx, STM32F7xx)
|
||||
#if !HAL_STM32 || NONE(STM32F0xx, STM32F1xx, STM32F2xx, STM32F4xx, STM32F7xx)
|
||||
#error "SERIAL_DMA is only available for some STM32 MCUs and requires HAL/STM32."
|
||||
#elif !defined(HAL_UART_MODULE_ENABLED) || defined(HAL_UART_MODULE_ONLY)
|
||||
#error "SERIAL_DMA requires STM32 platform HAL UART (without HAL_UART_MODULE_ONLY)."
|
||||
@@ -3635,9 +3633,9 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
|
||||
#error "LED_CONTROL_MENU requires an LCD controller that implements the menu."
|
||||
#endif
|
||||
|
||||
//#if ENABLED(CUSTOM_MENU_MAIN) && NONE(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, TFT_LVGL_UI)
|
||||
//#error "CUSTOM_MENU_MAIN requires an LCD controller that implements the menu."
|
||||
//#endif
|
||||
#if ENABLED(CUSTOM_MENU_MAIN) && NONE(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, TFT_LVGL_UI)
|
||||
#error "CUSTOM_MENU_MAIN requires an LCD controller that implements the menu."
|
||||
#endif
|
||||
|
||||
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED)
|
||||
#error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED."
|
||||
@@ -4002,11 +4000,11 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
|
||||
#if !(defined(WIFI_SSID) && defined(WIFI_PWD))
|
||||
#error "ESP32 motherboard with WIFISUPPORT requires WIFI_SSID and WIFI_PWD."
|
||||
#endif
|
||||
#elif ENABLED(WIFI_CUSTOM_COMMAND) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT)
|
||||
#elif ENABLED(WIFI_CUSTOM_COMMAND)
|
||||
#error "WIFI_CUSTOM_COMMAND requires an ESP32 motherboard and WIFISUPPORT."
|
||||
#elif ENABLED(OTASUPPORT) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT)
|
||||
#elif ENABLED(OTASUPPORT)
|
||||
#error "OTASUPPORT requires an ESP32 motherboard and WIFISUPPORT."
|
||||
#elif (defined(WIFI_SSID) || defined(WIFI_PWD)) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT)
|
||||
#elif defined(WIFI_SSID) || defined(WIFI_PWD)
|
||||
#error "WIFI_SSID and WIFI_PWD only apply to ESP32 motherboard with WIFISUPPORT."
|
||||
#endif
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* version was tagged.
|
||||
*/
|
||||
#ifndef STRING_DISTRIBUTION_DATE
|
||||
#define STRING_DISTRIBUTION_DATE "2024-04-15"
|
||||
#define STRING_DISTRIBUTION_DATE "2024-04-08"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
#warning "Warning! Don't use dummy thermistors (998/999) for final build!"
|
||||
#endif
|
||||
|
||||
#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT, UNIT_TEST)
|
||||
#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT)
|
||||
#warning "Your Configuration provides no method to acquire user feedback!"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1169,7 +1169,7 @@ void MarlinUI::draw_status_screen() {
|
||||
|
||||
lcd_moveto(LCD_WIDTH - 9, 2);
|
||||
lcd_put_lchar('S');
|
||||
|
||||
|
||||
|
||||
#endif // LCD_INFO_SCREEN_STYLE
|
||||
|
||||
|
||||
@@ -377,13 +377,7 @@ void MarlinUI::draw_kill_screen() {
|
||||
void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
void MarlinUI::sleep_display(const bool sleep/*=true*/) {
|
||||
static bool asleep = false;
|
||||
if (asleep != sleep){
|
||||
sleep ? u8g.sleepOn() : u8g.sleepOff();
|
||||
asleep = sleep;
|
||||
}
|
||||
}
|
||||
void MarlinUI::sleep_display(const bool sleep/*=true*/) { sleep ? u8g.sleepOn() : u8g.sleepOff(); }
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
|
||||
@@ -84,7 +84,7 @@ TFT_IO tftio;
|
||||
#define X_HI (UPSCALE(TFT_PIXEL_OFFSET_X, WIDTH) - 1)
|
||||
#define Y_HI (UPSCALE(TFT_PIXEL_OFFSET_Y, HEIGHT) - 1)
|
||||
|
||||
// RGB565 color picker: https://rgbcolorpicker.com/565
|
||||
// RGB565 color picker: https://embeddednotepad.com/page/rgb565-color-picker
|
||||
// Hex code to color name: https://www.color-name.com/
|
||||
|
||||
#define COLOR_BLACK 0x0000 // #000000
|
||||
|
||||
@@ -109,7 +109,7 @@ void MarlinUI::clear_lcd() {
|
||||
#define VERSION_Y 84
|
||||
#endif
|
||||
dwinJPGShowAndCache(0); // Ensure DACAI stays on boot screen
|
||||
dwinDrawString(false, font10x20, COLOR_YELLOW, COLOR_BG_BLACK, INFO_CENTER - (dwin_string.length * 10) / 2, 230, S(dwin_string.string()));
|
||||
dwinDrawString(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length * 10) / 2, 230, S(dwin_string.string()));
|
||||
TERN_(SHOW_CUSTOM_BOOTSCREEN, safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT));
|
||||
clear_lcd();
|
||||
|
||||
|
||||
@@ -790,7 +790,7 @@ void RTSSHOW::RTS_SndData(const char *str, unsigned long addr, unsigned char cmd
|
||||
uint8_t expected_tx = 6 + len; // 6 bytes header + payload.
|
||||
const millis_t try_until = ExtUI::safe_millis() + 1000;
|
||||
|
||||
while (expected_tx > LCD_SERIAL_TX_BUFFER_FREE()) {
|
||||
while (expected_tx > DWIN_SERIAL.get_tx_buffer_free()) {
|
||||
if (ELAPSED(ExtUI::safe_millis(), try_until)) return; // Stop trying after 1 second
|
||||
|
||||
#ifdef ARDUINO_ARCH_STM32
|
||||
@@ -920,7 +920,7 @@ void RTSSHOW::WriteVariable(uint16_t adr, const void* values, uint8_t valueslen,
|
||||
uint8_t expected_tx = 6 + valueslen; // 6 bytes header + payload.
|
||||
const millis_t try_until = ExtUI::safe_millis() + 1000;
|
||||
|
||||
while (expected_tx > LCD_SERIAL_TX_BUFFER_FREE()) {
|
||||
while (expected_tx > DWIN_SERIAL.get_tx_buffer_free()) {
|
||||
if (ELAPSED(ExtUI::safe_millis(), try_until)) return; // Stop trying after 1 second
|
||||
|
||||
#ifdef ARDUINO_ARCH_STM32
|
||||
@@ -1052,7 +1052,7 @@ void RTSSHOW::RTS_HandleData()
|
||||
#endif
|
||||
|
||||
//SERIAL_ECHOLNPGM_P(PSTR("BeginSwitch"));
|
||||
float tmp_zprobe_offset = 0.0f;
|
||||
|
||||
switch (Checkkey)
|
||||
{
|
||||
case Printfile:
|
||||
@@ -1205,6 +1205,7 @@ void RTSSHOW::RTS_HandleData()
|
||||
break;
|
||||
|
||||
case Zoffset:
|
||||
float tmp_zprobe_offset;
|
||||
if (recdat.data[0] >= 32768)
|
||||
{
|
||||
tmp_zprobe_offset = ((float)recdat.data[0] - 65536) / 100;
|
||||
@@ -1214,7 +1215,7 @@ void RTSSHOW::RTS_HandleData()
|
||||
tmp_zprobe_offset = ((float)recdat.data[0]) / 100;
|
||||
}
|
||||
SERIAL_ECHOLNPGM("Requested Offset ", tmp_zprobe_offset);
|
||||
if (WITHIN((tmp_zprobe_offset), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX))
|
||||
if (WITHIN((tmp_zprobe_offset), PROBE_OFFSET_Z_MIN, PROBE_OFFSET_Z_MAX))
|
||||
{
|
||||
int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, (axis_t)Z);
|
||||
if(tmpSteps==0)
|
||||
@@ -1671,7 +1672,7 @@ void RTSSHOW::RTS_HandleData()
|
||||
case 2: // Z-axis to Up
|
||||
{
|
||||
SERIAL_ECHOLNPGM("Requested Offset ", tmp_zprobe_offset);
|
||||
if (WITHIN((getZOffset_mm()+tmp_zprobe_adjust), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX))
|
||||
if (WITHIN((getZOffset_mm()+tmp_zprobe_adjust), PROBE_OFFSET_Z_MIN, PROBE_OFFSET_Z_MAX))
|
||||
{
|
||||
int16_t tmpSteps = mmToWholeSteps(tmp_zprobe_adjust, (axis_t)Z);
|
||||
if(tmpSteps==0)
|
||||
@@ -1696,7 +1697,7 @@ void RTSSHOW::RTS_HandleData()
|
||||
case 3: // Z-axis to Down
|
||||
{
|
||||
SERIAL_ECHOLNPGM("Requested Offset ", tmp_zprobe_offset);
|
||||
if (WITHIN((getZOffset_mm()-tmp_zprobe_adjust), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX))
|
||||
if (WITHIN((getZOffset_mm()-tmp_zprobe_adjust), PROBE_OFFSET_Z_MIN, PROBE_OFFSET_Z_MAX))
|
||||
{
|
||||
int16_t tmpSteps = mmToWholeSteps((tmp_zprobe_adjust), (axis_t)Z);
|
||||
if(tmpSteps==0)
|
||||
@@ -2001,7 +2002,7 @@ void RTSSHOW::RTS_HandleData()
|
||||
case Filement:
|
||||
if (recdat.addr == Exchfilement)
|
||||
{
|
||||
extruder_t tmpTool = E0;
|
||||
extruder_t tmpTool;
|
||||
if (recdat.data[0]<=2)
|
||||
tmpTool = E0;
|
||||
else if (recdat.data[0]<=4)
|
||||
@@ -2967,14 +2968,6 @@ void onMaxTempError(signed char){}
|
||||
|
||||
void onPauseMode(PauseMessage, PauseMode, unsigned char) {}
|
||||
|
||||
void onSetMinExtrusionTemp(short){}
|
||||
void onFirmwareFlash(){};
|
||||
void onMaxTempError(int){};
|
||||
void onMinTempError(int){};
|
||||
void onHeatingError(int){};
|
||||
void onStartM303(int, int, short){};
|
||||
|
||||
|
||||
} // namespace ExtUI
|
||||
|
||||
#endif
|
||||
@@ -1668,7 +1668,7 @@ void MarlinUI::host_notify(const char * const cstr) {
|
||||
card.abortFilePrintSoon();
|
||||
else if (card.isMounted())
|
||||
card.closefile();
|
||||
#endif
|
||||
#endif
|
||||
#ifdef ACTION_ON_CANCEL
|
||||
hostui.cancel();
|
||||
#endif
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#define COLOR(color) RGB(((color >> 16) & 0xFF), ((color >> 8) & 0xFF), (color & 0xFF))
|
||||
#define HALF(color) RGB(RED(color) >> 1, GREEN(color) >> 1, BLUE(color) >> 1)
|
||||
|
||||
// RGB565 color picker: https://rgbcolorpicker.com/565
|
||||
// RGB565 color picker: https://embeddednotepad.com/page/rgb565-color-picker
|
||||
// Hex code to color name: https://www.color-name.com/
|
||||
|
||||
#define COLOR_BLACK 0x0000 // #000000
|
||||
|
||||
@@ -224,8 +224,6 @@
|
||||
#include "ramps/pins_RAMPS_CREALITY.h" // ATmega2560 env:mega2560
|
||||
#elif MB(DAGOMA_F5)
|
||||
#include "ramps/pins_DAGOMA_F5.h" // ATmega2560 env:mega2560
|
||||
#elif MB(DAGOMA_D6)
|
||||
#include "ramps/pins_DAGOMA_D6.h" // ATmega2560 env:mega2560ext
|
||||
#elif MB(FYSETC_F6_13)
|
||||
#include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6
|
||||
#elif MB(FYSETC_F6_14)
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if HOTENDS > 2 || E_STEPPERS > 2
|
||||
#error "Dagoma3D D6 supports up to 2 hotends / E-steppers."
|
||||
#endif
|
||||
|
||||
#define BOARD_INFO_NAME "Dagoma3D D6"
|
||||
|
||||
//
|
||||
// Trinamic Stallguard pins
|
||||
//
|
||||
#define X_DIAG_PIN 43
|
||||
#define Y_DIAG_PIN 41
|
||||
#define Z_DIAG_PIN 47
|
||||
#define E0_DIAG_PIN 21
|
||||
#define E1_DIAG_PIN 20
|
||||
|
||||
//
|
||||
// Endstops
|
||||
//
|
||||
#define X_STOP_PIN 2
|
||||
#define Y_STOP_PIN 3
|
||||
#define Z_STOP_PIN 15
|
||||
|
||||
//
|
||||
// Filament Runout Sensor
|
||||
//
|
||||
#ifndef FIL_RUNOUT_PIN
|
||||
#define FIL_RUNOUT_PIN 39
|
||||
#endif
|
||||
#if EXTRUDERS > 1 && !defined(FIL_RUNOUT2_PIN)
|
||||
#define FIL_RUNOUT2_PIN 14
|
||||
#endif
|
||||
|
||||
// Alter timing for graphical display
|
||||
#if IS_U8GLIB_ST7920
|
||||
#ifndef BOARD_ST7920_DELAY_1
|
||||
#define BOARD_ST7920_DELAY_1 0
|
||||
#endif
|
||||
#ifndef BOARD_ST7920_DELAY_2
|
||||
#define BOARD_ST7920_DELAY_2 250
|
||||
#endif
|
||||
#ifndef BOARD_ST7920_DELAY_3
|
||||
#define BOARD_ST7920_DELAY_3 250
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define KILL_PIN -1 // NC
|
||||
|
||||
#define LCD_CONTRAST_DEFAULT 255
|
||||
|
||||
//
|
||||
// Sensorless homing DIAG pin is not directly connected to the MCU. Close
|
||||
// the jumper next to the limit switch socket when using sensorless homing.
|
||||
//
|
||||
#if HAS_TMC_UART
|
||||
/**
|
||||
* TMC2208/TMC2209 stepper drivers
|
||||
*/
|
||||
#define X_SERIAL_RX_PIN 73
|
||||
#define X_SERIAL_TX_PIN 73
|
||||
#define Y_SERIAL_RX_PIN 73
|
||||
#define Y_SERIAL_TX_PIN 73
|
||||
#define Z_SERIAL_RX_PIN 73
|
||||
#define Z_SERIAL_TX_PIN 73
|
||||
#define E0_SERIAL_RX_PIN 73
|
||||
#define E0_SERIAL_TX_PIN 73
|
||||
#define E1_SERIAL_RX_PIN 12
|
||||
#define E1_SERIAL_TX_PIN 12
|
||||
|
||||
// Default TMC slave addresses
|
||||
#ifndef X_SLAVE_ADDRESS
|
||||
#define X_SLAVE_ADDRESS 0
|
||||
#endif
|
||||
#ifndef Y_SLAVE_ADDRESS
|
||||
#define Y_SLAVE_ADDRESS 1
|
||||
#endif
|
||||
#ifndef Z_SLAVE_ADDRESS
|
||||
#define Z_SLAVE_ADDRESS 2
|
||||
#endif
|
||||
#ifndef E0_SLAVE_ADDRESS
|
||||
#define E0_SLAVE_ADDRESS 3
|
||||
#endif
|
||||
#ifndef E1_SLAVE_ADDRESS
|
||||
#define E1_SLAVE_ADDRESS 3
|
||||
#endif
|
||||
static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_DAGOMA_D6.");
|
||||
static_assert(Y_SLAVE_ADDRESS == 1, "Y_SLAVE_ADDRESS must be 1 for BOARD_DAGOMA_D6.");
|
||||
static_assert(Z_SLAVE_ADDRESS == 2, "Z_SLAVE_ADDRESS must be 2 for BOARD_DAGOMA_D6.");
|
||||
static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_DAGOMA_D6.");
|
||||
static_assert(E1_SLAVE_ADDRESS == 3, "E1_SLAVE_ADDRESS must be 3 for BOARD_DAGOMA_D6.");
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Import default RAMPS 1.4 pins
|
||||
//
|
||||
#include "pins_RAMPS.h"
|
||||
@@ -105,11 +105,6 @@
|
||||
#define BEEPER_PIN -1
|
||||
#endif
|
||||
|
||||
#if ENABLED(MINIPANEL)
|
||||
#undef DOGLCD_CS
|
||||
#define DOGLCD_CS 28
|
||||
#endif
|
||||
|
||||
/**
|
||||
PIN: 0 Port: B0 E0_DIR_PIN protected
|
||||
PIN: 1 Port: B1 E0_STEP_PIN protected
|
||||
|
||||
@@ -495,7 +495,7 @@ void CardReader::mount() {
|
||||
else {
|
||||
flag.mounted = true;
|
||||
SERIAL_ECHO_MSG(STR_SD_CARD_OK);
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::isMediaInserted()); // ExtUI response
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onMediaInserted()); // ExtUI response
|
||||
}
|
||||
|
||||
if (flag.mounted)
|
||||
|
||||
@@ -37,6 +37,41 @@
|
||||
// Startup tests are run at the end of setup()
|
||||
void runStartupTests() {
|
||||
// Call post-setup tests here to validate behaviors.
|
||||
|
||||
// String with cutoff at 20 chars:
|
||||
// "F-string, 1234.50, 2"
|
||||
SString<20> str20;
|
||||
str20 = F("F-string, ");
|
||||
str20.append(1234.5f).append(',').append(' ')
|
||||
.append(2345.67).append(',').append(' ')
|
||||
.echoln();
|
||||
|
||||
// Truncate to "F-string"
|
||||
str20.trunc(8).echoln();
|
||||
|
||||
// 100 dashes, but chopped down to DEFAULT_MSTRING_SIZE (20)
|
||||
TSS(repchr_t('-', 100)).echoln();
|
||||
|
||||
// Hello World!-123456------ <spaces!33
|
||||
// ^ eol! ... 1234.50*2345.602 = 2895645.67
|
||||
SString<100> str(F("Hello"));
|
||||
str.append(F(" World!"));
|
||||
str += '-';
|
||||
str += uint8_t(123);
|
||||
str += F("456");
|
||||
str += repchr_t('-', 6);
|
||||
str += Spaces(3);
|
||||
str += "< spaces!";
|
||||
str += int8_t(33);
|
||||
str.eol();
|
||||
str += "^ eol!";
|
||||
|
||||
str.append("...", 1234.5f, '*', p_float_t(2345.602, 3), F(" = "), 1234.5 * 2345.602).echoln();
|
||||
|
||||
// Print it again with SERIAL_ECHOLN
|
||||
auto print_char_ptr = [](char * const str) { SERIAL_ECHOLN(str); };
|
||||
print_char_ptr(str);
|
||||
|
||||
}
|
||||
|
||||
// Periodic tests are run from within loop()
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
These test files are executed by the unit-tests built from the `<root>/test` folder.
|
||||
|
||||
These are placed outside of the main PlatformIO test folder so we can collect all test files and compile them into multiple PlatformIO test binaries. This enables tests to be executed against a variety of Marlin configurations.
|
||||
|
||||
To execute these tests, refer to the top-level Makefile.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,58 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../test/unit_tests.h"
|
||||
#include <src/gcode/gcode.h>
|
||||
#include <src/gcode/parser.h>
|
||||
|
||||
MARLIN_TEST(gcode, process_parsed_command) {
|
||||
GcodeSuite suite;
|
||||
parser.command_letter = 'G';
|
||||
parser.codenum = 0;
|
||||
suite.process_parsed_command(false);
|
||||
}
|
||||
|
||||
MARLIN_TEST(gcode, parse_g1_xz) {
|
||||
char current_command[] = "G0 X10 Z30";
|
||||
parser.command_letter = -128;
|
||||
parser.codenum = -1;
|
||||
parser.parse(current_command);
|
||||
TEST_ASSERT_EQUAL('G', parser.command_letter);
|
||||
TEST_ASSERT_EQUAL(0, parser.codenum);
|
||||
TEST_ASSERT_TRUE(parser.seen('X'));
|
||||
TEST_ASSERT_FALSE(parser.seen('Y'));
|
||||
TEST_ASSERT_TRUE(parser.seen('Z'));
|
||||
TEST_ASSERT_FALSE(parser.seen('E'));
|
||||
}
|
||||
|
||||
MARLIN_TEST(gcode, parse_g1_nxz) {
|
||||
char current_command[] = "N123 G0 X10 Z30";
|
||||
parser.command_letter = -128;
|
||||
parser.codenum = -1;
|
||||
parser.parse(current_command);
|
||||
TEST_ASSERT_EQUAL('G', parser.command_letter);
|
||||
TEST_ASSERT_EQUAL(0, parser.codenum);
|
||||
TEST_ASSERT_TRUE(parser.seen('X'));
|
||||
TEST_ASSERT_FALSE(parser.seen('Y'));
|
||||
TEST_ASSERT_TRUE(parser.seen('Z'));
|
||||
TEST_ASSERT_FALSE(parser.seen('E'));
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../test/unit_tests.h"
|
||||
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
||||
|
||||
#include <src/feature/runout.h>
|
||||
|
||||
MARLIN_TEST(runout, poll_runout_states) {
|
||||
FilamentSensorBase sensor;
|
||||
// Expected default value is one bit set for each extruder
|
||||
uint8_t expected = static_cast<uint8_t>(~(~0u << NUM_RUNOUT_SENSORS));
|
||||
TEST_ASSERT_EQUAL(expected, sensor.poll_runout_states());
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,160 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../test/unit_tests.h"
|
||||
#include "src/core/types.h"
|
||||
|
||||
MARLIN_TEST(types, XYval_const_as_bools) {
|
||||
const XYval<int> xy_const_true = {1, 2};
|
||||
TEST_ASSERT_TRUE(xy_const_true);
|
||||
|
||||
const XYval<int> xy_const_false = {0, 0};
|
||||
TEST_ASSERT_FALSE(xy_const_false);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, XYval_non_const_as_bools) {
|
||||
XYval<int> xy_true = {1, 2};
|
||||
TEST_ASSERT_TRUE(xy_true);
|
||||
|
||||
XYval<int> xy_false = {0, 0};
|
||||
TEST_ASSERT_FALSE(xy_false);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, XYZval_const_as_bools) {
|
||||
const XYZval<int> xyz_const_true = {1, 2, 3};
|
||||
TEST_ASSERT_TRUE(xyz_const_true);
|
||||
|
||||
const XYZval<int> xyz_const_false = {0, 0, 0};
|
||||
TEST_ASSERT_FALSE(xyz_const_false);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, XYZval_non_const_as_bools) {
|
||||
XYZval<int> xyz_true = {1, 2, 3};
|
||||
TEST_ASSERT_TRUE(xyz_true);
|
||||
|
||||
XYZval<int> xyz_false = {0, 0, 0};
|
||||
TEST_ASSERT_FALSE(xyz_false);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, XYZEval_const_as_bools) {
|
||||
const XYZEval<int> xyze_const_true = {1, 2, 3, 4};
|
||||
TEST_ASSERT_TRUE(xyze_const_true);
|
||||
|
||||
const XYZEval<int> xyze_const_false = {0, 0, 0, 0};
|
||||
TEST_ASSERT_FALSE(xyze_const_false);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, XYZEval_non_const_as_bools) {
|
||||
XYZEval<int> xyze_true = {1, 2, 3, 4};
|
||||
TEST_ASSERT_TRUE(xyze_true);
|
||||
|
||||
XYZEval<int> xyze_false = {0, 0, 0, 0};
|
||||
TEST_ASSERT_FALSE(xyze_false);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, Flags_const_as_bools) {
|
||||
const Flags<32> flags_const_false = {0};
|
||||
TEST_ASSERT_FALSE(flags_const_false);
|
||||
|
||||
const Flags<32> flags_const_true = {1};
|
||||
TEST_ASSERT_TRUE(flags_const_true);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, Flags_non_const_as_bools) {
|
||||
Flags<32> flags_false = {0};
|
||||
TEST_ASSERT_FALSE(flags_false);
|
||||
|
||||
Flags<32> flags_true = {1};
|
||||
TEST_ASSERT_TRUE(flags_true);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, AxisFlags_const_as_bools) {
|
||||
const AxisFlags axis_flags_const_false = {0};
|
||||
TEST_ASSERT_FALSE(axis_flags_const_false);
|
||||
|
||||
const AxisFlags axis_flags_const_true = {1};
|
||||
TEST_ASSERT_TRUE(axis_flags_const_true);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, AxisFlags_non_const_as_bools) {
|
||||
AxisFlags axis_flags_false = {0};
|
||||
TEST_ASSERT_FALSE(axis_flags_false);
|
||||
|
||||
AxisFlags axis_flags_true = {1};
|
||||
TEST_ASSERT_TRUE(axis_flags_true);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, AxisBits_const_as_bools) {
|
||||
const AxisBits axis_bits_const_false = {0};
|
||||
TEST_ASSERT_FALSE(axis_bits_const_false);
|
||||
|
||||
const AxisBits axis_bits_const_true = {1};
|
||||
TEST_ASSERT_TRUE(axis_bits_const_true);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, AxisBits_non_const_as_bools) {
|
||||
AxisBits axis_bits_false = {0};
|
||||
TEST_ASSERT_FALSE(axis_bits_false);
|
||||
|
||||
AxisBits axis_bits_true = {1};
|
||||
TEST_ASSERT_TRUE(axis_bits_true);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, MString1) {
|
||||
// String with cutoff at 20 chars:
|
||||
// "F-string, 1234.50, 2"
|
||||
MString<20> str20;
|
||||
str20 = F("F-string, ");
|
||||
str20.append(1234.5f).append(',').append(' ')
|
||||
.append(2345.67).append(',').append(' ');
|
||||
|
||||
TEST_ASSERT_TRUE(strcmp_P(str20, PSTR("F-string, 1234.50, 2")) == 0);
|
||||
|
||||
// Truncate to "F-string"
|
||||
str20.trunc(8);
|
||||
|
||||
TEST_ASSERT_FALSE(strcmp_P(&str20, PSTR("F-string")) != 0);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, MString2) {
|
||||
// 100 dashes, but chopped down to DEFAULT_MSTRING_SIZE (20)
|
||||
TEST_ASSERT_TRUE(TSS(repchr_t('-', 100)).length() == 20);
|
||||
}
|
||||
|
||||
MARLIN_TEST(types, SString) {
|
||||
// Hello World!-123456------ < spaces!33
|
||||
// ^ eol! ... 1234.50*2345.602 = 2895645.67
|
||||
SString<100> str(F("Hello"));
|
||||
str.append(F(" World!"));
|
||||
str += '-';
|
||||
str += uint8_t(123);
|
||||
str += F("456");
|
||||
str += repchr_t('-', 6);
|
||||
str += Spaces(3);
|
||||
str += "< spaces!";
|
||||
str += int8_t(33);
|
||||
str.eol();
|
||||
str += "^ eol!";
|
||||
str.append(" ... ", 1234.5f, '*', p_float_t(2345.602, 3), F(" = "), 1234.5 * 2345.602);
|
||||
|
||||
TEST_ASSERT_TRUE(strcmp_P(str, PSTR("Hello World!-123456------ < spaces!33\n^ eol! ... 1234.50*2345.602 = 2895645.67")) == 0);
|
||||
}
|
||||
@@ -1,69 +1,16 @@
|
||||
## Creality Touch/TFT Screen supported firmware
|
||||
## Dwin Touch/TFT Screen supported firmware
|
||||
|
||||
This branch adds support for the Creality touchscreen machines and was split off from the standard Creality branches due to specific custom changes not found upstream. This includes extensions to the EXTui framework among other smaller tweaks that we have been working towards getting submitted upstream. Machines supported here are :
|
||||
|
||||
- [CR10S Pro / V2](https://www.tinymachines3d.com/products/cr-10s-pro-v2-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [CR10 Max](https://www.tinymachines3d.com/products/creality-cr-10-max-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [Ender 5 Plus](https://www.tinymachines3d.com/products/ender-5-plus-silent-board-custom-dual-z-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [Ender 6](https://amzn.to/3JRyOhi)
|
||||
- [CR-X / Pro](https://www.tinymachines3d.com/products/creality-cr-x-pro-3d-printer-with-dual-extruder-and-bl-touch?rfsn=3419592.cc302fe)
|
||||
- [CR10 V2 ](https://www.tinymachines3d.com/products/creality-cr-10-v2-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [CR10 V3 ](https://www.tinymachines3d.com/products/creality-cr-10-v3-plus-3d-printer-with-genuine-e3d-direct-drive-extruder-and-bl-touch?rfsn=3419592.cc302fe)
|
||||
- [Ender 3 / Pro 4.2.2 and 4.2.7](https://amzn.to/3BRHlxY)
|
||||
- [Ender 3 V2](https://www.tinymachines3d.com/products/ender-3-v2?rfsn=3419592.cc302fe)
|
||||
- [Ender 3 Max](https://www.tinymachines3d.com/products/ender-3-max-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [Ender 5 / Pro 4.2.2 and 4.2.7](https://amzn.to/3gMb2Yu)
|
||||
- [CR10S5 500mm](https://www.tinymachines3d.com/products/creality-cr-10-s5-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [CR6 SE](https://www.tinymachines3d.com/products/creality-cr-6-se-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [CR6 Max](https://www.tinymachines3d.com/products/creality-cr-6-max-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [CR10 Smart](https://www.tinymachines3d.com/products/creality-cr-10-smart-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [Ender 7](https://www.tinymachines3d.com/products/ender-7-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [CR30](https://www.tinymachines3d.com/products/cr-30-infinite-z-belt-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [Sermoon D1](https://amzn.to/3LXfZeD)
|
||||
- [CR5 / Pro HT](https://amzn.to/3gWvpBt)
|
||||
- [Ender 3 S1](https://www.tinymachines3d.com/products/ender-3-s1-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [Ender 2 Pro](https://www.tinymachines3d.com/products/ender-2-pro-3d-printer?rfsn=3419592.cc302fe)
|
||||
|
||||
- CR10S, CR10S4, CR20 and Pro, CR10, CR10Mini, CR2020, Ender 4, Ender 2 - Legacy support
|
||||
- These configurations exist however due to age and product availability are no longer actively tested
|
||||
|
||||
## Coming Soon
|
||||
- [CR10 Smart Pro](https://www.tinymachines3d.com/products/cr-10-smart-pro-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [CR200B]()
|
||||
|
||||
## Resin machines below from Tiny Machines are listed simply as an additional way to help support the project. If youre considering buying one, please do so through the following links :
|
||||
- [Halot One CL-60](https://www.tinymachines3d.com/products/halot-one-cl-60-resin-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [LD-002R](https://www.tinymachines3d.com/products/ld-002r-resin-printer?rfsn=3419592.cc302fe)
|
||||
- [LD-002H](https://www.tinymachines3d.com/products/ld-002h-resin-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [LD-006](https://www.tinymachines3d.com/products/ld-006-resin-3d-printer?rfsn=3419592.cc302fe)
|
||||
- [UW-02 Washer](https://www.tinymachines3d.com/products/uw-02-washing-curing-machine?rfsn=3419592.cc302fe)
|
||||
|
||||
|
||||
Ender 3V2 has a dedicated file set. CR10 Smart has a dedicated high resolution screen set. Portrait displays use the CR6/E3 Touch variant and landscape use the combined set.
|
||||
|
||||
Screen files are archived with [7-Zip](https://www.7-zip.org/) simply because it came out 1/5 the file size of a zip file. That added up fast!
|
||||
|
||||
There is a limitation with Windows systems and path depth so the file names need to be shorter than we would prefer. If you get an error compiling due to the path limit, move the folder to the root of your hard drive. Here is a legend to help decode the files:
|
||||
|
||||
- BLT = BLTouch
|
||||
- BIL = Bilinear Leveling
|
||||
- UBL - Unified Bed Leveling
|
||||
- DZ = Dual Z Steppers
|
||||
- Fil = FilamentRunout
|
||||
- Slnt = Creality Silent Board
|
||||
- H = E3D Hemera Extruder
|
||||
- MC = Mosquito Creality mount
|
||||
- ME = Mosquito E3D mount
|
||||
- Melzi Host option disables local SD card to allow more features and buffer for Octoprint control
|
||||
- NF = Noise filtering for machines with cable extensions - reduces homing accuracy!
|
||||
- LR = Stock runout replaced with Lerdge
|
||||
- ZM = BLTouch connected to ZMin port instead of Probe pin 5 connector harness
|
||||
- Info screen Version Code Reference
|
||||
- - Char 1 - Driver (A-4988, T-TMC220X)
|
||||
- - Char 2 - Z Stop(B-BLTouch, E-Endstop)
|
||||
- - Char 3 - Screen(L-LowRes, H-THighRes)
|
||||
- - Char 4 - Bed (A-AC, D-DC)
|
||||
- - Char 5 - Endstop(O-Optical Y, M-Mechanical Y)
|
||||
- - Char 6 - Extruder (T-Titan, B-BMG, L-LGX, S-Basic)
|
||||
|
||||
## Support
|
||||
|
||||
This firmware is provided to the public as-is with no warranty or guarantee. It's based on a large open source project and there is no entitlement to support. That said, Tiny Machines 3D customers may obtain
|
||||
support through their normal support queue. I will provide support to Patreons as I am able. If you require more immediate support and are not a Tiny Machines 3D customer, you may contact them at
|
||||
support@tinymachines3d.com about purchasing support hours. Aside from this, we are active on many Facebook groups as well as several discord channels and typically help anyone we can when we come across them.
|
||||
This firmware is provided to the public as-is with no warranty or guarantee. It's based on a large open source project and there is no entitlement to support. That said, LNL Solutions customers may obtain support through their normal support queue. I will provide support to Patreons as I am able. Aside from this, we are active on many discord channels and typically help anyone we can when we come across them.
|
||||
|
||||
We have now created a dedicated Discord server to handle support and archive relevant guides and instructions. Patreon supporters will get priority assistance.
|
||||
|
||||
@@ -79,16 +26,9 @@ Shout out to Tom Brazier, as nearly all notable improvements to the Marlin core
|
||||
|
||||
Insanity Automation Discord - https://discord.gg/TKmJ85PyG4
|
||||
|
||||
## Primary Notes for DW7.4.8
|
||||
- Added Linear Adv and Input Shaping Screens
|
||||
- Signifigant improvement in response times following changes to new generation machines
|
||||
-- The DWIN OS 3.5 had an option to enable NOACK with an addon bin file. 4.0 has a specific throttled response OS revision. 4.5 needed a totally different UI image flashed. No way it could all live together without completely confusing users so we set about figuring out how to keep universal support and found a balance in data send cycles that the 2560 buffers could still handle the replies without overunning.
|
||||
- Added support for changing runout sensor type on the LCD
|
||||
- Added toggle to change babystepping increment on the LCD
|
||||
- Thanks to EvilGremlin for some of the icon and display graphics work
|
||||
|
||||
## Primary Notes for DW7.4.7
|
||||
- Added IDEX screens
|
||||
- Added Branch / support for Tenlog IDEX machines with LNL Solutions
|
||||
- Fan adjustment now numeric instead of simple on/off
|
||||
- Tap Z offset on adjustment screen to type numeric value
|
||||
- Sync to 2.1.2 with LA now on for all builds, Silent specific builds eliminated
|
||||
@@ -235,4 +175,4 @@ This is just one of many forks of Marlin. We don't try to bury that behind fancy
|
||||
|
||||
Marlin is published under the [GPL license](/LICENSE) because we believe in open development. The GPL comes with both rights and obligations. Whether you use Marlin firmware as the driver for your open or closed-source product, you must keep Marlin open, and you must provide your compatible Marlin source code to end users upon request. The most straightforward way to comply with the Marlin license is to make a fork of Marlin on Github, perform your modifications, and direct users to your modified fork.
|
||||
|
||||
While we can't prevent the use of this code in products (3D printers, CNC, etc.) that are closed source or crippled by a patent, we would prefer that you choose another firmware or, better yet, make your own.
|
||||
While we can't prevent the use of this code in products (3D printers, CNC, etc.) that are closed source or crippled by a patent, we would prefer that you choose another firmware or, better yet, make your own.
|
||||
@@ -7,5 +7,5 @@ if [[ $1 == '-d' || $1 == '--default' ]]; then
|
||||
else
|
||||
git checkout Marlin/Configuration.h 2>/dev/null
|
||||
git checkout Marlin/Configuration_adv.h 2>/dev/null
|
||||
git checkout Marlin/src/pins/*/pins_*.h 2>/dev/null
|
||||
git checkout Marlin/src/pins/ramps/pins_RAMPS.h 2>/dev/null
|
||||
fi
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
#
|
||||
# collect-code-tests.py
|
||||
# Convenience script to collect all code tests. Used by env:linux_native_test in native.ini.
|
||||
#
|
||||
|
||||
import pioutil
|
||||
if pioutil.is_pio_build():
|
||||
|
||||
import os, re
|
||||
Import("env")
|
||||
Import("projenv")
|
||||
|
||||
os.environ['PATH'] = f"./buildroot/bin/:./buildroot/tests/:{os.environ['PATH']}"
|
||||
|
||||
def collect_test_suites():
|
||||
"""Get all the test suites"""
|
||||
from pathlib import Path
|
||||
return sorted(list(Path("./test").glob("*.ini")))
|
||||
|
||||
def register_test_suites():
|
||||
"""Register all the test suites"""
|
||||
targets = []
|
||||
test_suites = collect_test_suites()
|
||||
for path in test_suites:
|
||||
name = re.sub(r'^\d+-|\.ini$', '', path.name)
|
||||
targets += [name];
|
||||
|
||||
env.AddCustomTarget(
|
||||
name = f"marlin_{name}",
|
||||
dependencies = None,
|
||||
actions = [
|
||||
f"echo ====== Configuring for marlin_{name} ======",
|
||||
"restore_configs",
|
||||
f"cp -f {path} ./Marlin/config.ini",
|
||||
"python ./buildroot/share/PlatformIO/scripts/configuration.py",
|
||||
f"platformio test -e linux_native_test -f {name}",
|
||||
"restore_configs",
|
||||
],
|
||||
title = "Marlin: {}".format(name.lower().title().replace("_", " ")),
|
||||
description = (
|
||||
f"Run a Marlin test suite, with the appropriate configuration, "
|
||||
f"that sits in {path}"
|
||||
)
|
||||
)
|
||||
|
||||
env.AddCustomTarget(
|
||||
name = "test-marlin",
|
||||
dependencies = None,
|
||||
actions = [
|
||||
f"platformio run -t marlin_{name} -e linux_native_test"
|
||||
for name in targets
|
||||
],
|
||||
title = "Marlin: Test all code test suites",
|
||||
description = (
|
||||
f"Run all Marlin code test suites ({len(targets)} found)."
|
||||
),
|
||||
)
|
||||
|
||||
register_test_suites()
|
||||
+1
-1
@@ -315,6 +315,7 @@ HAS_ZV_SHAPING = build_src_filter=+<src/gcode/feature/in
|
||||
GCODE_MACROS = build_src_filter=+<src/gcode/feature/macro>
|
||||
GRADIENT_MIX = build_src_filter=+<src/gcode/feature/mixing/M166.cpp>
|
||||
NONLINEAR_EXTRUSION = build_src_filter=+<src/gcode/feature/nonlinear>
|
||||
OTA_FIRMWARE_UPDATE = build_src_filter=+<src/gcode/feature/ota>
|
||||
HAS_SAVED_POSITIONS = build_src_filter=+<src/gcode/feature/pause/G60.cpp> +<src/gcode/feature/pause/G61.cpp>
|
||||
PARK_HEAD_ON_PAUSE = build_src_filter=+<src/gcode/feature/pause/M125.cpp>
|
||||
FILAMENT_LOAD_UNLOAD_GCODES = build_src_filter=+<src/gcode/feature/pause/M701_M702.cpp>
|
||||
@@ -340,7 +341,6 @@ TOUCH_SCREEN_CALIBRATION = build_src_filter=+<src/gcode/lcd/M995.c
|
||||
ARC_SUPPORT = build_src_filter=+<src/gcode/motion/G2_G3.cpp>
|
||||
GCODE_MOTION_MODES = build_src_filter=+<src/gcode/motion/G80.cpp>
|
||||
BABYSTEPPING = build_src_filter=+<src/gcode/motion/M290.cpp> +<src/feature/babystep.cpp>
|
||||
OTA_FIRMWARE_UPDATE = build_src_filter=+<src/gcode/ota/M936.cpp>
|
||||
Z_PROBE_SLED = build_src_filter=+<src/gcode/probe/G31_G32.cpp>
|
||||
G38_PROBE_TARGET = build_src_filter=+<src/gcode/probe/G38.cpp>
|
||||
MAGNETIC_PARKING_EXTRUDER = build_src_filter=+<src/gcode/probe/M951.cpp>
|
||||
|
||||
+15
-12
@@ -33,14 +33,22 @@ build_src_filter = ${common.default_src_filter} +<src/HAL/HC32> +<src/HAL/shared
|
||||
build_type = release
|
||||
build_flags =
|
||||
-D ARDUINO_ARCH_HC32
|
||||
-D PLATFORM_M997_SUPPORT # Enable M997 command
|
||||
# note: ddl and arduino debug mode are
|
||||
# automatically enabled with MARLIN_DEV_MODE
|
||||
#-D __DEBUG # force DDL debug mode
|
||||
#-D __CORE_DEBUG # force Arduino core debug mode
|
||||
-D REDIRECT_PRINTF_TO_SERIAL # Redirect core-provided printf to host serial
|
||||
-D F_CPU=SYSTEM_CLOCK_FREQUENCIES.pclk1 # Override F_CPU to PCLK1, as marlin freaks out otherwise...
|
||||
-D PLATFORM_M997_SUPPORT # Enable M997 command
|
||||
|
||||
# hc32 app configuration file
|
||||
board_build.app_config = Marlin/src/HAL/HC32/app_config.h
|
||||
# DDL / Arduino Configuration
|
||||
-D DISABLE_SERIAL_GLOBALS # Disable global Serial objects, we use our own
|
||||
-D CORE_DISABLE_FAULT_HANDLER # Disable arduino core fault handler (we use our own)
|
||||
|
||||
# DDL / Arduino Debug Options
|
||||
#-D __DEBUG # DDL debug mode
|
||||
#-D __CORE_DEBUG # Arduino core debug mode
|
||||
-D PANIC_ENABLE # enable custom panic handlers (in MinSerial)
|
||||
# options to reduce debug mode footprint (-16K; messages are less verbose)
|
||||
-D __DEBUG_SHORT_FILENAMES # Use short filenames in DDL debug output
|
||||
-D __PANIC_SHORT_FILENAMES # Use short filenames in core panic output
|
||||
-D __OMIT_PANIC_MESSAGE # Omit panic messages in core panic output
|
||||
|
||||
# Drivers and Middleware required by the HC32 HAL
|
||||
board_build.ddl.ots = true
|
||||
@@ -50,11 +58,6 @@ board_build.ddl.timer0 = true
|
||||
board_build.ddl.timera = true
|
||||
board_build.mw.sd_card = true
|
||||
|
||||
# extra build flags
|
||||
board_build.flags.common =
|
||||
-g3 # Force emit debug symbols to elf. this does not affect the final binary size
|
||||
-fno-signed-char # Force unsigned chars. this is required for meatpack to work
|
||||
|
||||
# Additional flags to reduce binary size
|
||||
board_build.flags.cpp =
|
||||
-fno-threadsafe-statics # Disable thread-safe statics (only one core anyway)
|
||||
|
||||
+3
-16
@@ -15,26 +15,13 @@
|
||||
[env:linux_native]
|
||||
platform = native
|
||||
framework =
|
||||
build_flags = ${common.build_flags} -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ -Wno-expansion-to-defined
|
||||
build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ -Wno-expansion-to-defined
|
||||
build_src_flags = -Wall -IMarlin/src/HAL/LINUX/include
|
||||
build_unflags = -Wall
|
||||
lib_ldf_mode = off
|
||||
lib_deps =
|
||||
build_src_filter = ${common.default_src_filter} +<src/HAL/LINUX>
|
||||
|
||||
# Environment specifically for unit testing through the Makefile
|
||||
# This is somewhat unorthodox, in that it uses the PlatformIO Unity testing framework,
|
||||
# but actual targets are dynamically generated during the build. This seems to prevent
|
||||
# Unity from being automatically included, so it is added here.
|
||||
[env:linux_native_test]
|
||||
extends = env:linux_native
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
post:buildroot/share/PlatformIO/scripts/collect-code-tests.py
|
||||
build_src_filter = ${env:linux_native.build_src_filter} +<tests>
|
||||
lib_deps = throwtheswitch/Unity@^2.5.2
|
||||
test_build_src = true
|
||||
build_unflags =
|
||||
build_flags = ${env:linux_native.build_flags} -Werror
|
||||
|
||||
#
|
||||
# Native Simulation
|
||||
# Builds with a small subset of available features
|
||||
@@ -57,7 +44,7 @@ debug_build_flags = -fstack-protector-strong -g -g3 -ggdb
|
||||
lib_compat_mode = off
|
||||
build_src_filter = ${common.default_src_filter} +<src/HAL/NATIVE_SIM>
|
||||
lib_deps = ${common.lib_deps}
|
||||
MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/66a2b82c8f.zip
|
||||
MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/8791f3ff43.zip
|
||||
Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/c6b319f447.zip
|
||||
LiquidCrystal=https://github.com/p3p/LiquidCrystal/archive/322fb5fc23.zip
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
+139
-3635
File diff suppressed because it is too large
Load Diff
@@ -1,8 +0,0 @@
|
||||
# This file should remain empty except for the motherboard.
|
||||
# If changes are needed by tests, it should be performed in another configuration.
|
||||
|
||||
[config:base]
|
||||
ini_use_config = base
|
||||
|
||||
# Unit tests must use BOARD_SIMULATED to run natively in Linux
|
||||
motherboard = BOARD_SIMULATED
|
||||
@@ -1,18 +0,0 @@
|
||||
#
|
||||
# Test configuration with a single extruder and a filament runout sensor
|
||||
#
|
||||
[config:base]
|
||||
ini_use_config = base
|
||||
|
||||
# Unit tests must use BOARD_SIMULATED to run natively in Linux
|
||||
motherboard = BOARD_SIMULATED
|
||||
|
||||
# Options to support runout sensors test
|
||||
filament_runout_sensor = on
|
||||
fil_runout_pin = 4 # dummy
|
||||
advanced_pause_feature = on
|
||||
emergency_parser = on
|
||||
nozzle_park_feature = on
|
||||
|
||||
# Option to support testing parsing with parentheses comments enabled
|
||||
paren_comments = on
|
||||
@@ -1,32 +0,0 @@
|
||||
#
|
||||
# Test configuration with three extruders and filament runout sensors
|
||||
#
|
||||
[config:base]
|
||||
ini_use_config = base
|
||||
|
||||
# Unit tests must use BOARD_SIMULATED to run natively in Linux
|
||||
motherboard = BOARD_SIMULATED
|
||||
|
||||
# Options to support runout sensor tests on three extruders.
|
||||
# Options marked "dummy" are simply required to pass sanity checks.
|
||||
extruders = 3
|
||||
temp_sensor_1 = 1
|
||||
temp_sensor_2 = 1
|
||||
temp_2_pin = 4 # dummy
|
||||
temp_3_pin = 4 # dummy
|
||||
heater_2_pin = 4 # dummy
|
||||
e2_step_pin = 4 # dummy
|
||||
e2_dir_pin = 4 # dummy
|
||||
e2_enable_pin = 4 # dummy
|
||||
e3_step_pin = 4 # dummy
|
||||
e3_dir_pin = 4 # dummy
|
||||
e3_enable_pin = 4 # dummy
|
||||
num_runout_sensors = 3
|
||||
filament_runout_sensor = on
|
||||
fil_runout_pin = 4 # dummy
|
||||
fil_runout2_pin = 4 # dummy
|
||||
fil_runout3_pin = 4 # dummy
|
||||
filament_runout_script = "M600 %%c"
|
||||
advanced_pause_feature = on
|
||||
emergency_parser = on
|
||||
nozzle_park_feature = on
|
||||
@@ -1,40 +0,0 @@
|
||||
# Testing Marlin
|
||||
|
||||
Marlin included two types of automated tests:
|
||||
- [Build Tests](../buildroot/tests) to catch syntax and code build errors.
|
||||
- Unit Tests (this folder) to catch implementation errors.
|
||||
|
||||
This document focuses on Unit tests.
|
||||
|
||||
## Unit tests
|
||||
|
||||
Unit testing allows for functional testing of Marlin logic on a local machine. This strategy is available to all developers, and will be able to be used on generic GitHub workers to automate testing. While PlatformIO does support the execution of unit tests on target controllers, that is not yet implemented and not really practical. This would require dedicated testing labs, and would be less broadly usable than testing directly on the development or build machine.
|
||||
|
||||
Unit tests verify the behavior of small discrete sections of Marlin code. By thoroughly unit testing important parts of Marlin code, we effectively provide "guard rails" which will prevent major regressions in behavior. As long as all submissions go through the Pull Request process and execute automated checks, it is possible to catch most major issues prior to completion of a PR.
|
||||
|
||||
## What unit tests can and can't do
|
||||
|
||||
Unit tests can be used to validate the logic of single functions or whole features, as long as that function or feature doesn't depend on real hardware. So, for example, we can test whether a G-code command is parsed correctly and produces all the expected state changes, but we can't test whether a G-code triggered an endstop or the filament runout sensor without adding a new layer to simulate pins.
|
||||
|
||||
Generally speaking, the types of errors caught by unit tests are most often caught in the initial process of writing the tests, and thereafter they shore up the codebase against regressions, especially in core classes and types, which can be very useful for refactoring.
|
||||
|
||||
### Unit test FAQ
|
||||
|
||||
#### Q: Isn't writing unit tests a lot of work?
|
||||
A: Yes, and it can be especially difficult with existing code that wasn't designed for unit testing. Some common sense should be used to decide where to employ unit testing, and at what level to perform it. While unit testing takes effort, it pays dividends in preventing regressions, and helping to pinpoint the source of failures when they do occur.
|
||||
|
||||
#### Q: Will this make refactoring harder?
|
||||
A: Yes and No. Of course if you refactor code that unit tests use directly, it will have to be reworked as well. It actually can make refactoring more efficient, by providing assurance that the mechanism still works as intended.
|
||||
|
||||
#### Q: How can I debug one of these failing unit tests?
|
||||
A: That's a great question, without a known immediate answer. It is likely possible to debug them interactively through PlatformIO, but that can at times take some creativity to configure. Unit tests are generally extremely small, so even without interactive debugging it can get you fairly close to the cause of the problem.
|
||||
|
||||
### Unit test architecture
|
||||
We are currently using [PlatformIO unit tests](https://docs.platformio.org/en/latest/plus/unit-testing.html).
|
||||
|
||||
Since Marlin only compiles code required by the configuration, a separate test binary must be generated for any configuration change. The following process is used to unit test a variety of configurations:
|
||||
|
||||
1. This folder contains a set of INI configuration files (See `config.ini`), each containing a distinct set of configuration options for unit testing. All applicable unit tests will be run for each of these configurations.
|
||||
2. The `Marlin/tests` folder contains the CPP code for all Unit Tests. Marlin macros (`ENABLED(feature)`, `TERN(FEATURE, A, B)`, etc.) are used to determine which tests should be registered and to alter test behavior.
|
||||
3. The `linux_native_test` PlatformIO environment specifies a script to collect all the tests from this folder and add them to PlatformIO's list of test targets.
|
||||
4. Tests are built and executed by the `Makefile` commands `unit-test-all-local` or `unit-test-all-local-docker`.
|
||||
@@ -1,53 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provide the main() function used for all compiled unit test binaries.
|
||||
* It collects all the tests defined in the code and runs them through Unity.
|
||||
*/
|
||||
|
||||
#include "unit_tests.h"
|
||||
|
||||
static std::list<MarlinTest*> all_marlin_tests;
|
||||
|
||||
MarlinTest::MarlinTest(const std::string _name, const void(*_test)(), const char *_file, const int _line)
|
||||
: name(_name), test(_test), file(_file), line(_line) {
|
||||
all_marlin_tests.push_back(this);
|
||||
}
|
||||
|
||||
void MarlinTest::run() {
|
||||
Unity.TestFile = file.c_str();
|
||||
UnityDefaultTestRun((UnityTestFunction)test, name.c_str(), line);
|
||||
}
|
||||
|
||||
void run_all_marlin_tests() {
|
||||
for (const auto registration : all_marlin_tests) {
|
||||
registration->run();
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
UNITY_BEGIN();
|
||||
run_all_marlin_tests();
|
||||
UNITY_END();
|
||||
return 0;
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <unity.h>
|
||||
|
||||
// Include MarlinConfig so configurations are available to all tests
|
||||
#include "src/inc/MarlinConfig.h"
|
||||
|
||||
/**
|
||||
* Class that allows us to dynamically collect tests
|
||||
*/
|
||||
class MarlinTest {
|
||||
public:
|
||||
MarlinTest(const std::string name, const void(*test)(), const char *_file, const int line);
|
||||
/**
|
||||
* Run the test via Unity
|
||||
*/
|
||||
void run();
|
||||
|
||||
/**
|
||||
* The name, a pointer to the function, and the line number. These are
|
||||
* passed to the Unity test framework.
|
||||
*/
|
||||
const std::string name;
|
||||
const void(*test)();
|
||||
const std::string file;
|
||||
const int line;
|
||||
};
|
||||
|
||||
/**
|
||||
* Internal macros used by MARLIN_TEST
|
||||
*/
|
||||
#define _MARLIN_TEST_CLASS_NAME(SUITE, NAME) MarlinTestClass_##SUITE##_##NAME
|
||||
#define _MARLIN_TEST_INSTANCE_NAME(SUITE, NAME) MarlinTestClass_##SUITE##_##NAME##_instance
|
||||
|
||||
/**
|
||||
* Macro to define a test. This will create a class with the test body and
|
||||
* register it with the global list of tests.
|
||||
*
|
||||
* Usage:
|
||||
* MARLIN_TEST(test_suite_name, test_name) {
|
||||
* // Test body
|
||||
* }
|
||||
*/
|
||||
#define MARLIN_TEST(SUITE, NAME) \
|
||||
class _MARLIN_TEST_CLASS_NAME(SUITE, NAME) : public MarlinTest { \
|
||||
public: \
|
||||
_MARLIN_TEST_CLASS_NAME(SUITE, NAME)() : MarlinTest(#SUITE "___" #NAME, (const void(*)())&TestBody, __FILE__, __LINE__) {} \
|
||||
static void TestBody(); \
|
||||
}; \
|
||||
const _MARLIN_TEST_CLASS_NAME(SUITE, NAME) _MARLIN_TEST_INSTANCE_NAME(SUITE, NAME); \
|
||||
void _MARLIN_TEST_CLASS_NAME(SUITE, NAME)::TestBody()
|
||||
Reference in New Issue
Block a user