From b02bd13e4543c249d655ecc4b872631a1fcf657e Mon Sep 17 00:00:00 2001 From: DAVE Date: Sun, 7 Apr 2024 15:41:04 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20=E6=B7=BB=E5=8A=A0=E5=AF=B9=20DS?= =?UTF-8?q?D=20TECH=20SH-C30A=20=E7=9A=84=E6=94=AF=E6=8C=81=20https://www.?= =?UTF-8?q?deshide.com/product-details.html=3Fpid=3D384242&=5Ft=3D16710895?= =?UTF-8?q?57?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: DAVE --- .vscode/c_cpp_properties.json | 15 +++++++++++++++ Makefile | 5 ++++- Src/pcan_varian.h | 10 ++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 76a3ad4..58bad6f 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -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 diff --git a/Makefile b/Makefile index cf71ec0..908d7e0 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 ####################################### diff --git a/Src/pcan_varian.h b/Src/pcan_varian.h index 12190c3..a1c6c9f 100644 --- a/Src/pcan_varian.h +++ b/Src/pcan_varian.h @@ -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