From 8c4641fc0587d107b974d8e659d0159fac57665d Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 28 Jun 2021 12:49:30 +0700 Subject: [PATCH] refactor rx6x bsp --- hw/bsp/rx63n/boards/gr_citrus/board.mk | 29 -------------------- hw/bsp/rx63n/boards/rx65n_cloud_kit/board.mk | 29 -------------------- hw/bsp/rx63n/family.mk | 29 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 58 deletions(-) diff --git a/hw/bsp/rx63n/boards/gr_citrus/board.mk b/hw/bsp/rx63n/boards/gr_citrus/board.mk index 6edd588bc..0eba94610 100644 --- a/hw/bsp/rx63n/boards/gr_citrus/board.mk +++ b/hw/bsp/rx63n/boards/gr_citrus/board.mk @@ -5,40 +5,11 @@ CFLAGS += \ -misa=v1 \ -DCFG_TUSB_MCU=OPT_MCU_RX63X -RX_NEWLIB ?= 1 - -ifeq ($(CMDEXE),1) -OPTLIBINC="$(shell for /F "usebackq delims=" %%i in (`where rx-elf-gcc`) do echo %%~dpi..\rx-elf\optlibinc)" -else -OPTLIBINC=$(shell dirname `which rx-elf-gcc`)../rx-elf/optlibinc -endif - -ifeq ($(RX_NEWLIB),1) -CFLAGS += -DSSIZE_MAX=__INT_MAX__ -else -# setup for optlib -CFLAGS += -nostdinc \ - -isystem $(OPTLIBINC) \ - -DLWIP_NO_INTTYPES_H - -LIBS += -loptc -loptm -endif - MCU_DIR = hw/mcu/renesas/rx/rx63n # All source paths should be relative to the top level. LD_FILE = $(BOARD_PATH)/r5f5631fd.ld -SRC_C += \ - src/portable/renesas/usba/dcd_usba.c \ - $(MCU_DIR)/vects.c - -INC += \ - $(TOP)/$(BOARD_PATH) \ - $(TOP)/$(MCU_DIR) - -SRC_S += $(MCU_DIR)/start.S - # For freeRTOS port source FREERTOS_PORT = RX600 diff --git a/hw/bsp/rx63n/boards/rx65n_cloud_kit/board.mk b/hw/bsp/rx63n/boards/rx65n_cloud_kit/board.mk index 34a4b2cbb..e0d970435 100644 --- a/hw/bsp/rx63n/boards/rx65n_cloud_kit/board.mk +++ b/hw/bsp/rx63n/boards/rx65n_cloud_kit/board.mk @@ -6,40 +6,11 @@ CFLAGS += \ -DIER_USB0_USBI0=IER_PERIB_INTB185 \ -DIEN_USB0_USBI0=IEN_PERIB_INTB185 -RX_NEWLIB ?= 1 - -ifeq ($(CMDEXE),1) -OPTLIBINC="$(shell for /F "usebackq delims=" %%i in (`where rx-elf-gcc`) do echo %%~dpi..\rx-elf\optlibinc)" -else -OPTLIBINC=$(shell dirname `which rx-elf-gcc`)../rx-elf/optlibinc -endif - -ifeq ($(RX_NEWLIB),1) -CFLAGS += -DSSIZE_MAX=__INT_MAX__ -else -# setup for optlib -CFLAGS += -nostdinc \ - -isystem $(OPTLIBINC) \ - -DLWIP_NO_INTTYPES_H - -LIBS += -loptc -loptm -endif - MCU_DIR = hw/mcu/renesas/rx/rx65n # All source paths should be relative to the top level. LD_FILE = $(BOARD_PATH)/r5f565ne.ld -SRC_C += \ - src/portable/renesas/usba/dcd_usba.c \ - $(MCU_DIR)/vects.c - -INC += \ - $(TOP)/$(BOARD_PATH) \ - $(TOP)/$(MCU_DIR) - -SRC_S += $(MCU_DIR)/start.S - # For freeRTOS port source FREERTOS_PORT = RX600 diff --git a/hw/bsp/rx63n/family.mk b/hw/bsp/rx63n/family.mk index a9c74e6b0..057fc8c25 100644 --- a/hw/bsp/rx63n/family.mk +++ b/hw/bsp/rx63n/family.mk @@ -12,6 +12,35 @@ CFLAGS += \ -fshort-enums \ -mlittle-endian-data \ +RX_NEWLIB ?= 1 + +ifeq ($(CMDEXE),1) + OPTLIBINC="$(shell for /F "usebackq delims=" %%i in (`where rx-elf-gcc`) do echo %%~dpi..\rx-elf\optlibinc)" +else + OPTLIBINC=$(shell dirname `which rx-elf-gcc`)../rx-elf/optlibinc +endif + +ifeq ($(RX_NEWLIB),1) + CFLAGS += -DSSIZE_MAX=__INT_MAX__ +else + # setup for optlib + CFLAGS += -nostdinc \ + -isystem $(OPTLIBINC) \ + -DLWIP_NO_INTTYPES_H + + LIBS += -loptc -loptm +endif + +SRC_C += \ + src/portable/renesas/usba/dcd_usba.c \ + $(MCU_DIR)/vects.c + +INC += \ + $(TOP)/$(BOARD_PATH) \ + $(TOP)/$(MCU_DIR) + +SRC_S += $(MCU_DIR)/start.S + $(BUILD)/$(PROJECT).mot: $(BUILD)/$(PROJECT).elf @echo CREATE $@ $(OBJCOPY) -O srec -I elf32-rx-be-ns $^ $@