Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/bugfix-2.1.x' into bugfix-2.1.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	Marlin/Version.h
#	Marlin/src/HAL/HC32/HAL.h
#	Marlin/src/gcode/motion/M290.cpp
#	Marlin/src/inc/Version.h
#	Marlin/src/lcd/e3v2/jyersui/README.md
#	Marlin/src/lcd/e3v2/proui/dwin.cpp
#	Marlin/src/lcd/sovol_rts/sovol_rts.cpp
#	buildroot/bin/build_all_examples
#	buildroot/bin/build_example
#	buildroot/share/PlatformIO/scripts/schema.py
#	ini/lpc176x.ini
  • Loading branch information
Sidiusz committed Dec 8, 2024
2 parents 84ad393 + 3591eb5 commit 786f132
Show file tree
Hide file tree
Showing 19 changed files with 5,332 additions and 2,665 deletions.
72 changes: 56 additions & 16 deletions Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,59 @@
// VENDOR VERSION EXAMPLE //
////////////////////////////

#if TEMP_SENSOR_0 == 5
#define THERMISTOR_NAME "104GT"
#elif TEMP_SENSOR_0 == 13
#define THERMISTOR_NAME "3950"
#endif


#if CONFIGURE_FB_G6_BLTOUCH == 1
#define SHORT_BUILD_VERSION "2.0.1 - bltouch"
#else
#define SHORT_BUILD_VERSION "2.0.1"
#endif

#define MACHINE_NAME "FlyingBear Ghost 6"
#define SOURCE_CODE_URL "github.com/Sidiusz/Marlin-FBG6"
#define STRING_DISTRIBUTION_DATE "18-11-2024"
/**
* Marlin release version identifier
*/
//#define SHORT_BUILD_VERSION "bugfix-2.1.x"

/**
* Verbose version identifier which should contain a reference to the location
* from where the binary was downloaded or the source code was compiled.
*/
//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION

/**
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2024-12-01"

/**
* The protocol for communication to the host. Protocol indicates communication
* standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc.
* (Other behaviors are given by the firmware version and capabilities report.)
*/
//#define PROTOCOL_VERSION "1.0"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
*/
//#define MACHINE_NAME "3D Printer"

/**
* The SOURCE_CODE_URL is the location where users will find the Marlin Source
* Code which is installed on the device. In most cases —unless the manufacturer
* has a distinct Github fork— the Source Code URL should just be the main
* Marlin repository.
*/
//#define SOURCE_CODE_URL "github.com/MarlinFirmware/Marlin"

/**
* Default generic printer UUID.
*/
//#define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff"

/**
* The WEBSITE_URL is the location where users can get more information such as
* documentation about a specific Marlin release.
*/
//#define WEBSITE_URL "marlinfw.org"

/**
* Set the vendor info the serial USB interface, if changeable.
* Currently only supported by DUE platform.
*/
//#define USB_DEVICE_VENDOR_ID 0x0000
//#define USB_DEVICE_PRODUCT_ID 0x0000
//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL
3 changes: 2 additions & 1 deletion Marlin/src/HAL/ESP32/wifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
*/
#ifdef ARDUINO_ARCH_ESP32

#include "../../core/serial.h"
#include "../../inc/MarlinConfigPre.h"

#if ENABLED(WIFISUPPORT)

#include "../../core/serial.h"

#include <WiFi.h>
#include <ESPmDNS.h>
#include <ESPAsyncWebServer.h>
Expand Down
167 changes: 167 additions & 0 deletions Marlin/src/HAL/HC32/HAL.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 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/>.
*
*/

/**
* HAL for HC32F460 based boards
*
* Note: MarlinHAL class is in MarlinHAL.h/cpp
*/

#define CPU_32_BIT

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

#include "../shared/Marduino.h"
#include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h"

#include "fastio.h"
#include "timers.h"
#include "MarlinSerial.h"

//
// Serial Ports
//
#define _MSERIAL(X) MSerial##X
#define MSERIAL(X) _MSERIAL(X)
#define NUM_UARTS 4

