Skip to content

Commit

Permalink
📦 添加对 DSD TECH SH-C30A 的支持 https://www.deshide.com/product-details.ht…
Browse files Browse the repository at this point in the history
…ml?pid=384242&_t=1671089557

Signed-off-by: DAVE <ro7enkranz@qq.com>
  • Loading branch information
SummerFalls committed Apr 7, 2024
1 parent 70c63e2 commit b02bd13
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@
],
"intelliSenseMode": "gcc-arm",
"compilerPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe"
},
{
"name": "SH_C30A",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"SH_C30A",
"HSE_VALUE=24000000",
"USE_HAL_DRIVER",
"STM32F042x6",
"NDEBUG"
],
"intelliSenseMode": "gcc-arm",
"compilerPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe"
}
],
"version": 4
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BU
.PHONY : all

# default action: build all
all: cantact_16 cantact_8 entree canable
all: cantact_16 cantact_8 entree canable ollie sh_c30a

cantact_16:
$(MAKE) BOARD=cantact_16 DEBUG=0 OPT=-Os BOARD_FLAGS='-DHSE_VALUE=16000000' elf hex bin
Expand All @@ -156,6 +156,9 @@ canable:
ollie:
$(MAKE) BOARD=ollie DEBUG=0 OPT=-Os BOARD_FLAGS='-DHSE_VALUE=0' elf hex bin

sh_c30a:
$(MAKE) BOARD=sh_c30a DEBUG=0 OPT=-Os BOARD_FLAGS='-DHSE_VALUE=24000000' elf hex bin

#######################################
# build the application
#######################################
Expand Down
10 changes: 10 additions & 0 deletions Src/pcan_varian.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
#define CAN_RX B, 8, MODE_AF_PP, NOPULL, SPEED_FREQ_HIGH, AF4_CAN
#define CAN_TX B, 9, MODE_AF_PP, NOPULL, SPEED_FREQ_HIGH, AF4_CAN

#define pcan_variant_io_init()
#elif (defined SH_C30A)
#define IOPIN_TX B, 0, MODE_OUTPUT_PP, NOPULL, SPEED_FREQ_MEDIUM, NOAF
#define IOPIN_RX B, 1, MODE_OUTPUT_PP, NOPULL, SPEED_FREQ_MEDIUM, NOAF
#define LED_ON PIN_HI
#define LED_OFF PIN_LOW

#define CAN_RX B, 8, MODE_AF_PP, NOPULL, SPEED_FREQ_HIGH, AF4_CAN
#define CAN_TX B, 9, MODE_AF_PP, NOPULL, SPEED_FREQ_HIGH, AF4_CAN

#define pcan_variant_io_init()
#else
#error Unknown board variant
Expand Down

0 comments on commit b02bd13

Please sign in to comment.