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 Nov 24, 2024
1 parent eb95751 commit 3ca5177
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions platforms/chibios/boards/SN_SN32F240B_PWM/board/board.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# List of all the board related files.
BOARDSRC = $(CHIBIOS_CONTRIB)/os/hal/boards/SN_SN32F240B/board.c

# Extra files
BOARDSRC += $(BOARD_PATH)/board/extra.c

# Required include directories
BOARDINC = $(CHIBIOS_CONTRIB)/os/hal/boards/SN_SN32F240B

Expand Down
19 changes: 19 additions & 0 deletions platforms/chibios/boards/SN_SN32F240B_PWM/board/extra.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
}

0 comments on commit 3ca5177

Please sign in to comment.