apply oldPRCR to board_init()
This commit is contained in:
2
.idea/cmake.xml
generated
2
.idea/cmake.xml
generated
@@ -75,7 +75,7 @@
|
|||||||
<configuration PROFILE_NAME="stm32u575nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u575nucleo -DLOG=3" />
|
<configuration PROFILE_NAME="stm32u575nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u575nucleo -DLOG=3" />
|
||||||
<configuration PROFILE_NAME="stm32u5a5nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u5a5nucleo -DLOG=3 -DLOGGER=RTT" />
|
<configuration PROFILE_NAME="stm32u5a5nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u5a5nucleo -DLOG=3 -DLOGGER=RTT" />
|
||||||
<configuration PROFILE_NAME="ra2a1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra2a1_ek -DLOG=3 -DLOGGER=RTT" />
|
<configuration PROFILE_NAME="ra2a1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra2a1_ek -DLOG=3 -DLOGGER=RTT" />
|
||||||
<configuration PROFILE_NAME="ra4m1" ENABLED="true" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra4m1_ek -DLOG=3 -DLOGGER=RTT" />
|
<configuration PROFILE_NAME="ra4m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra4m1_ek -DLOG=3 -DLOGGER=RTT" />
|
||||||
<configuration PROFILE_NAME="ra6m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m1_ek -DLOG=3 -DLOGGER=RTT" />
|
<configuration PROFILE_NAME="ra6m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m1_ek -DLOG=3 -DLOGGER=RTT" />
|
||||||
<configuration PROFILE_NAME="ra6m5" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
<configuration PROFILE_NAME="ra6m5" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||||
<configuration PROFILE_NAME="ra6m5 PORT0" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1 -DPORT=0" />
|
<configuration PROFILE_NAME="ra6m5 PORT0" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1 -DPORT=0" />
|
||||||
|
@@ -9,19 +9,6 @@
|
|||||||
# ESP32-Sx and RP2040 has its own CMake build system
|
# ESP32-Sx and RP2040 has its own CMake build system
|
||||||
ifeq (,$(findstring $(FAMILY),espressif rp2040))
|
ifeq (,$(findstring $(FAMILY),espressif rp2040))
|
||||||
|
|
||||||
# ---------------------------------------
|
|
||||||
# Compiler Flags
|
|
||||||
# ---------------------------------------
|
|
||||||
|
|
||||||
CFLAGS += $(addprefix -I,$(INC))
|
|
||||||
|
|
||||||
# Verbose mode
|
|
||||||
ifeq ("$(V)","1")
|
|
||||||
$(info CFLAGS $(CFLAGS) ) $(info )
|
|
||||||
$(info LDFLAGS $(LDFLAGS)) $(info )
|
|
||||||
$(info ASFLAGS $(ASFLAGS)) $(info )
|
|
||||||
endif
|
|
||||||
|
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
# Rules
|
# Rules
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
@@ -39,6 +26,19 @@ vpath %.S . $(TOP)
|
|||||||
|
|
||||||
include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN)_rules.mk
|
include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN)_rules.mk
|
||||||
|
|
||||||
|
# ---------------------------------------
|
||||||
|
# Compiler Flags
|
||||||
|
# ---------------------------------------
|
||||||
|
|
||||||
|
CFLAGS += $(addprefix -I,$(INC))
|
||||||
|
|
||||||
|
# Verbose mode
|
||||||
|
ifeq ("$(V)","1")
|
||||||
|
$(info CFLAGS $(CFLAGS) ) $(info )
|
||||||
|
$(info LDFLAGS $(LDFLAGS)) $(info )
|
||||||
|
$(info ASFLAGS $(ASFLAGS)) $(info )
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
OBJ_DIRS = $(sort $(dir $(OBJ)))
|
OBJ_DIRS = $(sort $(dir $(OBJ)))
|
||||||
$(OBJ): | $(OBJ_DIRS)
|
$(OBJ): | $(OBJ_DIRS)
|
||||||
|
@@ -249,9 +249,10 @@ void board_init(void)
|
|||||||
EN(SCI5, TEI5) = 1;
|
EN(SCI5, TEI5) = 1;
|
||||||
|
|
||||||
/* Enable USB0 */
|
/* Enable USB0 */
|
||||||
|
unsigned short oldPRCR = SYSTEM.PRCR.WORD;
|
||||||
SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY | SYSTEM_PRCR_PRC1;
|
SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY | SYSTEM_PRCR_PRC1;
|
||||||
MSTP(USB0) = 0;
|
MSTP(USB0) = 0;
|
||||||
SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY;
|
SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY | oldPRCR;
|
||||||
|
|
||||||
/* setup USBI0 interrupt. */
|
/* setup USBI0 interrupt. */
|
||||||
IR(USB0, USBI0) = 0;
|
IR(USB0, USBI0) = 0;
|
||||||
@@ -277,6 +278,7 @@ int board_uart_read(uint8_t* buf, int len)
|
|||||||
sci_buf[1].buf = buf;
|
sci_buf[1].buf = buf;
|
||||||
sci_buf[1].cnt = len;
|
sci_buf[1].cnt = len;
|
||||||
SCI5.SCR.BYTE |= SCI_SCR_RE | SCI_SCR_RIE;
|
SCI5.SCR.BYTE |= SCI_SCR_RE | SCI_SCR_RIE;
|
||||||
|
// TODO change to non blocking, return -1 immediately if no data
|
||||||
while (SCI5.SCR.BIT.RE) ;
|
while (SCI5.SCR.BIT.RE) ;
|
||||||
return len - sci_buf[1].cnt;
|
return len - sci_buf[1].cnt;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user