Skip to content

Commit

Permalink
Merge pull request #411 from dexter93/sn32_init_cleanup
Browse files Browse the repository at this point in the history
SN32 Init cleanup
  • Loading branch information
fpoussin authored Oct 22, 2024
2 parents ce62332 + 0f6612e commit 6daa08b
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 17 deletions.
4 changes: 0 additions & 4 deletions os/hal/boards/SN_SN32F240/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ const PALConfig pal_default_config = {
#endif

static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555;
extern void enter_bootloader_mode_if_requested(void);

/**
* @brief Early initialization code.
* @details This initialization must be performed just after stack setup
* and before any other initialization.
*/
void __early_init(void) {
enter_bootloader_mode_if_requested();
sn32_clock_init();
}

Expand All @@ -62,8 +60,6 @@ void __early_init(void) {
*/
void boardInit(void) {

SN_SYS0->EXRSTCTRL_b.RESETDIS = 1; // Disable RESET
SN_SYS0->SWDCTRL_b.SWDDIS = 1; // Disable SWD
}

void restart_usb_driver(USBDriver *usbp) {
Expand Down
4 changes: 0 additions & 4 deletions os/hal/boards/SN_SN32F240B/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ const PALConfig pal_default_config = {
#endif

static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555;
extern void enter_bootloader_mode_if_requested(void);

/**
* @brief Early initialization code.
* @details This initialization must be performed just after stack setup
* and before any other initialization.
*/
void __early_init(void) {
enter_bootloader_mode_if_requested();
sn32_clock_init();
}

Expand All @@ -62,6 +60,4 @@ void __early_init(void) {
*/
void boardInit(void) {

SN_SYS0->EXRSTCTRL_b.RESETDIS = 1; // Disable RESET
SN_SYS0->SWDCTRL_b.SWDDIS = 1; // Disable SWD
}
2 changes: 1 addition & 1 deletion os/hal/boards/SN_SN32F260/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ void __early_init(void) {
* @brief Board-specific initialization code.
*/
void boardInit(void) {
SN_SYS0->SWDCTRL_b.SWDDIS = 1; // Disable SWD

}
4 changes: 0 additions & 4 deletions os/hal/boards/SN_SN32F280/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ const PALConfig pal_default_config = {
#endif

static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555;
extern void enter_bootloader_mode_if_requested(void);

/**
* @brief Early initialization code.
* @details This initialization must be performed just after stack setup
* and before any other initialization.
*/
void __early_init(void) {
enter_bootloader_mode_if_requested();
sn32_clock_init();
}

Expand All @@ -62,6 +60,4 @@ void __early_init(void) {
*/
void boardInit(void) {

SN_SYS0->EXRSTCTRL_b.RESETDIS = 1; // Disable RESET
SN_SYS0->SWDCTRL_b.SWDDIS = 1; // Disable SWD
}
4 changes: 0 additions & 4 deletions os/hal/boards/SN_SN32F290/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ const PALConfig pal_default_config = {
#endif

static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555;
extern void enter_bootloader_mode_if_requested(void);

/**
* @brief Early initialization code.
* @details This initialization must be performed just after stack setup
* and before any other initialization.
*/
void __early_init(void) {
enter_bootloader_mode_if_requested();
sn32_clock_init();
}

Expand All @@ -62,6 +60,4 @@ void __early_init(void) {
*/
void boardInit(void) {

SN_SYS0->EXRSTCTRL_b.RESETDIS = 1; // Disable RESET
SN_SYS0->SWDCTRL_b.SWDDIS = 1; // Disable SWD
}

0 comments on commit 6daa08b

Please sign in to comment.