#if SERIAL_PORT == -1
#error "USB Serial is not supported on HC32F460"
#elif WITHIN(SERIAL_PORT, 1, NUM_UARTS)
#define MYSERIAL1 MSERIAL(SERIAL_PORT)
#else
#define MYSERIAL1 MSERIAL(1) // Dummy port
static_assert(false, "SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ".")
#endif

#ifdef SERIAL_PORT_2
#if SERIAL_PORT_2 == -1
#error "USB Serial is not supported on HC32F460"
#elif WITHIN(SERIAL_PORT_2, 1, NUM_UARTS)
#define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
#else
#define MYSERIAL2 MSERIAL(1) // Dummy port
static_assert(false, "SERIAL_PORT_2 must be from 1 to " STRINGIFY(NUM_UARTS) ".")
#endif
#endif

#ifdef SERIAL_PORT_3
#if SERIAL_PORT_3 == -1
#error "USB Serial is not supported on HC32F460"
#elif WITHIN(SERIAL_PORT_3, 1, NUM_UARTS)
#define MYSERIAL3 MSERIAL(SERIAL_PORT_3)
#else
#define MYSERIAL3 MSERIAL(1) // Dummy port
static_assert(false, "SERIAL_PORT_3 must be from 1 to " STRINGIFY(NUM_UARTS) ".")
#endif
#endif

#ifdef LCD_SERIAL_PORT
#if LCD_SERIAL_PORT == -1
#error "USB Serial is not supported on HC32F460"
#elif WITHIN(LCD_SERIAL_PORT, 1, NUM_UARTS)
#define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
#else
#define LCD_SERIAL MSERIAL(1) // Dummy port
static_assert(false, "LCD_SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ".")
#endif

#if HAS_DGUS_LCD
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
#endif
#endif

//
// Emergency Parser
//
#if ENABLED(EMERGENCY_PARSER)
extern "C" void usart_rx_irq_hook(uint8_t ch, uint8_t usart);
#endif

//
// Misc. Defines
//
#define square(x) ((x) * (x))

#ifndef strncpy_P
#define strncpy_P(dest, src, num) strncpy((dest), (src), (num))
#endif

//
// Misc. Functions
//
#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) pin_t(p)
#endif

#define CRITICAL_SECTION_START() \
const bool irqon = !__get_PRIMASK(); \
__disable_irq(); \
__DSB();
#define CRITICAL_SECTION_END() \
__DSB(); \
if (irqon) __enable_irq();

#define cli() __disable_irq()
#define sei() __enable_irq()

// bss_end alias
#define __bss_end __bss_end__

// Fix bug in pgm_read_ptr
#undef pgm_read_ptr
#define pgm_read_ptr(addr) (*(addr))

//
// ADC
//
#define HAL_ADC_VREF_MV 3300
#define HAL_ADC_RESOLUTION 12

#define GET_PIN_MAP_PIN(index) index
#define GET_PIN_MAP_INDEX(pin) pin
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)

//
// Debug port disable
// JTMS / SWDIO = PA13
// JTCK / SWCLK = PA14
// JTDI = PA15
// JTDO = PB3
// NJTRST = PB4
//
#define DBG_SWCLK _BV(0)
#define DBG_SWDIO _BV(1)
#define DBG_TDO _BV(2)
#define DBG_TDI _BV(3)
#define DBG_TRST _BV(4)
#define DBG_ALL (DBG_SWCLK | DBG_SWDIO | DBG_TDO | DBG_TDI | DBG_TRST)

#define JTAGSWD_RESET() PORT_DebugPortSetting(DBG_ALL, Enable);
#define JTAG_DISABLE() PORT_DebugPortSetting(DBG_TDO | DBG_TDI | DBG_TRST, Disable);
#define JTAGSWD_DISABLE() PORT_DebugPortSetting(DBG_ALL, Disable);

//
// MarlinHAL implementation
//
#include "MarlinHAL.h"
4 changes: 0 additions & 4 deletions Marlin/src/feature/mixing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@

Mixer mixer;

#ifdef MIXER_NORMALIZER_DEBUG
#include "../core/serial.h"
#endif

// Used up to Planner level
uint_fast8_t Mixer::selected_vtool = 0;
float Mixer::collector[MIXING_STEPPERS]; // mix proportion. 0.0 = off, otherwise <= COLOR_A_MASK.
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/powerloss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@

#if ENABLED(POWER_LOSS_RECOVERY)

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

#include "powerloss.h"
#include "../core/macros.h"

bool PrintJobRecovery::enabled; // Initialized by settings.load()

Expand All @@ -52,7 +53,6 @@ uint32_t PrintJobRecovery::cmd_sdpos, // = 0
#include "../module/planner.h"
#include "../module/printcounter.h"
#include "../module/temperature.h"
#include "../core/serial.h"

#if HOMING_Z_WITH_PROBE
#include "../module/probe.h"
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/gcode/eeprom/M500-M504.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include "../gcode.h"
#include "../../module/settings.h"
#include "../../core/serial.h"
#include "../../inc/MarlinConfig.h"

#if ENABLED(CONFIGURATION_EMBEDDING)
Expand Down
10 changes: 6 additions & 4 deletions Marlin/src/gcode/motion/M290.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
#include "../../feature/babystep.h"
#include "../../module/probe.h"
#include "../../module/planner.h"
extern bool baby_step_set_data;
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
#include "../../core/serial.h"
#endif

#if ENABLED(MESH_BED_LEVELING)
#include "../../feature/bedlevel/bedlevel.h"
Expand Down Expand Up @@ -131,4 +127,10 @@ void GcodeSuite::M290() {
}
}

