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 1 commit
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
Prev Previous commit
Next Next commit
headers besides HAL.h get Cond_post
  • Loading branch information
thinkyhead committed Nov 29, 2023
commit 7ec2b927fecff786227457fddf382c657bbbd570
27 changes: 15 additions & 12 deletions Marlin/src/HAL/STM32F1/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
* HAL for stm32duino.com based on Libmaple and compatible (STM32F1)
*/

#if defined(__STM32F1__)
#ifdef __STM32F1__

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

#if !defined(VOXELAB_N32)
#ifndef VOXELAB_N32

#include <STM32ADC.h>

Expand Down Expand Up @@ -72,6 +72,8 @@
// ADC
// ------------------------

#include "adc.h"

static uint16_t adc_results[ADC_COUNT];

// Init the AD in continuous capture mode
Expand Down Expand Up @@ -233,16 +235,17 @@ void MarlinHAL::init() {
// HAL idle task
void MarlinHAL::idletask() {
#if HAS_SHARED_MEDIA
// If Marlin is using the SD card we need to lock it to prevent access from
// a PC via USB.
// Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but
// this will not reliably detect delete operations. To be safe we will lock
// the disk if Marlin has it mounted. Unfortunately there is currently no way
// to unmount the disk from the LCD menu.
// if (IS_SD_PRINTING() || IS_SD_FILE_OPEN())
/* copy from lpc1768 framework, should be fixed later for process HAS_SD_HOST_DRIVE*/
// process USB mass storage device class loop
MarlinMSC.loop();
/**
* When Marlin is using the SD card it should be locked to prevent it being
* accessed from a PC over USB.
* Other HALs use (IS_SD_PRINTING() || IS_SD_FILE_OPEN()) to check for access
* but this won't reliably detect other file operations. To be safe we just lock
* the drive whenever Marlin has it mounted. LCDs should include an Unmount
* command so drives can be released as needed.
*/
/* Copied from LPC1768 framework. Should be fixed later to process HAS_SD_HOST_DRIVE */
//if (!drive_locked()) // TODO
MarlinMSC.loop(); // Process USB mass storage device class loop
#endif
}

Expand Down
25 changes: 0 additions & 25 deletions Marlin/src/HAL/STM32F1/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,31 +183,6 @@ typedef int8_t pin_t;
// ADC
// ------------------------

enum ADCIndex : uint8_t {
OPTITEM(HAS_TEMP_ADC_0, TEMP_0)
OPTITEM(HAS_TEMP_ADC_1, TEMP_1)
OPTITEM(HAS_TEMP_ADC_2, TEMP_2)
OPTITEM(HAS_TEMP_ADC_3, TEMP_3)
OPTITEM(HAS_TEMP_ADC_4, TEMP_4)
OPTITEM(HAS_TEMP_ADC_5, TEMP_5)
OPTITEM(HAS_TEMP_ADC_6, TEMP_6)
OPTITEM(HAS_TEMP_ADC_7, TEMP_7)
OPTITEM(HAS_HEATED_BED, TEMP_BED)
OPTITEM(HAS_TEMP_CHAMBER, TEMP_CHAMBER)
OPTITEM(HAS_TEMP_ADC_PROBE, TEMP_PROBE)
OPTITEM(HAS_TEMP_COOLER, TEMP_COOLER)
OPTITEM(HAS_TEMP_BOARD, TEMP_BOARD)
OPTITEM(HAS_TEMP_SOC, TEMP_SOC)
OPTITEM(FILAMENT_WIDTH_SENSOR, FILWIDTH)
OPTITEM(HAS_ADC_BUTTONS, ADC_KEY)
OPTITEM(HAS_JOY_ADC_X, JOY_X)
OPTITEM(HAS_JOY_ADC_Y, JOY_Y)
OPTITEM(HAS_JOY_ADC_Z, JOY_Z)
OPTITEM(POWER_MONITOR_CURRENT, POWERMON_CURRENT)
OPTITEM(POWER_MONITOR_VOLTAGE, POWERMON_VOLTS)
ADC_COUNT
};

#ifdef ADC_RESOLUTION
#define HAL_ADC_RESOLUTION ADC_RESOLUTION
#else
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/STM32F1/HAL_N32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "HAL_N32.h"
#include "HAL.h"

#include "adc.h"
static uint16_t adc_results[ADC_COUNT];

void ADC_Init(ADC_Module* NS_ADCx, ADC_InitType* ADC_InitStruct) {
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/HAL/STM32F1/HAL_N32.h
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,6 @@ typedef struct {
#define RCC_AHB_PERIPH_ADC3 ((uint32_t)0x00004000)
#define RCC_AHB_PERIPH_ADC4 ((uint32_t)0x00008000)

static uint16_t adc_results[ADC_COUNT];

void ADC_Init(ADC_Module* NS_ADCx, ADC_InitType* ADC_InitStruct);

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

// Copied from ~/.platformio/packages/framework-arduinoststm32-maple/STM32F1/system/libmaple/usart_private.h
// Changed to handle Emergency Parser
static
#if MB(VOXELAB_AQUILA)
inline
#endif
__always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb, usart_reg_map *regs, MSerialT &serial) {
static TERN_(INLINE_USART_IRQ, inline) __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
53 changes: 53 additions & 0 deletions Marlin/src/HAL/STM32F1/adc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (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

/**
* HAL for stm32duino.com based on Libmaple and compatible (STM32F1)
*/

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

enum ADCIndex : uint8_t {
OPTITEM(HAS_TEMP_ADC_0, TEMP_0)
OPTITEM(HAS_TEMP_ADC_1, TEMP_1)
OPTITEM(HAS_TEMP_ADC_2, TEMP_2)
OPTITEM(HAS_TEMP_ADC_3, TEMP_3)
OPTITEM(HAS_TEMP_ADC_4, TEMP_4)
OPTITEM(HAS_TEMP_ADC_5, TEMP_5)
OPTITEM(HAS_TEMP_ADC_6, TEMP_6)
OPTITEM(HAS_TEMP_ADC_7, TEMP_7)
OPTITEM(HAS_HEATED_BED, TEMP_BED)
OPTITEM(HAS_TEMP_CHAMBER, TEMP_CHAMBER)
OPTITEM(HAS_TEMP_ADC_PROBE, TEMP_PROBE)
OPTITEM(HAS_TEMP_COOLER, TEMP_COOLER)
OPTITEM(HAS_TEMP_BOARD, TEMP_BOARD)
OPTITEM(HAS_TEMP_SOC, TEMP_SOC)
OPTITEM(FILAMENT_WIDTH_SENSOR, FILWIDTH)
OPTITEM(HAS_ADC_BUTTONS, ADC_KEY)
OPTITEM(HAS_JOY_ADC_X, JOY_X)
OPTITEM(HAS_JOY_ADC_Y, JOY_Y)
OPTITEM(HAS_JOY_ADC_Z, JOY_Z)
OPTITEM(POWER_MONITOR_CURRENT, POWERMON_CURRENT)
OPTITEM(POWER_MONITOR_VOLTAGE, POWERMON_VOLTS)
ADC_COUNT
};
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_bed_leveling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
//
void _lcd_level_bed_moving() {
if (ui.should_draw()) {
MString<9> msg;
MString<10> msg;
msg.setf(F(" %i / %u"), int(manual_probe_index + 1), total_probe_points);
MenuItem_static::draw(LCD_HEIGHT / 2, GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), SS_CENTER, msg);
}
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/pins/gd32f1/pins_VOXELAB_AQUILA.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#define DEFAULT_MACHINE_NAME "Aquila"
#endif

#define INLINE_USART_IRQ

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

#include "../stm32f1/pins_CREALITY_V4.h"