Skip to content

Commit

Permalink
sn32: boards: pwm: disable SWD on init
Browse files Browse the repository at this point in the history
  • Loading branch information
dexter93 committed Sep 12, 2024
1 parent 44d969c commit 3288672
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions platforms/chibios/boards/SN_SN32F240B_PWM/board/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Copyright 2024 Dimitris Mantzouranis <[email protected]>
*
* 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 <http://www.gnu.org/licenses/>.
*/
void board_init(void) {
SN_SYS0->EXRSTCTRL_b.RESETDIS = 1; // Disable RESET
SN_SYS0->SWDCTRL_b.SWDDIS = 1; // Disable SWD
}
3 changes: 2 additions & 1 deletion platforms/chibios/boards/SN_SN32F240B_PWM/board/board.mk
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

0 comments on commit 3288672

Please sign in to comment.