Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Voxelab Aquila Support, additional HC32 details, ProUI fixes. #26470

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4ca1134
Fix menu.h _draw, fstr -> ftpl
classicrocker883 Nov 25, 2023
6c8de12
Merge branch 'MarlinFirmware:bugfix-2.1.x' into bugfix-2.1.x-Nov4
classicrocker883 Nov 25, 2023
ef90bb1
Merge branch 'MarlinFirmware:bugfix-2.1.x' into bugfix-2.1.x-Nov4
classicrocker883 Nov 27, 2023
66f25b7
take care of warnings
classicrocker883 Nov 27, 2023
cd8268f
Add Voxelab Aquila support
classicrocker883 Nov 27, 2023
effab6d
DWIN displays work better w/ ENCODER_WAIT_MS 10
classicrocker883 Nov 27, 2023
1803f5c
initial cleanup
thinkyhead Nov 28, 2023
666297e
Closer match to STM32F1
thinkyhead Nov 29, 2023
159e58b
consolidate
thinkyhead Nov 29, 2023
aefe761
Perhaps (?)
thinkyhead Nov 29, 2023
7ec2b92
headers besides HAL.h get Cond_post
thinkyhead Nov 29, 2023
2bd2507
cleanup
thinkyhead Nov 29, 2023
935d44f
translate
thinkyhead Nov 29, 2023
4d51fa5
one less
thinkyhead Nov 29, 2023
a81adbc
Update pins_AQUILA_101.h
classicrocker883 Nov 29, 2023
5147554
fix adc
thinkyhead Nov 29, 2023
c177b38
redundant
thinkyhead Nov 29, 2023
3a147f5
Already runs custom_board.py
thinkyhead Nov 29, 2023
9bebe51
allow 512k build, but warn
thinkyhead Nov 29, 2023
a772f10
just wrap ADC init
thinkyhead Nov 30, 2023
389e48f
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Dec 1, 2023
bf5978b
SAMD51 ADCs
thinkyhead Dec 1, 2023
72e3ea9
Update hc32.ini
classicrocker883 Dec 1, 2023
9db7a30
Update boards.h
classicrocker883 Dec 1, 2023
eca7118
fix drawInt to "long value"
classicrocker883 Dec 1, 2023
fc51c28
fix error for BTT_SKR_MINI_E3_V3_0_1
classicrocker883 Dec 2, 2023
3e75d64
keep old names
thinkyhead Dec 2, 2023
e5fbca7
shorter
thinkyhead Dec 2, 2023
2e2bc47
revert Conditionals_adv.h
classicrocker883 Dec 2, 2023
9eca3eb
Merge branch 'bugfix-2.1.x-Nov4' of https://github.com/classicrocker8…
classicrocker883 Dec 2, 2023
90f35ee
✅ Temporary CI Tests for 2.1.x
thinkyhead Dec 1, 2023
f52cc53
🧑‍💻 More num-to-string digits / precisions (#26343)
ellensp Dec 1, 2023
40f5bbc
[cron] Bump distribution date (2023-12-02)
thinkyhead Dec 2, 2023
8801769
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into pr/26470
thinkyhead Dec 2, 2023
c28fd79
fix for STM32F401RC_btt
classicrocker883 Dec 2, 2023
b8f0782
Merge branch 'bugfix-2.1.x-Nov4' of https://github.com/classicrocker8…
classicrocker883 Dec 2, 2023
37bbe74
Merge branch 'bugfix-2.1.x' into pr/26470
thinkyhead Dec 2, 2023
a6d4696
developer note
thinkyhead Dec 2, 2023
d3c72d2
or, rather…
thinkyhead Dec 2, 2023
ceed393
just in case
thinkyhead Dec 2, 2023
5467d74
32 bit pin type
thinkyhead Dec 2, 2023
7a52a05
Update adc.h
classicrocker883 Dec 3, 2023
c049e45
Merge branch 'bugfix-2.1.x' into pr/26470
thinkyhead Dec 5, 2023
708dd91
Try FORCE_INLINE
thinkyhead Dec 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,866 changes: 1,865 additions & 1 deletion Marlin/src/HAL/STM32F1/HAL.cpp

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Marlin/src/HAL/STM32F1/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@

// Copied from ~/.platformio/packages/framework-arduinoststm32-maple/STM32F1/system/libmaple/usart_private.h
// Changed to handle Emergency Parser
static __always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb, usart_reg_map *regs, MSerialT &serial) {
static
#if MB(VOXELAB_AQUILA)
thinkyhead marked this conversation as resolved.
Show resolved Hide resolved
inline
#endif
__always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb, usart_reg_map *regs, MSerialT &serial) {
/* Handle RXNEIE and TXEIE interrupts.
* RXNE signifies availability of a byte in DR.
*
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32F1/timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ typedef uint16_t hal_timer_t;
//#define MF_TIMER_TEMP 4 // 2->4, Timer 2 for Stepper Current PWM
#endif

#if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_E3_DIP, BTT_SKR_MINI_E3_V1_2, MKS_ROBIN_LITE, MKS_ROBIN_E3D, MKS_ROBIN_E3)
#if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_E3_DIP, BTT_SKR_MINI_E3_V1_2, MKS_ROBIN_LITE, MKS_ROBIN_E3D, MKS_ROBIN_E3, VOXELAB_AQUILA)
// SKR Mini E3 boards use PA8 as FAN0_PIN, so TIMER 1 is used for Fan PWM.
#ifdef STM32_HIGH_DENSITY
#define MF_TIMER_SERVO0 8 // tone.cpp uses Timer 4
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@
#define BOARD_TRIGORILLA_V006 5068 // Trigorilla V0.0.6 (GD32F103RE)
#define BOARD_KEDI_CONTROLLER_V1_2 5069 // EDUTRONICS Kedi Controller V1.2 (STM32F103RC)
#define BOARD_MD_D301 5070 // Mingda D2 DZ301 V1.0 (STM32F103ZE)
#define BOARD_VOXELAB_AQUILA 5071 // Voxelab Aquila V1.0.0/V1.0.1 (GD32F103RC / N32G455RE / STM32F103RE)

//
// ARM Cortex-M4F
Expand Down Expand Up @@ -513,7 +514,7 @@
//
// HC32 ARM Cortex-M4
//
#define BOARD_AQUILA_V101 7200 // Aquila V1.0.1 as found in the Voxelab Aquila X2
#define BOARD_AQUILA_V101 7200 // Voxelab Aquila V1.0.1/V1.0.2/V1.0.3 as found in the Voxelab Aquila X2 and C2

//
// Custom board
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@
/**
* Maple environment
*/
#ifdef __STM32F1__
#if __STM32F1__ && DISABLED(NO_MAPLE_WARNING)
#warning "Maple build environments are deprecated. Please use a non-Maple build environment. Report issues to the Marlin Firmware project."
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/common/encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef enum {
ENCODER_DIFF_ENTER = 3 // click
} EncoderState;

#define ENCODER_WAIT_MS 20
#define ENCODER_WAIT_MS TERN(DWIN_LCD_PROUI, 10, 20)

// Encoder initialization
void encoderConfiguration();
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ bool BedLevelTools::meshValidate() {
// Draw value text on
const uint8_t fs = DWINUI::fontWidth(meshfont);
if (viewer_print_value) {
xy_uint_t offset { 0, cell_height_px / 2 - fs };
xy_uint_t offset;
offset.y = cell_height_px / 2 - fs;
thinkyhead marked this conversation as resolved.
Show resolved Hide resolved
if (isnan(bedlevel.z_values[x][y])) { // undefined
dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset.y, F("X"));
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void dwinWriteToMem(uint8_t mem, uint16_t addr, uint16_t length, uint8_t *data)
dwinWord(i, addr + indx); // start address of the data block
++i;
for (uint8_t j = 0; j < i; ++j) { LCD_SERIAL.write(dwinSendBuf[j]); delayMicroseconds(1); } // Buf header
for (uint16_t j = indx; j <= indx + to_send - 1; j++) LCD_SERIAL.write(*(data + j)); delayMicroseconds(1); // write block of data
for (uint16_t j = indx; j <= indx + to_send - 1; j++) { LCD_SERIAL.write(*(data + j)); delayMicroseconds(1); } // write block of data
for (uint8_t j = 0; j < 4; ++j) { LCD_SERIAL.write(dwinBufTail[j]); delayMicroseconds(1); }
block++;
pending -= to_send;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/proui/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void onDrawMenuItem(MenuItem* menuitem, int8_t line) {
if (menuitem->icon) DWINUI::drawIcon(menuitem->icon, ICOX, MBASE(line) - 3);
if (menuitem->frameid)
dwinFrameAreaCopy(menuitem->frameid, menuitem->frame.left, menuitem->frame.top, menuitem->frame.right, menuitem->frame.bottom, LBLX, MBASE(line));
else if (menuitem->caption)
else
thinkyhead marked this conversation as resolved.
Show resolved Hide resolved
DWINUI::drawString(LBLX, MBASE(line) - 1, menuitem->caption);
dwinDrawHLine(hmiData.colorSplitLine, 16, MYPOS(line + 1), 240);
}
Expand Down
37 changes: 37 additions & 0 deletions Marlin/src/pins/gd32f1/pins_VOXELAB_AQUILA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2022 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

/**
* FFP0173_Aquila_Main_Board_V1.0.1 (GD32F103RC / N32G455RE)
*
* Uses CREALITY V4 (STM32F103RE / STM32F103RC) board pin assignments
*/

#define BOARD_INFO_NAME "Aquila v1.0.1"
#ifndef DEFAULT_MACHINE_NAME
#define DEFAULT_MACHINE_NAME "Aquila"
#endif

#define NO_MAPLE_WARNING // Disable warning when compiling with Maple env

#include "../stm32f1/pins_CREALITY_V4.h"
20 changes: 18 additions & 2 deletions Marlin/src/pins/hc32f4/pins_AQUILA_101.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#pragma once

//
// Voxelab Aquila V1.0.1 and V1.0.2 (HC32F460) as found in the Voxelab Aquila X2
// Voxelab Aquila V1.0.1/V1.0.2/V1.0.3 (HC32F460) as found in the Voxelab Aquila X2 and C2
thinkyhead marked this conversation as resolved.
Show resolved Hide resolved
//
#include "env_validate.h"

Expand Down Expand Up @@ -152,7 +152,23 @@
#define EXP1_07_PIN PB12 // EN2
#define EXP1_08_PIN PB15 // EN1

#if ANY(HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
#if ENABLED(CR10_STOCKDISPLAY) // LCD used for C2
#undef LCD_SERIAL_PORT
#define LCD_SERIAL_PORT 1

#define LCD_PINS_RS EXP1_07_PIN
#define LCD_PINS_EN EXP1_08_PIN
#define LCD_PINS_D4 EXP1_06_PIN

#define BTN_ENC EXP1_02_PIN
#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN

#ifndef HAS_PIN_27_BOARD
#define BEEPER_PIN EXP1_01_PIN
#endif

#elif ANY(HAS_DWIN_E3V2, IS_DWIN_MARLINUI) // LCD used for X2
/**
* Display pinout (display side, so RX/TX are swapped)
*
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,8 @@
#include "stm32f1/pins_KEDI_CONTROLLER_V1_2.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_USB env:STM32F103RC_btt_maple env:STM32F103RC_btt_USB_maple
#elif MB(MD_D301)
#include "stm32f1/pins_MD_D301.h" // STM32F1 env:mingda_d301 env:mingda_d301_maple

#elif MB(VOXELAB_AQUILA)
#include "gd32f1/pins_VOXELAB_AQUILA.h" // GD32F1, N32G4, STM32F1 env:GD32F103RC_voxelab_maple env:N32G455RE_voxelab_maple env:STM32F103RE_creality_maple env:STM32F103RE_creality
//
// ARM Cortex-M4F
//
Expand Down
2 changes: 1 addition & 1 deletion ini/hc32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ extends = HC32F460_base
board_build.ld_args.flash_size = 512K

#
# Aquila V1.0.1 Mainboard, as found in the Voxelab Aquila X2
# Voxelab Aquila V1.0.1/V1.0.2/V1.0.3 as found in the Voxelab Aquila X2 & C2
#
[env:HC32F460C_aquila_101]
extends = HC32F460C_base
Expand Down
27 changes: 27 additions & 0 deletions ini/stm32f1-maple.ini
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,33 @@ extends = env:STM32F103RE_creality_maple
board_build.address = 0x08010000
board_build.ldscript = crealityPro.ld

#
# Voxelab Aquila V1.0.1
#
# GD32F103RC_voxelab_maple ........ GD32F103RCT6 with 256K
# N32G455RE_voxelab_maple ......... N32G455REL7 - cannot be flashed over 256K
#
[env:GD32F103RC_voxelab_maple]
extends = env:STM32F103RC_maple
build_flags = ${env:STM32F103RC_maple.build_flags} -DTEMP_TIMER_CHAN=4
board_build.address = 0x08007000
board_build.ldscript = creality256k.ld
extra_scripts = ${env:STM32F103RC_maple.extra_scripts}
buildroot/share/PlatformIO/scripts/custom_board.py
debug_tool = jlink
upload_protocol = jlink

[env:N32G455RE_voxelab_maple]
extends = env:STM32F103RC_maple
thinkyhead marked this conversation as resolved.
Show resolved Hide resolved
build_flags = ${env:STM32F103RC_maple.build_flags} -DTEMP_TIMER_CHAN=4
-DVOXELAB_N32
board_build.address = 0x08007000
board_build.ldscript = creality256k.ld
extra_scripts = ${env:STM32F103RC_maple.extra_scripts}
buildroot/share/PlatformIO/scripts/custom_board.py
debug_tool = jlink
upload_protocol = jlink

#
# BigTreeTech SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3)
#
Expand Down