Skip to content

Commit 8b0ff3b

Browse files
committed
Auto-flag Timer6 IRQ and print stack at init
Update GD32 validation to mark when Timer6 IRQ is required by DMX/RDM/LTC features and automatically add `CONFIG_TIMER6_HAVE_NO_IRQ_HANDLER` otherwise, while still erroring on conflicting manual flags. In board initialization, always include and run I2C detect plus stack debug printing to improve startup diagnostics.
1 parent 13292b6 commit 8b0ff3b

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

common/make/gd32/Validate.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ ifneq ($(findstring _TIME_STAMP_YEAR_,$(FLAGS)),_TIME_STAMP_YEAR_)
1212
endif
1313

1414
ifneq (,$(findstring OUTPUT_DMX_SEND,$(FLAGS))$(findstring CONFIG_RDM,$(FLAGS))$(findstring RDM_CONTROLLER,$(FLAGS))$(findstring LTC,$(FLAGS)))
15+
TIMER6_HAVE_IRQ_HANDLER=1
1516
ifneq (,$(findstring CONFIG_TIMER6_HAVE_NO_IRQ_HANDLER,$(MAKE_FLAGS)))
1617
$(error CONFIG_TIMER6_HAVE_NO_IRQ_HANDLER is set)
1718
endif
1819
endif
1920

21+
ifndef TIMER6_HAVE_IRQ_HANDLER
22+
DEFINES+=-DCONFIG_TIMER6_HAVE_NO_IRQ_HANDLER
23+
endif
24+
2025
ifeq ($(findstring CONFIG_REMOTECONFIG_MINIMUM,$(FLAGS)),CONFIG_REMOTECONFIG_MINIMUM)
2126
DEFINES+=-DCONFIG_NET_APPS_NO_MDNS
2227
else

lib-board/src/gd32/board_init.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* THE SOFTWARE.
2424
*/
2525

26+
#include "firmware/debug/debug_stack.h"
2627
#if !defined(_TIME_STAMP_DAY_)
2728
#define _TIME_STAMP_DAY_ 0
2829
#endif
@@ -62,9 +63,7 @@
6263
#if defined(ENABLE_USB_HOST)
6364
#include "device/usb.h"
6465
#endif
65-
#if defined(DEBUG_I2C)
6666
#include "firmware/debug/debug_i2cdetect.h"
67-
#endif
6867
#include "board_statusled.h"
6968
#include "panelled.h"
7069
#include "logic_analyzer.h"
@@ -260,12 +259,12 @@ void Init() {
260259
#endif
261260
#endif
262261

263-
#if defined(DEBUG_I2C)
264262
debug::i2c::Detect();
265-
#endif
266263

267264
#if !defined(USE_FREE_RTOS)
268265
board::statusled::SetFrequency(1);
269266
#endif
267+
268+
debug::stack::Print();
270269
}
271270
} // namespace board

0 commit comments

Comments
 (0)