Skip to content

Commit

Permalink
Update - HC32 not compiling - revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
classicrocker883 committed Apr 6, 2024
1 parent 6b223c4 commit 468cf2e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
12 changes: 6 additions & 6 deletions Marlin/src/HAL/HC32/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* 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"
// #pragma once
// #ifndef _HC32_APP_CONFIG_H_
// #define _HC32_APP_CONFIG_H_
//
// #include "../../inc/MarlinConfigPre.h"

//
// dev mode
Expand Down Expand Up @@ -67,4 +67,4 @@
// FIXME override F_CPU to PCLK1, as marlin freaks out otherwise
#define F_CPU (SYSTEM_CLOCK_FREQUENCIES.pclk1)

#endif // _HC32_APP_CONFIG_H_
// #endif // _HC32_APP_CONFIG_H_
5 changes: 5 additions & 0 deletions Marlin/src/HAL/HC32/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
#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
Expand Down
25 changes: 16 additions & 9 deletions ini/hc32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,23 @@ 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 DDL_STACK_SIZE=0x800
#-D DDL_HEAP_SIZE=0x1000
-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

# 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

# hc32 app configuration file
board_build.app_config = Marlin/src/HAL/HC32/app_config.h
# Drivers and Middleware required by the HC32 HAL
board_build.ddl.ots = true
board_build.ddl.sdioc = true
Expand Down

0 comments on commit 468cf2e

Please sign in to comment.