1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-30 07:17:59 +00:00

🩹Free debug pins in HC32 HAL (#26985)

implements DISABLE_DEBUG and DISABLE_JTAG in HAL
This commit is contained in:
Chris 2024-04-29 00:59:28 +02:00 committed by GitHub
parent a2f024ffe3
commit a8058729cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 4 deletions

View File

@ -148,6 +148,25 @@
#define GET_PIN_MAP_INDEX(pin) pin #define GET_PIN_MAP_INDEX(pin) pin
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) #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 // MarlinHAL implementation
// //

View File

@ -45,10 +45,13 @@
#endif #endif
// //
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // Release JTAG pins but keep SWD enabled
// - PA15 (JTDI / USART2 RX)
// - PB3 (JTDO / E0_DIR)
// - PB4 (NJTRST / E0_STEP)
// //
//#define DISABLE_DEBUG //#define DISABLE_DEBUG
//#define DISABLE_JTAG #define DISABLE_JTAG
// //
// EEPROM // EEPROM

View File

@ -46,10 +46,13 @@
#endif #endif
// //
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // Release JTAG pins but keep SWD enabled
// - PA15 (JTDI / E0_DIR_PIN)
// - PB3 (JTDO / E0_STEP_PIN)
// - PB4 (NJTRST / E0_ENABLE_PIN)
// //
//#define DISABLE_DEBUG //#define DISABLE_DEBUG
//#define DISABLE_JTAG #define DISABLE_JTAG
// //
// EEPROM // EEPROM