Improvements to simulator IRQ detection.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11792 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
parent
52b9612580
commit
43433fde0b
|
@ -18,7 +18,7 @@ ifeq ($(USE_CPPOPT),)
|
||||||
USE_CPPOPT = -fno-rtti
|
USE_CPPOPT = -fno-rtti
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable this if you want the linker to remove unused code and data
|
# Enable this if you want the linker to remove unused code and data.
|
||||||
ifeq ($(USE_LINK_GC),)
|
ifeq ($(USE_LINK_GC),)
|
||||||
USE_LINK_GC = yes
|
USE_LINK_GC = yes
|
||||||
endif
|
endif
|
||||||
|
@ -28,7 +28,7 @@ ifeq ($(USE_LDOPT),)
|
||||||
USE_LDOPT =
|
USE_LDOPT =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable this if you want link time optimizations (LTO)
|
# Enable this if you want link time optimizations (LTO).
|
||||||
ifeq ($(USE_LTO),)
|
ifeq ($(USE_LTO),)
|
||||||
USE_LTO = yes
|
USE_LTO = yes
|
||||||
endif
|
endif
|
||||||
|
@ -141,7 +141,7 @@ TCSRC =
|
||||||
# option that results in lower performance and larger code size.
|
# option that results in lower performance and larger code size.
|
||||||
TCPPSRC =
|
TCPPSRC =
|
||||||
|
|
||||||
# List ASM source files here
|
# List ASM source files here.
|
||||||
ASMSRC = $(ALLASMSRC)
|
ASMSRC = $(ALLASMSRC)
|
||||||
ASMXSRC = $(ALLXASMSRC)
|
ASMXSRC = $(ALLXASMSRC)
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ ifeq ($(USE_LDOPT),)
|
||||||
USE_LDOPT =
|
USE_LDOPT =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable this if you want link time optimizations (LTO)
|
# Enable this if you want link time optimizations (LTO).
|
||||||
ifeq ($(USE_LTO),)
|
ifeq ($(USE_LTO),)
|
||||||
USE_LTO = no
|
USE_LTO = no
|
||||||
endif
|
endif
|
||||||
|
@ -65,6 +65,12 @@ PROJECT = ch
|
||||||
|
|
||||||
# Imported source files and paths
|
# Imported source files and paths
|
||||||
CHIBIOS = ../../..
|
CHIBIOS = ../../..
|
||||||
|
CONFDIR := ./cfg
|
||||||
|
BUILDDIR := ./build
|
||||||
|
DEPDIR := ./.dep
|
||||||
|
|
||||||
|
# Licensing files.
|
||||||
|
include $(CHIBIOS)/os/license/license.mk
|
||||||
# Startup files.
|
# Startup files.
|
||||||
# HAL-OSAL files (optional).
|
# HAL-OSAL files (optional).
|
||||||
include $(CHIBIOS)/os/hal/hal.mk
|
include $(CHIBIOS)/os/hal/hal.mk
|
||||||
|
@ -82,66 +88,24 @@ include $(CHIBIOS)/os/hal/lib/streams/streams.mk
|
||||||
include $(CHIBIOS)/os/various/shell/shell.mk
|
include $(CHIBIOS)/os/various/shell/shell.mk
|
||||||
|
|
||||||
# C sources here.
|
# C sources here.
|
||||||
CSRC = $(STARTUPSRC) \
|
CSRC = $(ALLCSRC) \
|
||||||
$(KERNSRC) \
|
|
||||||
$(PORTSRC) \
|
|
||||||
$(OSALSRC) \
|
|
||||||
$(HALSRC) \
|
|
||||||
$(PLATFORMSRC) \
|
|
||||||
$(BOARDSRC) \
|
|
||||||
$(TESTSRC) \
|
$(TESTSRC) \
|
||||||
$(STREAMSSRC) \
|
|
||||||
$(SHELLSRC) \
|
|
||||||
main.c
|
main.c
|
||||||
|
|
||||||
# C++ sources here.
|
# C++ sources here.
|
||||||
CPPSRC =
|
CPPSRC = $(ALLCPPSRC)
|
||||||
|
|
||||||
# List ASM source files here
|
# List ASM source files here.
|
||||||
ASMSRC =
|
ASMSRC = $(ALLASMSRC)
|
||||||
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
|
ASMXSRC = $(ALLXASMSRC)
|
||||||
|
|
||||||
INCDIR = $(CHIBIOS)/os/license \
|
INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC)
|
||||||
$(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
|
|
||||||
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
|
|
||||||
$(STREAMSINC) $(SHELLINC)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Project, sources and paths
|
# Project, sources and paths
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Compiler settings
|
|
||||||
#
|
|
||||||
|
|
||||||
#TRGT = powerpc-eabi-
|
|
||||||
TRGT =
|
|
||||||
CC = $(TRGT)gcc
|
|
||||||
CPPC = $(TRGT)g++
|
|
||||||
# Enable loading with g++ only if you need C++ runtime support.
|
|
||||||
# NOTE: You can use C++ even without C++ support if you are careful. C++
|
|
||||||
# runtime support makes code size explode.
|
|
||||||
LD = $(TRGT)gcc
|
|
||||||
#LD = $(TRGT)g++
|
|
||||||
CP = $(TRGT)objcopy
|
|
||||||
AS = $(TRGT)gcc -x assembler-with-cpp
|
|
||||||
AR = $(TRGT)ar
|
|
||||||
OD = $(TRGT)objdump
|
|
||||||
SZ = $(TRGT)size
|
|
||||||
BIN = $(CP) -O binary
|
|
||||||
COV = gcov
|
|
||||||
|
|
||||||
# Define C warning options here
|
|
||||||
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
|
|
||||||
|
|
||||||
# Define C++ warning options here
|
|
||||||
CPPWARN = -Wall -Wextra -Wundef
|
|
||||||
|
|
||||||
#
|
|
||||||
# Compiler settings
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
###################cd ..###########################################################
|
|
||||||
# Start of user section
|
# Start of user section
|
||||||
#
|
#
|
||||||
|
|
||||||
|
@ -159,9 +123,41 @@ ULIBDIR =
|
||||||
|
|
||||||
# List all user libraries here
|
# List all user libraries here
|
||||||
ULIBS =
|
ULIBS =
|
||||||
|
|
||||||
#
|
#
|
||||||
# End of user defines
|
# End of user defines
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Compiler settings
|
||||||
|
#
|
||||||
|
|
||||||
|
TRGT =
|
||||||
|
CC = $(TRGT)gcc
|
||||||
|
CPPC = $(TRGT)g++
|
||||||
|
# Enable loading with g++ only if you need C++ runtime support.
|
||||||
|
# NOTE: You can use C++ even without C++ support if you are careful. C++
|
||||||
|
# runtime support makes code size explode.
|
||||||
|
LD = $(TRGT)gcc
|
||||||
|
#LD = $(TRGT)g++
|
||||||
|
CP = $(TRGT)objcopy
|
||||||
|
AS = $(TRGT)gcc -x assembler-with-cpp
|
||||||
|
AR = $(TRGT)ar
|
||||||
|
OD = $(TRGT)objdump
|
||||||
|
SZ = $(TRGT)size
|
||||||
|
HEX = $(CP) -O ihex
|
||||||
|
BIN = $(CP) -O binary
|
||||||
|
COV = gcov
|
||||||
|
|
||||||
|
# Define C warning options here
|
||||||
|
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
|
||||||
|
|
||||||
|
# Define C++ warning options here
|
||||||
|
CPPWARN = -Wall -Wextra -Wundef
|
||||||
|
|
||||||
|
#
|
||||||
|
# Compiler settings
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC
|
RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC
|
||||||
include $(RULESPATH)/rules.mk
|
include $(RULESPATH)/rules.mk
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MCUCONF_H
|
||||||
|
#define MCUCONF_H
|
||||||
|
|
||||||
|
#endif /* MCUCONF_H */
|
|
@ -28,7 +28,7 @@ ifeq ($(USE_LDOPT),)
|
||||||
USE_LDOPT =
|
USE_LDOPT =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable this if you want link time optimizations (LTO)
|
# Enable this if you want link time optimizations (LTO).
|
||||||
ifeq ($(USE_LTO),)
|
ifeq ($(USE_LTO),)
|
||||||
USE_LTO = no
|
USE_LTO = no
|
||||||
endif
|
endif
|
||||||
|
@ -61,10 +61,16 @@ endif
|
||||||
#
|
#
|
||||||
|
|
||||||
# Define project name here
|
# Define project name here
|
||||||
PROJECT = ch.exe
|
PROJECT = ch
|
||||||
|
|
||||||
# Imported source files and paths
|
# Imported source files and paths
|
||||||
CHIBIOS = ../../..
|
CHIBIOS = ../../..
|
||||||
|
CONFDIR := ./cfg
|
||||||
|
BUILDDIR := ./build
|
||||||
|
DEPDIR := ./.dep
|
||||||
|
|
||||||
|
# Licensing files.
|
||||||
|
include $(CHIBIOS)/os/license/license.mk
|
||||||
# Startup files.
|
# Startup files.
|
||||||
# HAL-OSAL files (optional).
|
# HAL-OSAL files (optional).
|
||||||
include $(CHIBIOS)/os/hal/hal.mk
|
include $(CHIBIOS)/os/hal/hal.mk
|
||||||
|
@ -82,65 +88,23 @@ include $(CHIBIOS)/os/hal/lib/streams/streams.mk
|
||||||
include $(CHIBIOS)/os/various/shell/shell.mk
|
include $(CHIBIOS)/os/various/shell/shell.mk
|
||||||
|
|
||||||
# C sources here.
|
# C sources here.
|
||||||
CSRC = $(STARTUPSRC) \
|
CSRC = $(ALLCSRC) \
|
||||||
$(KERNSRC) \
|
|
||||||
$(PORTSRC) \
|
|
||||||
$(OSALSRC) \
|
|
||||||
$(HALSRC) \
|
|
||||||
$(PLATFORMSRC) \
|
|
||||||
$(BOARDSRC) \
|
|
||||||
$(TESTSRC) \
|
$(TESTSRC) \
|
||||||
$(STREAMSSRC) \
|
|
||||||
$(SHELLSRC) \
|
|
||||||
main.c
|
main.c
|
||||||
|
|
||||||
# C++ sources here.
|
# C++ sources here.
|
||||||
CPPSRC =
|
CPPSRC = $(ALLCPPSRC)
|
||||||
|
|
||||||
# List ASM source files here
|
# List ASM source files here.
|
||||||
ASMSRC =
|
ASMSRC = $(ALLASMSRC)
|
||||||
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
|
ASMXSRC = $(ALLXASMSRC)
|
||||||
|
|
||||||
INCDIR = $(CHIBIOS)/os/license \
|
INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC)
|
||||||
$(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
|
|
||||||
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
|
|
||||||
$(STREAMSINC) $(SHELLINC)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Project, sources and paths
|
# Project, sources and paths
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Compiler settings
|
|
||||||
#
|
|
||||||
|
|
||||||
#TRGT = powerpc-eabi-
|
|
||||||
TRGT = mingw32-
|
|
||||||
CC = $(TRGT)gcc
|
|
||||||
CPPC = $(TRGT)g++
|
|
||||||
# Enable loading with g++ only if you need C++ runtime support.
|
|
||||||
# NOTE: You can use C++ even without C++ support if you are careful. C++
|
|
||||||
# runtime support makes code size explode.
|
|
||||||
LD = $(TRGT)gcc
|
|
||||||
#LD = $(TRGT)g++
|
|
||||||
CP = $(TRGT)objcopy
|
|
||||||
AS = $(TRGT)gcc -x assembler-with-cpp
|
|
||||||
AR = $(TRGT)ar
|
|
||||||
OD = $(TRGT)objdump
|
|
||||||
SZ = $(TRGT)size
|
|
||||||
BIN = $(CP) -O binary
|
|
||||||
COV = gcov
|
|
||||||
|
|
||||||
# Define C warning options here
|
|
||||||
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
|
|
||||||
|
|
||||||
# Define C++ warning options here
|
|
||||||
CPPWARN = -Wall -Wextra -Wundef
|
|
||||||
|
|
||||||
#
|
|
||||||
# Compiler settings
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Start of user section
|
# Start of user section
|
||||||
#
|
#
|
||||||
|
@ -158,11 +122,42 @@ UINCDIR =
|
||||||
ULIBDIR =
|
ULIBDIR =
|
||||||
|
|
||||||
# List all user libraries here
|
# List all user libraries here
|
||||||
ULIBS = -lws2_32
|
ULIBS =
|
||||||
|
|
||||||
#
|
#
|
||||||
# End of user defines
|
# End of user defines
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Compiler settings
|
||||||
|
#
|
||||||
|
|
||||||
|
TRGT =
|
||||||
|
CC = $(TRGT)gcc
|
||||||
|
CPPC = $(TRGT)g++
|
||||||
|
# Enable loading with g++ only if you need C++ runtime support.
|
||||||
|
# NOTE: You can use C++ even without C++ support if you are careful. C++
|
||||||
|
# runtime support makes code size explode.
|
||||||
|
LD = $(TRGT)gcc
|
||||||
|
#LD = $(TRGT)g++
|
||||||
|
CP = $(TRGT)objcopy
|
||||||
|
AS = $(TRGT)gcc -x assembler-with-cpp
|
||||||
|
AR = $(TRGT)ar
|
||||||
|
OD = $(TRGT)objdump
|
||||||
|
SZ = $(TRGT)size
|
||||||
|
HEX = $(CP) -O ihex
|
||||||
|
BIN = $(CP) -O binary
|
||||||
|
COV = gcov
|
||||||
|
|
||||||
|
# Define C warning options here
|
||||||
|
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
|
||||||
|
|
||||||
|
# Define C++ warning options here
|
||||||
|
CPPWARN = -Wall -Wextra -Wundef
|
||||||
|
|
||||||
|
#
|
||||||
|
# Compiler settings
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC
|
RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC
|
||||||
include $(RULESPATH)/rules.mk
|
include $(RULESPATH)/rules.mk
|
||||||
|
|
|
@ -0,0 +1,259 @@
|
||||||
|
/*
|
||||||
|
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MCUCONF_H
|
||||||
|
#define MCUCONF_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* STM32F0xx drivers configuration.
|
||||||
|
* The following settings override the default settings present in
|
||||||
|
* the various device driver implementation headers.
|
||||||
|
* Note that the settings for each driver only have effect if the whole
|
||||||
|
* driver is enabled in halconf.h.
|
||||||
|
*
|
||||||
|
* IRQ priorities:
|
||||||
|
* 3...0 Lowest...Highest.
|
||||||
|
*
|
||||||
|
* DMA priorities:
|
||||||
|
* 0...3 Lowest...Highest.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define STM32F0xx_MCUCONF
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HAL driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_NO_INIT FALSE
|
||||||
|
#define STM32_PVD_ENABLE FALSE
|
||||||
|
#define STM32_PLS STM32_PLS_LEV0
|
||||||
|
#define STM32_HSI_ENABLED TRUE
|
||||||
|
#define STM32_HSI14_ENABLED TRUE
|
||||||
|
#define STM32_HSI48_ENABLED FALSE
|
||||||
|
#define STM32_LSI_ENABLED TRUE
|
||||||
|
#define STM32_HSE_ENABLED FALSE
|
||||||
|
#define STM32_LSE_ENABLED FALSE
|
||||||
|
#define STM32_SW STM32_SW_PLL
|
||||||
|
#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2
|
||||||
|
#define STM32_PREDIV_VALUE 1
|
||||||
|
#define STM32_PLLMUL_VALUE 12
|
||||||
|
#define STM32_HPRE STM32_HPRE_DIV1
|
||||||
|
#define STM32_PPRE STM32_PPRE_DIV1
|
||||||
|
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
||||||
|
#define STM32_MCOPRE STM32_MCOPRE_DIV1
|
||||||
|
#define STM32_PLLNODIV STM32_PLLNODIV_DIV2
|
||||||
|
#define STM32_USBSW STM32_USBSW_HSI48
|
||||||
|
#define STM32_CECSW STM32_CECSW_HSI
|
||||||
|
#define STM32_I2C1SW STM32_I2C1SW_HSI
|
||||||
|
#define STM32_USART1SW STM32_USART1SW_PCLK
|
||||||
|
#define STM32_RTCSEL STM32_RTCSEL_LSI
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IRQ system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_IRQ_EXTI0_1_IRQ_PRIORITY 3
|
||||||
|
#define STM32_IRQ_EXTI2_3_IRQ_PRIORITY 3
|
||||||
|
#define STM32_IRQ_EXTI4_15_IRQ_PRIORITY 3
|
||||||
|
#define STM32_IRQ_EXTI16_IRQ_PRIORITY 3
|
||||||
|
#define STM32_IRQ_EXTI17_20_IRQ_PRIORITY 3
|
||||||
|
#define STM32_IRQ_EXTI21_22_IRQ_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ADC driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_ADC_USE_ADC1 FALSE
|
||||||
|
#define STM32_ADC_ADC1_CKMODE STM32_ADC_CKMODE_ADCCLK
|
||||||
|
#define STM32_ADC_ADC1_DMA_PRIORITY 2
|
||||||
|
#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2
|
||||||
|
#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* CAN driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_CAN_USE_CAN1 FALSE
|
||||||
|
#define STM32_CAN_CAN1_IRQ_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DAC driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_DAC_DUAL_MODE FALSE
|
||||||
|
#define STM32_DAC_USE_DAC1_CH1 FALSE
|
||||||
|
#define STM32_DAC_USE_DAC1_CH2 FALSE
|
||||||
|
#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 2
|
||||||
|
#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 2
|
||||||
|
#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
|
||||||
|
#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
|
||||||
|
#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GPT driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_GPT_USE_TIM1 FALSE
|
||||||
|
#define STM32_GPT_USE_TIM2 FALSE
|
||||||
|
#define STM32_GPT_USE_TIM3 FALSE
|
||||||
|
#define STM32_GPT_USE_TIM6 FALSE
|
||||||
|
#define STM32_GPT_USE_TIM14 FALSE
|
||||||
|
#define STM32_GPT_TIM1_IRQ_PRIORITY 2
|
||||||
|
#define STM32_GPT_TIM2_IRQ_PRIORITY 2
|
||||||
|
#define STM32_GPT_TIM3_IRQ_PRIORITY 2
|
||||||
|
#define STM32_GPT_TIM6_IRQ_PRIORITY 2
|
||||||
|
#define STM32_GPT_TIM14_IRQ_PRIORITY 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* I2C driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_I2C_USE_I2C1 FALSE
|
||||||
|
#define STM32_I2C_USE_I2C2 FALSE
|
||||||
|
#define STM32_I2C_BUSY_TIMEOUT 50
|
||||||
|
#define STM32_I2C_I2C1_IRQ_PRIORITY 3
|
||||||
|
#define STM32_I2C_I2C2_IRQ_PRIORITY 3
|
||||||
|
#define STM32_I2C_USE_DMA TRUE
|
||||||
|
#define STM32_I2C_I2C1_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2C_I2C2_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||||
|
#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* I2S driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_I2S_USE_SPI1 FALSE
|
||||||
|
#define STM32_I2S_USE_SPI2 FALSE
|
||||||
|
#define STM32_I2S_SPI1_MODE (STM32_I2S_MODE_MASTER | \
|
||||||
|
STM32_I2S_MODE_RX)
|
||||||
|
#define STM32_I2S_SPI2_MODE (STM32_I2S_MODE_MASTER | \
|
||||||
|
STM32_I2S_MODE_RX)
|
||||||
|
#define STM32_I2S_SPI1_IRQ_PRIORITY 2
|
||||||
|
#define STM32_I2S_SPI2_IRQ_PRIORITY 2
|
||||||
|
#define STM32_I2S_SPI1_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2S_SPI2_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2S_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_I2S_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_I2S_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
#define STM32_I2S_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||||
|
#define STM32_I2S_DMA_ERROR_HOOK(i2sp) osalSysHalt("DMA failure")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* I2S driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_I2S_USE_SPI1 FALSE
|
||||||
|
#define STM32_I2S_USE_SPI2 FALSE
|
||||||
|
#define STM32_I2S_SPI1_MODE (STM32_I2S_MODE_MASTER | \
|
||||||
|
STM32_I2S_MODE_RX)
|
||||||
|
#define STM32_I2S_SPI2_MODE (STM32_I2S_MODE_MASTER | \
|
||||||
|
STM32_I2S_MODE_RX)
|
||||||
|
#define STM32_I2S_SPI1_IRQ_PRIORITY 2
|
||||||
|
#define STM32_I2S_SPI2_IRQ_PRIORITY 2
|
||||||
|
#define STM32_I2S_SPI1_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2S_SPI2_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2S_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_I2S_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_I2S_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
#define STM32_I2S_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||||
|
#define STM32_I2S_DMA_ERROR_HOOK(i2sp) osalSysHalt("DMA failure")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ICU driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_ICU_USE_TIM1 FALSE
|
||||||
|
#define STM32_ICU_USE_TIM2 FALSE
|
||||||
|
#define STM32_ICU_USE_TIM3 FALSE
|
||||||
|
#define STM32_ICU_TIM1_IRQ_PRIORITY 3
|
||||||
|
#define STM32_ICU_TIM2_IRQ_PRIORITY 3
|
||||||
|
#define STM32_ICU_TIM3_IRQ_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PWM driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_PWM_USE_ADVANCED FALSE
|
||||||
|
#define STM32_PWM_USE_TIM1 FALSE
|
||||||
|
#define STM32_PWM_USE_TIM2 FALSE
|
||||||
|
#define STM32_PWM_USE_TIM3 FALSE
|
||||||
|
#define STM32_PWM_TIM1_IRQ_PRIORITY 3
|
||||||
|
#define STM32_PWM_TIM2_IRQ_PRIORITY 3
|
||||||
|
#define STM32_PWM_TIM3_IRQ_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SERIAL driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_SERIAL_USE_USART1 FALSE
|
||||||
|
#define STM32_SERIAL_USE_USART2 TRUE
|
||||||
|
#define STM32_SERIAL_USE_USART3 FALSE
|
||||||
|
#define STM32_SERIAL_USE_UART4 FALSE
|
||||||
|
#define STM32_SERIAL_USART1_PRIORITY 3
|
||||||
|
#define STM32_SERIAL_USART2_PRIORITY 3
|
||||||
|
#define STM32_SERIAL_USART3_8_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SPI driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_SPI_USE_SPI1 FALSE
|
||||||
|
#define STM32_SPI_USE_SPI2 FALSE
|
||||||
|
#define STM32_SPI_SPI1_DMA_PRIORITY 1
|
||||||
|
#define STM32_SPI_SPI2_DMA_PRIORITY 1
|
||||||
|
#define STM32_SPI_SPI1_IRQ_PRIORITY 2
|
||||||
|
#define STM32_SPI_SPI2_IRQ_PRIORITY 2
|
||||||
|
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||||
|
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ST driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_ST_IRQ_PRIORITY 2
|
||||||
|
#define STM32_ST_USE_TIMER 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* UART driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_UART_USE_USART1 FALSE
|
||||||
|
#define STM32_UART_USE_USART2 FALSE
|
||||||
|
#define STM32_UART_USE_USART3 FALSE
|
||||||
|
#define STM32_UART_USE_UART4 FALSE
|
||||||
|
#define STM32_UART_USART1_IRQ_PRIORITY 3
|
||||||
|
#define STM32_UART_USART2_IRQ_PRIORITY 3
|
||||||
|
#define STM32_UART_USART3_8_IRQ_PRIORITY 3
|
||||||
|
#define STM32_UART_USART1_DMA_PRIORITY 0
|
||||||
|
#define STM32_UART_USART2_DMA_PRIORITY 0
|
||||||
|
#define STM32_UART_USART3_DMA_PRIORITY 0
|
||||||
|
#define STM32_UART_UART4_DMA_PRIORITY 0
|
||||||
|
#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||||
|
#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
|
||||||
|
#define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
|
||||||
|
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* USB driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_USB_USE_USB1 FALSE
|
||||||
|
#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
|
||||||
|
#define STM32_USB_USB1_LP_IRQ_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WDG driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_WDG_USE_IWDG FALSE
|
||||||
|
|
||||||
|
#endif /* MCUCONF_H */
|
|
@ -70,19 +70,17 @@ void hal_lld_init(void) {
|
||||||
*/
|
*/
|
||||||
void _sim_check_for_interrupts(void) {
|
void _sim_check_for_interrupts(void) {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
bool int_occurred = false;
|
||||||
|
|
||||||
#if HAL_USE_SERIAL
|
#if HAL_USE_SERIAL
|
||||||
if (sd_lld_interrupt_pending()) {
|
if (sd_lld_interrupt_pending()) {
|
||||||
_dbg_check_lock();
|
int_occured = true;
|
||||||
if (chSchIsPreemptionRequired())
|
|
||||||
chSchDoReschedule();
|
|
||||||
_dbg_check_unlock();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
if (timercmp(&tv, &nextcnt, >=)) {
|
if (timercmp(&tv, &nextcnt, >=)) {
|
||||||
|
int_occurred = true;
|
||||||
timeradd(&nextcnt, &tick, &nextcnt);
|
timeradd(&nextcnt, &tick, &nextcnt);
|
||||||
|
|
||||||
CH_IRQ_PROLOGUE();
|
CH_IRQ_PROLOGUE();
|
||||||
|
@ -92,7 +90,9 @@ void _sim_check_for_interrupts(void) {
|
||||||
chSysUnlockFromISR();
|
chSysUnlockFromISR();
|
||||||
|
|
||||||
CH_IRQ_EPILOGUE();
|
CH_IRQ_EPILOGUE();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (int_occurred) {
|
||||||
_dbg_check_lock();
|
_dbg_check_lock();
|
||||||
if (chSchIsPreemptionRequired())
|
if (chSchIsPreemptionRequired())
|
||||||
chSchDoReschedule();
|
chSchDoReschedule();
|
||||||
|
|
|
@ -76,20 +76,18 @@ void hal_lld_init(void) {
|
||||||
*/
|
*/
|
||||||
void _sim_check_for_interrupts(void) {
|
void _sim_check_for_interrupts(void) {
|
||||||
LARGE_INTEGER n;
|
LARGE_INTEGER n;
|
||||||
|
bool int_occurred = false;
|
||||||
|
|
||||||
#if HAL_USE_SERIAL
|
#if HAL_USE_SERIAL
|
||||||
if (sd_lld_interrupt_pending()) {
|
if (sd_lld_interrupt_pending()) {
|
||||||
_dbg_check_lock();
|
int_occured = true;
|
||||||
if (chSchIsPreemptionRequired())
|
|
||||||
chSchDoReschedule();
|
|
||||||
_dbg_check_unlock();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Interrupt Timer simulation (10ms interval).*/
|
/* Interrupt Timer simulation (10ms interval).*/
|
||||||
QueryPerformanceCounter(&n);
|
QueryPerformanceCounter(&n);
|
||||||
if (n.QuadPart > nextcnt.QuadPart) {
|
if (n.QuadPart > nextcnt.QuadPart) {
|
||||||
|
int_occured = true;
|
||||||
nextcnt.QuadPart += slice.QuadPart;
|
nextcnt.QuadPart += slice.QuadPart;
|
||||||
|
|
||||||
CH_IRQ_PROLOGUE();
|
CH_IRQ_PROLOGUE();
|
||||||
|
@ -99,7 +97,9 @@ void _sim_check_for_interrupts(void) {
|
||||||
chSysUnlockFromISR();
|
chSysUnlockFromISR();
|
||||||
|
|
||||||
CH_IRQ_EPILOGUE();
|
CH_IRQ_EPILOGUE();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (int_occurred) {
|
||||||
_dbg_check_lock();
|
_dbg_check_lock();
|
||||||
if (chSchIsPreemptionRequired())
|
if (chSchIsPreemptionRequired())
|
||||||
chSchDoReschedule();
|
chSchDoReschedule();
|
||||||
|
|
|
@ -28,7 +28,7 @@ ifeq ($(USE_LDOPT),)
|
||||||
USE_LDOPT =
|
USE_LDOPT =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable this if you want link time optimizations (LTO)
|
# Enable this if you want link time optimizations (LTO).
|
||||||
ifeq ($(USE_LTO),)
|
ifeq ($(USE_LTO),)
|
||||||
USE_LTO = no
|
USE_LTO = no
|
||||||
endif
|
endif
|
||||||
|
@ -65,6 +65,12 @@ PROJECT = ch
|
||||||
|
|
||||||
# Imported source files and paths
|
# Imported source files and paths
|
||||||
CHIBIOS = ../../..
|
CHIBIOS = ../../..
|
||||||
|
CONFDIR := ./cfg
|
||||||
|
BUILDDIR := ./build
|
||||||
|
DEPDIR := ./.dep
|
||||||
|
|
||||||
|
# Licensing files.
|
||||||
|
include $(CHIBIOS)/os/license/license.mk
|
||||||
# Startup files.
|
# Startup files.
|
||||||
# HAL-OSAL files (optional).
|
# HAL-OSAL files (optional).
|
||||||
include $(CHIBIOS)/os/hal/hal.mk
|
include $(CHIBIOS)/os/hal/hal.mk
|
||||||
|
@ -82,42 +88,50 @@ include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||||
#include $(CHIBIOS)/os/various/shell/shell.mk
|
#include $(CHIBIOS)/os/various/shell/shell.mk
|
||||||
|
|
||||||
# C sources here.
|
# C sources here.
|
||||||
CSRC = $(STARTUPSRC) \
|
CSRC = $(ALLCSRC) \
|
||||||
$(KERNSRC) \
|
|
||||||
$(PORTSRC) \
|
|
||||||
$(OSALSRC) \
|
|
||||||
$(HALSRC) \
|
|
||||||
$(PLATFORMSRC) \
|
|
||||||
$(BOARDSRC) \
|
|
||||||
$(TESTSRC) \
|
$(TESTSRC) \
|
||||||
$(STREAMSSRC) \
|
|
||||||
$(SHELLSRC) \
|
|
||||||
main.c
|
main.c
|
||||||
|
|
||||||
# C++ sources here.
|
# C++ sources here.
|
||||||
CPPSRC =
|
CPPSRC = $(ALLCPPSRC)
|
||||||
|
|
||||||
# List ASM source files here
|
# List ASM source files here.
|
||||||
ASMSRC =
|
ASMSRC = $(ALLASMSRC)
|
||||||
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
|
ASMXSRC = $(ALLXASMSRC)
|
||||||
|
|
||||||
INCDIR = $(CHIBIOS)/os/license \
|
INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC)
|
||||||
$(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
|
|
||||||
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
|
|
||||||
$(STREAMSINC) $(SHELLINC)
|
|
||||||
|
|
||||||
# GCOV files.
|
|
||||||
GCOVSRC = $(KERNSRC)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Project, sources and paths
|
# Project, sources and paths
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Start of user section
|
||||||
|
#
|
||||||
|
|
||||||
|
# List all user C define here, like -D_DEBUG=1
|
||||||
|
UDEFS = -DSIMULATOR
|
||||||
|
|
||||||
|
# Define ASM defines here
|
||||||
|
UADEFS =
|
||||||
|
|
||||||
|
# List all user directories here
|
||||||
|
UINCDIR =
|
||||||
|
|
||||||
|
# List the user directory to look for the libraries here
|
||||||
|
ULIBDIR =
|
||||||
|
|
||||||
|
# List all user libraries here
|
||||||
|
ULIBS =
|
||||||
|
|
||||||
|
#
|
||||||
|
# End of user defines
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Compiler settings
|
# Compiler settings
|
||||||
#
|
#
|
||||||
|
|
||||||
#TRGT = powerpc-eabi-
|
|
||||||
TRGT =
|
TRGT =
|
||||||
CC = $(TRGT)gcc
|
CC = $(TRGT)gcc
|
||||||
CPPC = $(TRGT)g++
|
CPPC = $(TRGT)g++
|
||||||
|
@ -131,6 +145,7 @@ AS = $(TRGT)gcc -x assembler-with-cpp
|
||||||
AR = $(TRGT)ar
|
AR = $(TRGT)ar
|
||||||
OD = $(TRGT)objdump
|
OD = $(TRGT)objdump
|
||||||
SZ = $(TRGT)size
|
SZ = $(TRGT)size
|
||||||
|
HEX = $(CP) -O ihex
|
||||||
BIN = $(CP) -O binary
|
BIN = $(CP) -O binary
|
||||||
COV = gcov
|
COV = gcov
|
||||||
|
|
||||||
|
@ -144,31 +159,5 @@ CPPWARN = -Wall -Wextra -Wundef
|
||||||
# Compiler settings
|
# Compiler settings
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Start of user section
|
|
||||||
#
|
|
||||||
|
|
||||||
# List all user C define here, like -D_DEBUG=1
|
|
||||||
UDEFS = -DSIMULATOR $(XDEFS)
|
|
||||||
|
|
||||||
# Define ASM defines here
|
|
||||||
UADEFS =
|
|
||||||
|
|
||||||
# List all user directories here
|
|
||||||
UINCDIR =
|
|
||||||
|
|
||||||
# List the user directory to look for the libraries here
|
|
||||||
ULIBDIR =
|
|
||||||
|
|
||||||
# List all user libraries here
|
|
||||||
ULIBS = -lgcov
|
|
||||||
|
|
||||||
#
|
|
||||||
# End of user defines
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC
|
RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC
|
||||||
include $(RULESPATH)/rules.mk
|
include $(RULESPATH)/rules.mk
|
||||||
|
|
||||||
misra:
|
|
||||||
@wine lint-nt -v -w3 $(DEFS) pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(KERNSRC)
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ ifeq ($(USE_LDOPT),)
|
||||||
USE_LDOPT =
|
USE_LDOPT =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable this if you want link time optimizations (LTO)
|
# Enable this if you want link time optimizations (LTO).
|
||||||
ifeq ($(USE_LTO),)
|
ifeq ($(USE_LTO),)
|
||||||
USE_LTO = no
|
USE_LTO = no
|
||||||
endif
|
endif
|
||||||
|
@ -65,6 +65,12 @@ PROJECT = ch.exe
|
||||||
|
|
||||||
# Imported source files and paths
|
# Imported source files and paths
|
||||||
CHIBIOS = ../../..
|
CHIBIOS = ../../..
|
||||||
|
CONFDIR := ./cfg
|
||||||
|
BUILDDIR := ./build
|
||||||
|
DEPDIR := ./.dep
|
||||||
|
|
||||||
|
# Licensing files.
|
||||||
|
include $(CHIBIOS)/os/license/license.mk
|
||||||
# Startup files.
|
# Startup files.
|
||||||
# HAL-OSAL files (optional).
|
# HAL-OSAL files (optional).
|
||||||
include $(CHIBIOS)/os/hal/hal.mk
|
include $(CHIBIOS)/os/hal/hal.mk
|
||||||
|
@ -82,43 +88,51 @@ include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||||
#include $(CHIBIOS)/os/various/shell/shell.mk
|
#include $(CHIBIOS)/os/various/shell/shell.mk
|
||||||
|
|
||||||
# C sources here.
|
# C sources here.
|
||||||
CSRC = $(STARTUPSRC) \
|
CSRC = $(ALLCSRC) \
|
||||||
$(KERNSRC) \
|
|
||||||
$(PORTSRC) \
|
|
||||||
$(OSALSRC) \
|
|
||||||
$(HALSRC) \
|
|
||||||
$(PLATFORMSRC) \
|
|
||||||
$(BOARDSRC) \
|
|
||||||
$(TESTSRC) \
|
$(TESTSRC) \
|
||||||
$(STREAMSSRC) \
|
|
||||||
$(SHELLSRC) \
|
|
||||||
main.c
|
main.c
|
||||||
|
|
||||||
# C++ sources here.
|
# C++ sources here.
|
||||||
CPPSRC =
|
CPPSRC = $(ALLCPPSRC)
|
||||||
|
|
||||||
# List ASM source files here
|
# List ASM source files here.
|
||||||
ASMSRC =
|
ASMSRC = $(ALLASMSRC)
|
||||||
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
|
ASMXSRC = $(ALLXASMSRC)
|
||||||
|
|
||||||
INCDIR = $(CHIBIOS)/os/license \
|
INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC)
|
||||||
$(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
|
|
||||||
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
|
|
||||||
$(STREAMSINC) $(SHELLINC)
|
|
||||||
|
|
||||||
# GCOV files.
|
|
||||||
GCOVSRC = $(KERNSRC)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Project, sources and paths
|
# Project, sources and paths
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Start of user section
|
||||||
|
#
|
||||||
|
|
||||||
|
# List all user C define here, like -D_DEBUG=1
|
||||||
|
UDEFS = -DSIMULATOR
|
||||||
|
|
||||||
|
# Define ASM defines here
|
||||||
|
UADEFS =
|
||||||
|
|
||||||
|
# List all user directories here
|
||||||
|
UINCDIR =
|
||||||
|
|
||||||
|
# List the user directory to look for the libraries here
|
||||||
|
ULIBDIR =
|
||||||
|
|
||||||
|
# List all user libraries here
|
||||||
|
ULIBS =
|
||||||
|
|
||||||
|
#
|
||||||
|
# End of user defines
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Compiler settings
|
# Compiler settings
|
||||||
#
|
#
|
||||||
|
|
||||||
#TRGT = powerpc-eabi-
|
TRGT =
|
||||||
TRGT = mingw32-
|
|
||||||
CC = $(TRGT)gcc
|
CC = $(TRGT)gcc
|
||||||
CPPC = $(TRGT)g++
|
CPPC = $(TRGT)g++
|
||||||
# Enable loading with g++ only if you need C++ runtime support.
|
# Enable loading with g++ only if you need C++ runtime support.
|
||||||
|
@ -131,6 +145,7 @@ AS = $(TRGT)gcc -x assembler-with-cpp
|
||||||
AR = $(TRGT)ar
|
AR = $(TRGT)ar
|
||||||
OD = $(TRGT)objdump
|
OD = $(TRGT)objdump
|
||||||
SZ = $(TRGT)size
|
SZ = $(TRGT)size
|
||||||
|
HEX = $(CP) -O ihex
|
||||||
BIN = $(CP) -O binary
|
BIN = $(CP) -O binary
|
||||||
COV = gcov
|
COV = gcov
|
||||||
|
|
||||||
|
@ -144,31 +159,5 @@ CPPWARN = -Wall -Wextra -Wundef
|
||||||
# Compiler settings
|
# Compiler settings
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Start of user section
|
|
||||||
#
|
|
||||||
|
|
||||||
# List all user C define here, like -D_DEBUG=1
|
|
||||||
UDEFS = -DSIMULATOR $(XDEFS)
|
|
||||||
|
|
||||||
# Define ASM defines here
|
|
||||||
UADEFS =
|
|
||||||
|
|
||||||
# List all user directories here
|
|
||||||
UINCDIR =
|
|
||||||
|
|
||||||
# List the user directory to look for the libraries here
|
|
||||||
ULIBDIR =
|
|
||||||
|
|
||||||
# List all user libraries here
|
|
||||||
ULIBS = -lws2_32 -lgcov
|
|
||||||
|
|
||||||
#
|
|
||||||
# End of user defines
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC
|
RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC
|
||||||
include $(RULESPATH)/rules.mk
|
include $(RULESPATH)/rules.mk
|
||||||
|
|
||||||
misra:
|
|
||||||
@lint-nt -v -w3 $(DEFS) pclint/co-gcc-win32.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(KERNSRC)
|
|
||||||
|
|
|
@ -0,0 +1,259 @@
|
||||||
|
/*
|
||||||
|
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MCUCONF_H
|
||||||
|
#define MCUCONF_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* STM32F0xx drivers configuration.
|
||||||
|
* The following settings override the default settings present in
|
||||||
|
* the various device driver implementation headers.
|
||||||
|
* Note that the settings for each driver only have effect if the whole
|
||||||
|
* driver is enabled in halconf.h.
|
||||||
|
*
|
||||||
|
* IRQ priorities:
|
||||||
|
* 3...0 Lowest...Highest.
|
||||||
|
*
|
||||||
|
* DMA priorities:
|
||||||
|
* 0...3 Lowest...Highest.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define STM32F0xx_MCUCONF
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HAL driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_NO_INIT FALSE
|
||||||
|
#define STM32_PVD_ENABLE FALSE
|
||||||
|
#define STM32_PLS STM32_PLS_LEV0
|
||||||
|
#define STM32_HSI_ENABLED TRUE
|
||||||
|
#define STM32_HSI14_ENABLED TRUE
|
||||||
|
#define STM32_HSI48_ENABLED FALSE
|
||||||
|
#define STM32_LSI_ENABLED TRUE
|
||||||
|
#define STM32_HSE_ENABLED FALSE
|
||||||
|
#define STM32_LSE_ENABLED FALSE
|
||||||
|
#define STM32_SW STM32_SW_PLL
|
||||||
|
#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2
|
||||||
|
#define STM32_PREDIV_VALUE 1
|
||||||
|
#define STM32_PLLMUL_VALUE 12
|
||||||
|
#define STM32_HPRE STM32_HPRE_DIV1
|
||||||
|
#define STM32_PPRE STM32_PPRE_DIV1
|
||||||
|
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
||||||
|
#define STM32_MCOPRE STM32_MCOPRE_DIV1
|
||||||
|
#define STM32_PLLNODIV STM32_PLLNODIV_DIV2
|
||||||
|
#define STM32_USBSW STM32_USBSW_HSI48
|
||||||
|
#define STM32_CECSW STM32_CECSW_HSI
|
||||||
|
#define STM32_I2C1SW STM32_I2C1SW_HSI
|
||||||
|
#define STM32_USART1SW STM32_USART1SW_PCLK
|
||||||
|
#define STM32_RTCSEL STM32_RTCSEL_LSI
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IRQ system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_IRQ_EXTI0_1_IRQ_PRIORITY 3
|
||||||
|
#define STM32_IRQ_EXTI2_3_IRQ_PRIORITY 3
|
||||||
|
#define STM32_IRQ_EXTI4_15_IRQ_PRIORITY 3
|
||||||
|
#define STM32_IRQ_EXTI16_IRQ_PRIORITY 3
|
||||||
|
#define STM32_IRQ_EXTI17_20_IRQ_PRIORITY 3
|
||||||
|
#define STM32_IRQ_EXTI21_22_IRQ_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ADC driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_ADC_USE_ADC1 FALSE
|
||||||
|
#define STM32_ADC_ADC1_CKMODE STM32_ADC_CKMODE_ADCCLK
|
||||||
|
#define STM32_ADC_ADC1_DMA_PRIORITY 2
|
||||||
|
#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2
|
||||||
|
#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* CAN driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_CAN_USE_CAN1 FALSE
|
||||||
|
#define STM32_CAN_CAN1_IRQ_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DAC driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_DAC_DUAL_MODE FALSE
|
||||||
|
#define STM32_DAC_USE_DAC1_CH1 FALSE
|
||||||
|
#define STM32_DAC_USE_DAC1_CH2 FALSE
|
||||||
|
#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 2
|
||||||
|
#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 2
|
||||||
|
#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
|
||||||
|
#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
|
||||||
|
#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GPT driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_GPT_USE_TIM1 FALSE
|
||||||
|
#define STM32_GPT_USE_TIM2 FALSE
|
||||||
|
#define STM32_GPT_USE_TIM3 FALSE
|
||||||
|
#define STM32_GPT_USE_TIM6 FALSE
|
||||||
|
#define STM32_GPT_USE_TIM14 FALSE
|
||||||
|
#define STM32_GPT_TIM1_IRQ_PRIORITY 2
|
||||||
|
#define STM32_GPT_TIM2_IRQ_PRIORITY 2
|
||||||
|
#define STM32_GPT_TIM3_IRQ_PRIORITY 2
|
||||||
|
#define STM32_GPT_TIM6_IRQ_PRIORITY 2
|
||||||
|
#define STM32_GPT_TIM14_IRQ_PRIORITY 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* I2C driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_I2C_USE_I2C1 FALSE
|
||||||
|
#define STM32_I2C_USE_I2C2 FALSE
|
||||||
|
#define STM32_I2C_BUSY_TIMEOUT 50
|
||||||
|
#define STM32_I2C_I2C1_IRQ_PRIORITY 3
|
||||||
|
#define STM32_I2C_I2C2_IRQ_PRIORITY 3
|
||||||
|
#define STM32_I2C_USE_DMA TRUE
|
||||||
|
#define STM32_I2C_I2C1_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2C_I2C2_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||||
|
#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* I2S driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_I2S_USE_SPI1 FALSE
|
||||||
|
#define STM32_I2S_USE_SPI2 FALSE
|
||||||
|
#define STM32_I2S_SPI1_MODE (STM32_I2S_MODE_MASTER | \
|
||||||
|
STM32_I2S_MODE_RX)
|
||||||
|
#define STM32_I2S_SPI2_MODE (STM32_I2S_MODE_MASTER | \
|
||||||
|
STM32_I2S_MODE_RX)
|
||||||
|
#define STM32_I2S_SPI1_IRQ_PRIORITY 2
|
||||||
|
#define STM32_I2S_SPI2_IRQ_PRIORITY 2
|
||||||
|
#define STM32_I2S_SPI1_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2S_SPI2_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2S_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_I2S_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_I2S_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
#define STM32_I2S_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||||
|
#define STM32_I2S_DMA_ERROR_HOOK(i2sp) osalSysHalt("DMA failure")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* I2S driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_I2S_USE_SPI1 FALSE
|
||||||
|
#define STM32_I2S_USE_SPI2 FALSE
|
||||||
|
#define STM32_I2S_SPI1_MODE (STM32_I2S_MODE_MASTER | \
|
||||||
|
STM32_I2S_MODE_RX)
|
||||||
|
#define STM32_I2S_SPI2_MODE (STM32_I2S_MODE_MASTER | \
|
||||||
|
STM32_I2S_MODE_RX)
|
||||||
|
#define STM32_I2S_SPI1_IRQ_PRIORITY 2
|
||||||
|
#define STM32_I2S_SPI2_IRQ_PRIORITY 2
|
||||||
|
#define STM32_I2S_SPI1_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2S_SPI2_DMA_PRIORITY 1
|
||||||
|
#define STM32_I2S_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_I2S_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_I2S_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
#define STM32_I2S_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||||
|
#define STM32_I2S_DMA_ERROR_HOOK(i2sp) osalSysHalt("DMA failure")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ICU driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_ICU_USE_TIM1 FALSE
|
||||||
|
#define STM32_ICU_USE_TIM2 FALSE
|
||||||
|
#define STM32_ICU_USE_TIM3 FALSE
|
||||||
|
#define STM32_ICU_TIM1_IRQ_PRIORITY 3
|
||||||
|
#define STM32_ICU_TIM2_IRQ_PRIORITY 3
|
||||||
|
#define STM32_ICU_TIM3_IRQ_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PWM driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_PWM_USE_ADVANCED FALSE
|
||||||
|
#define STM32_PWM_USE_TIM1 FALSE
|
||||||
|
#define STM32_PWM_USE_TIM2 FALSE
|
||||||
|
#define STM32_PWM_USE_TIM3 FALSE
|
||||||
|
#define STM32_PWM_TIM1_IRQ_PRIORITY 3
|
||||||
|
#define STM32_PWM_TIM2_IRQ_PRIORITY 3
|
||||||
|
#define STM32_PWM_TIM3_IRQ_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SERIAL driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_SERIAL_USE_USART1 FALSE
|
||||||
|
#define STM32_SERIAL_USE_USART2 TRUE
|
||||||
|
#define STM32_SERIAL_USE_USART3 FALSE
|
||||||
|
#define STM32_SERIAL_USE_UART4 FALSE
|
||||||
|
#define STM32_SERIAL_USART1_PRIORITY 3
|
||||||
|
#define STM32_SERIAL_USART2_PRIORITY 3
|
||||||
|
#define STM32_SERIAL_USART3_8_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SPI driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_SPI_USE_SPI1 FALSE
|
||||||
|
#define STM32_SPI_USE_SPI2 FALSE
|
||||||
|
#define STM32_SPI_SPI1_DMA_PRIORITY 1
|
||||||
|
#define STM32_SPI_SPI2_DMA_PRIORITY 1
|
||||||
|
#define STM32_SPI_SPI1_IRQ_PRIORITY 2
|
||||||
|
#define STM32_SPI_SPI2_IRQ_PRIORITY 2
|
||||||
|
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||||
|
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ST driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_ST_IRQ_PRIORITY 2
|
||||||
|
#define STM32_ST_USE_TIMER 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* UART driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_UART_USE_USART1 FALSE
|
||||||
|
#define STM32_UART_USE_USART2 FALSE
|
||||||
|
#define STM32_UART_USE_USART3 FALSE
|
||||||
|
#define STM32_UART_USE_UART4 FALSE
|
||||||
|
#define STM32_UART_USART1_IRQ_PRIORITY 3
|
||||||
|
#define STM32_UART_USART2_IRQ_PRIORITY 3
|
||||||
|
#define STM32_UART_USART3_8_IRQ_PRIORITY 3
|
||||||
|
#define STM32_UART_USART1_DMA_PRIORITY 0
|
||||||
|
#define STM32_UART_USART2_DMA_PRIORITY 0
|
||||||
|
#define STM32_UART_USART3_DMA_PRIORITY 0
|
||||||
|
#define STM32_UART_UART4_DMA_PRIORITY 0
|
||||||
|
#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||||
|
#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||||
|
#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
|
||||||
|
#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
|
||||||
|
#define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
|
||||||
|
#define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
|
||||||
|
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* USB driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_USB_USE_USB1 FALSE
|
||||||
|
#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
|
||||||
|
#define STM32_USB_USB1_LP_IRQ_PRIORITY 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WDG driver system settings.
|
||||||
|
*/
|
||||||
|
#define STM32_WDG_USE_IWDG FALSE
|
||||||
|
|
||||||
|
#endif /* MCUCONF_H */
|
Loading…
Reference in New Issue