Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SN32 boards cleanup #396

Open
wants to merge 4 commits into
base: sn32_develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/mappings/defaults.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
"board": "STEMCELL",
"bootloader": "tinyuf2",
"processor": "STM32F411"
},
"sn32f240b_shared_matrix": {
"board": "SN_SN32F240B_PWM",
"bootloader": "sn32-dfu",
"processor": "SN32F248BF"
}
}
}
2 changes: 1 addition & 1 deletion data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"development_board": {
"type": "string",
"enum": ["promicro", "elite_c", "elite_pi", "proton_c", "kb2040", "promicro_rp2040", "blok", "michi", "bit_c_pro", "stemcell", "bluepill", "blackpill_f401", "blackpill_f411", "bonsai_c4", "helios", "liatris", "imera"]
"enum": ["promicro", "elite_c", "elite_pi", "proton_c", "kb2040", "promicro_rp2040", "blok", "michi", "bit_c_pro", "stemcell", "bluepill", "blackpill_f401", "blackpill_f411", "bonsai_c4", "helios", "liatris", "imera", "sn32f240b_shared_matrix"]
},
"pin_compatible": {
"type": "string",
Expand Down
10 changes: 7 additions & 3 deletions platforms/chibios/boards/SN_SN32F240/configs/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*/
#pragma once

# ifndef WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT
# define WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT 1
# endif
#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
#endif

#ifndef WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT
# define WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT 1
#endif
10 changes: 7 additions & 3 deletions platforms/chibios/boards/SN_SN32F240B/configs/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*/
#pragma once

# ifndef WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT
# define WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT 1
# endif
#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
#endif

#ifndef WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT
# define WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT 1
#endif
19 changes: 19 additions & 0 deletions platforms/chibios/boards/SN_SN32F240B_PWM/board/board.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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

# Optimize for speed
OPT = 2
# Enter lower-power sleep mode when on the ChibiOS idle thread
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
# Shave some extra bytes
OPT_DEFS += -DCRT1_AREAS_NUMBER=1

# Shared variables
ALLCSRC += $(BOARDSRC)
ALLINC += $(BOARDINC)
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
}
38 changes: 38 additions & 0 deletions platforms/chibios/boards/SN_SN32F240B_PWM/configs/chconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* Copyright 2020 QMK
*
* 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/>.
*/

/*
* This file was auto-generated by:
* `qmk chibios-confmigrate -i platforms/chibios/boards/SN_SN32F240B/configs/chconf.h -r platforms/chibios/boards/common/configs/chconf.h`
*/

#pragma once

#define CH_CFG_ST_RESOLUTION 16

#define CH_CFG_ST_FREQUENCY 187500

#include_next <chconf.h>

#undef CH_CFG_IDLE_ENTER_HOOK
#define CH_CFG_IDLE_ENTER_HOOK() { \
SN_PMU->CTRL = 4; \
}

#undef CH_CFG_IDLE_LEAVE_HOOK
#define CH_CFG_IDLE_LEAVE_HOOK() { \
SN_PMU->CTRL = 0; \
}
24 changes: 24 additions & 0 deletions platforms/chibios/boards/SN_SN32F240B_PWM/configs/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* 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/>.
*/
#pragma once

#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
#endif

#ifndef WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT
# define WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT 1
#endif
14 changes: 9 additions & 5 deletions platforms/chibios/boards/SN_SN32F260/configs/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@

#pragma once

#define RAW_IN_CAPACITY 1
#define RAW_OUT_CAPACITY 1
#define RAW_IN_CAPACITY 1
#define RAW_OUT_CAPACITY 1

# ifndef WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT
# define WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT 1
# endif
#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
#endif

#ifndef WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT
# define WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT 1
#endif
60 changes: 0 additions & 60 deletions platforms/chibios/boards/SN_SN32F260/configs/mcuconf.h

This file was deleted.

Loading