#if ENABLED(EP_BABYSTEPPING) && DISABLED(EMERGENCY_PARSER)
// Without Emergency Parser M293/M294 will be added to the queue
void GcodeSuite::M293() { babystep.z_up(); }
void GcodeSuite::M294() { babystep.z_down(); }
#endif

#endif // BABYSTEPPING
1 change: 0 additions & 1 deletion Marlin/src/gcode/stats/M31.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/

#include "../gcode.h"
#include "../../core/serial.h"
#include "../../module/printcounter.h"
#include "../../libs/duration_t.h"
#include "../../lcd/marlinui.h"
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Release version. Leave the Marlin version or apply a custom scheme.
*/
#ifndef SHORT_BUILD_VERSION
#define SHORT_BUILD_VERSION "2.1.2"
#define SHORT_BUILD_VERSION "bugfix-2.1.x"
#endif

/**
Expand All @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2022-12-17"
#define STRING_DISTRIBUTION_DATE "2024-12-01"
#endif

/**
Expand All @@ -52,7 +52,7 @@
* to alert users to major changes.
*/

#define MARLIN_HEX_VERSION 02010200
#define MARLIN_HEX_VERSION 02010300
#ifndef REQUIRED_CONFIGURATION_H_VERSION
#define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION
#endif
Expand Down Expand Up @@ -101,8 +101,8 @@
#endif

/**
* Set the vendor info the serial USB interface, if changable
* Currently only supported by DUE platform
* Set the vendor info the serial USB interface, if changeable.
* Currently only supported by DUE platform.
*/
#ifndef USB_DEVICE_VENDOR_ID
#define USB_DEVICE_VENDOR_ID 0x03EB /* ATMEL VID */
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/lcd/e3v2/creality/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
#include "../../../sd/cardreader.h"

#include "../../../MarlinCore.h"
#include "../../../core/serial.h"
#include "../../../core/macros.h"
#include "../../../gcode/queue.h"

#include "../../../module/temperature.h"
Expand Down
7 changes: 0 additions & 7 deletions Marlin/src/lcd/e3v2/jyersui/README.md

This file was deleted.

Loading

0 comments on commit 786f132

Please sign in to comment.