From 3288672d48d3071793c53a5609ea594a57fccde5 Mon Sep 17 00:00:00 2001 From: Dimitris Mantzouranis Date: Wed, 11 Sep 2024 16:44:20 +0300 Subject: [PATCH] sn32: boards: pwm: disable SWD on init --- .../boards/SN_SN32F240B_PWM/board/board.c | 19 +++++++++++++++++++ .../boards/SN_SN32F240B_PWM/board/board.mk | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 platforms/chibios/boards/SN_SN32F240B_PWM/board/board.c diff --git a/platforms/chibios/boards/SN_SN32F240B_PWM/board/board.c b/platforms/chibios/boards/SN_SN32F240B_PWM/board/board.c new file mode 100644 index 000000000000..8fc9a63bfb7b --- /dev/null +++ b/platforms/chibios/boards/SN_SN32F240B_PWM/board/board.c @@ -0,0 +1,19 @@ +/* Copyright 2024 Dimitris Mantzouranis + * + * 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 2 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 . + */ +void board_init(void) { + SN_SYS0->EXRSTCTRL_b.RESETDIS = 1; // Disable RESET + SN_SYS0->SWDCTRL_b.SWDDIS = 1; // Disable SWD +} \ No newline at end of file diff --git a/platforms/chibios/boards/SN_SN32F240B_PWM/board/board.mk b/platforms/chibios/boards/SN_SN32F240B_PWM/board/board.mk index 21fdccf4ba1e..73d2bc90e19b 100644 --- a/platforms/chibios/boards/SN_SN32F240B_PWM/board/board.mk +++ b/platforms/chibios/boards/SN_SN32F240B_PWM/board/board.mk @@ -1,5 +1,6 @@ # List of all the board related files. BOARDSRC = $(CHIBIOS_CONTRIB)/os/hal/boards/SN_SN32F240B/board.c +QMKBOARDSRC = $(BOARD_PATH)/board.c # Extra files BOARDSRC += $(BOARD_PATH)/board/extra.c @@ -15,5 +16,5 @@ OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE OPT_DEFS += -DCRT1_AREAS_NUMBER=1 # Shared variables -ALLCSRC += $(BOARDSRC) +ALLCSRC += $(BOARDSRC) $(QMKBOARDSRC) ALLINC += $(BOARDINC)