git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10946 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
ec1b4e7251
commit
6c18028a35
|
@ -29,7 +29,7 @@
|
|||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_NIL_CONF_
|
||||
#define _CHIBIOS_NIL_CONF_VER_5_0_
|
||||
#define _CHIBIOS_NIL_CONF_VER_3_0_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_NIL_CONF_
|
||||
#define _CHIBIOS_NIL_CONF_VER_5_0_
|
||||
#define _CHIBIOS_NIL_CONF_VER_3_0_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_NIL_CONF_
|
||||
#define _CHIBIOS_NIL_CONF_VER_5_0_
|
||||
#define _CHIBIOS_NIL_CONF_VER_3_0_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_NIL_CONF_
|
||||
#define _CHIBIOS_NIL_CONF_VER_5_0_
|
||||
#define _CHIBIOS_NIL_CONF_VER_3_0_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_NIL_CONF_
|
||||
#define _CHIBIOS_NIL_CONF_VER_5_0_
|
||||
#define _CHIBIOS_NIL_CONF_VER_3_0_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_NIL_CONF_
|
||||
#define _CHIBIOS_NIL_CONF_VER_5_0_
|
||||
#define _CHIBIOS_NIL_CONF_VER_3_0_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
|
|
|
@ -99,8 +99,8 @@ include $(CHIBIOS)/os/nil/nil.mk
|
|||
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
|
||||
# Other files (optional).
|
||||
#include $(CHIBIOS)/test/lib/test.mk
|
||||
include $(CHIBIOS)/test/nil/nil_test.mk
|
||||
include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||
#include $(CHIBIOS)/test/nil/nil_test.mk
|
||||
#include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||
|
||||
# Define linker script file here
|
||||
LDSCRIPT= $(STARTUPLD)/STM32L011x4.ld
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_NIL_CONF_
|
||||
#define _CHIBIOS_NIL_CONF_VER_5_0_
|
||||
#define _CHIBIOS_NIL_CONF_VER_3_0_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
|
|
|
@ -99,8 +99,8 @@ include $(CHIBIOS)/os/nil/nil.mk
|
|||
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
|
||||
# Other files (optional).
|
||||
#include $(CHIBIOS)/test/lib/test.mk
|
||||
include $(CHIBIOS)/test/nil/nil_test.mk
|
||||
include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||
#include $(CHIBIOS)/test/nil/nil_test.mk
|
||||
#include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||
|
||||
# Define linker script file here
|
||||
LDSCRIPT= $(STARTUPLD)/STM32L152xB.ld
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_NIL_CONF_
|
||||
#define _CHIBIOS_NIL_CONF_VER_5_0_
|
||||
#define _CHIBIOS_NIL_CONF_VER_3_0_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="delta-next-vtlist-null-_idle_thread.lto_priv.25-(format)" val="4"/></contentList>"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList> <memoryBlockExpressionItem> <expression text="0x0"/> </memoryBlockExpressionItem> </memoryBlockExpressionList> "/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList> <memoryBlockExpressionItem> <expression text="0x0"/> </memoryBlockExpressionItem> </memoryBlockExpressionList> "/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="RT-STM32F746G-DISCOVERY"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
|
||||
|
|
|
@ -99,8 +99,8 @@ include $(CHIBIOS)/os/nil/nil.mk
|
|||
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
|
||||
# Other files (optional).
|
||||
#include $(CHIBIOS)/test/lib/test.mk
|
||||
include $(CHIBIOS)/test/nil/nil_test.mk
|
||||
include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||
#include $(CHIBIOS)/test/nil/nil_test.mk
|
||||
#include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||
|
||||
# Define linker script file here
|
||||
LDSCRIPT= $(STARTUPLD)/STM32F051x8.ld
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* @details A copy of this file must be placed in each project directory, it
|
||||
* contains the application specific kernel settings.
|
||||
*
|
||||
* @addtogroup config
|
||||
* @addtogroup NIL_CONFIG
|
||||
* @details Kernel related settings and hooks.
|
||||
* @{
|
||||
*/
|
||||
|
@ -29,7 +29,7 @@
|
|||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_NIL_CONF_
|
||||
#define _CHIBIOS_NIL_CONF_VER_5_0_
|
||||
#define _CHIBIOS_NIL_CONF_VER_3_0_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
|
|
|
@ -99,8 +99,8 @@ include $(CHIBIOS)/os/nil/nil.mk
|
|||
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
|
||||
# Other files (optional).
|
||||
#include $(CHIBIOS)/test/lib/test.mk
|
||||
include $(CHIBIOS)/test/nil/nil_test.mk
|
||||
include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||
#include $(CHIBIOS)/test/nil/nil_test.mk
|
||||
#include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||
|
||||
# Define linker script file here
|
||||
LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* @details A copy of this file must be placed in each project directory, it
|
||||
* contains the application specific kernel settings.
|
||||
*
|
||||
* @addtogroup config
|
||||
* @addtogroup NIL_CONFIG
|
||||
* @details Kernel related settings and hooks.
|
||||
* @{
|
||||
*/
|
||||
|
@ -29,7 +29,7 @@
|
|||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_NIL_CONF_
|
||||
#define _CHIBIOS_NIL_CONF_VER_5_0_
|
||||
#define _CHIBIOS_NIL_CONF_VER_3_0_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
|
|
|
@ -68,7 +68,7 @@ static void timer_cb(void const *arg) {
|
|||
timer_id->ptimer(timer_id->argument);
|
||||
if (timer_id->type == osTimerPeriodic) {
|
||||
chSysLockFromISR();
|
||||
chVTDoSetI(&timer_id->vt, MS2ST(timer_id->millisec),
|
||||
chVTDoSetI(&timer_id->vt, TIME_MS2I(timer_id->millisec),
|
||||
(vtfunc_t)timer_cb, timer_id);
|
||||
chSysUnlockFromISR();
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ osStatus osTimerStart(osTimerId timer_id, uint32_t millisec) {
|
|||
return osErrorValue;
|
||||
|
||||
timer_id->millisec = millisec;
|
||||
chVTSet(&timer_id->vt, MS2ST(millisec), (vtfunc_t)timer_cb, timer_id);
|
||||
chVTSet(&timer_id->vt, TIME_MS2I(millisec), (vtfunc_t)timer_cb, timer_id);
|
||||
|
||||
return osOK;
|
||||
}
|
||||
|
@ -287,8 +287,8 @@ int32_t osSignalClear(osThreadId thread_id, int32_t signals) {
|
|||
*/
|
||||
osEvent osSignalWait(int32_t signals, uint32_t millisec) {
|
||||
osEvent event;
|
||||
systime_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
|
||||
TIME_INFINITE : MS2ST(millisec);
|
||||
sysinterval_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
|
||||
TIME_INFINITE : TIME_MS2I(millisec);
|
||||
|
||||
if (signals == 0)
|
||||
event.value.signals = (uint32_t)chEvtWaitAnyTimeout(ALL_EVENTS, timeout);
|
||||
|
@ -324,8 +324,8 @@ osSemaphoreId osSemaphoreCreate(const osSemaphoreDef_t *semaphore_def,
|
|||
* @brief Wait on a semaphore.
|
||||
*/
|
||||
int32_t osSemaphoreWait(osSemaphoreId semaphore_id, uint32_t millisec) {
|
||||
systime_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
|
||||
TIME_INFINITE : MS2ST(millisec);
|
||||
sysinterval_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
|
||||
TIME_INFINITE : TIME_MS2I(millisec);
|
||||
|
||||
msg_t msg = chSemWaitTimeout((semaphore_t *)semaphore_id, timeout);
|
||||
switch (msg) {
|
||||
|
@ -380,8 +380,8 @@ osMutexId osMutexCreate(const osMutexDef_t *mutex_def) {
|
|||
* @brief Wait on a mutex.
|
||||
*/
|
||||
osStatus osMutexWait(osMutexId mutex_id, uint32_t millisec) {
|
||||
systime_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
|
||||
TIME_INFINITE : MS2ST(millisec);
|
||||
sysinterval_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
|
||||
TIME_INFINITE : TIME_MS2I(millisec);
|
||||
|
||||
msg_t msg = chBSemWaitTimeout((binary_semaphore_t *)mutex_id, timeout);
|
||||
switch (msg) {
|
||||
|
@ -495,8 +495,8 @@ osStatus osMessagePut(osMessageQId queue_id,
|
|||
uint32_t info,
|
||||
uint32_t millisec) {
|
||||
msg_t msg;
|
||||
systime_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
|
||||
TIME_INFINITE : MS2ST(millisec);
|
||||
sysinterval_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
|
||||
TIME_INFINITE : TIME_MS2I(millisec);
|
||||
|
||||
if (port_is_isr_context()) {
|
||||
|
||||
|
@ -522,8 +522,8 @@ osEvent osMessageGet(osMessageQId queue_id,
|
|||
uint32_t millisec) {
|
||||
msg_t msg;
|
||||
osEvent event;
|
||||
systime_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
|
||||
TIME_INFINITE : MS2ST(millisec);
|
||||
sysinterval_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
|
||||
TIME_INFINITE : TIME_MS2I(millisec);
|
||||
|
||||
event.def.message_id = queue_id;
|
||||
|
||||
|
|
|
@ -56,8 +56,8 @@
|
|||
#define F_LOCK() chMtxLock(&ch_factory.mtx)
|
||||
#define F_UNLOCK() chMtxUnlock(&ch_factory.mtx)
|
||||
#else
|
||||
#define F_LOCK() (void) chSemWait(ch_factory.sem)
|
||||
#define F_UNLOCK() chSemSignal(ch_factory.sem)
|
||||
#define F_LOCK() (void) chSemWait(&ch_factory.sem)
|
||||
#define F_UNLOCK() chSemSignal(&ch_factory.sem)
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -263,6 +263,60 @@
|
|||
#if !defined(CH_CFG_USE_MEMPOOLS) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MEMPOOLS TRUE
|
||||
#endif
|
||||
/**
|
||||
* @brief Objects Factory APIs.
|
||||
* @details If enabled then the objects factory APIs are included in the
|
||||
* kernel.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_CFG_USE_FACTORY) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_FACTORY TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Maximum length for object names.
|
||||
* @details If the specified length is zero then the name is stored by
|
||||
* pointer but this could have unintended side effects.
|
||||
*/
|
||||
#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the registry of generic objects.
|
||||
*/
|
||||
#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables factory for generic buffers.
|
||||
*/
|
||||
#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables factory for semaphores.
|
||||
*/
|
||||
#if !defined(CH_CFG_FACTORY_SEMAPHORES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_FACTORY_SEMAPHORES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables factory for mailboxes.
|
||||
*/
|
||||
#if !defined(CH_CFG_FACTORY_MAILBOXES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_FACTORY_MAILBOXES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables factory for objects FIFOs.
|
||||
*/
|
||||
#if !defined(CH_CFG_FACTORY_OBJ_FIFOS) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_FACTORY_OBJ_FIFOS TRUE
|
||||
#endif
|
||||
|
||||
/*-*
|
||||
* @brief Debug option, kernel statistics.
|
||||
|
@ -414,6 +468,10 @@
|
|||
#error "missing or wrong configuration file"
|
||||
#endif
|
||||
|
||||
#if !defined(_CHIBIOS_NIL_CONF_VER_3_0_)
|
||||
#error "obsolete or unknown configuration file"
|
||||
#endif
|
||||
|
||||
#if CH_CFG_NUM_THREADS < 1
|
||||
#error "at least one thread must be defined"
|
||||
#endif
|
||||
|
@ -1501,8 +1559,10 @@ extern "C" {
|
|||
/* Optional subsystems.*/
|
||||
#include "chmboxes.h"
|
||||
#include "chmemcore.h"
|
||||
#include "chmempools.h"
|
||||
#include "chheap.h"
|
||||
#include "chmempools.h"
|
||||
#include "chfifo.h"
|
||||
#include "chfactory.h"
|
||||
|
||||
#endif /* CH_H */
|
||||
|
||||
|
|
|
@ -15,12 +15,16 @@ endif
|
|||
ifneq ($(findstring CH_CFG_USE_MEMPOOLS TRUE,$(CHCONF)),)
|
||||
KERNSRC += $(CHIBIOS)/os/common/oslib/src/chmempools.c
|
||||
endif
|
||||
ifneq ($(findstring CH_CFG_USE_FACTORY TRUE,$(CHCONF)),)
|
||||
KERNSRC += $(CHIBIOS)/os/common/oslib/src/chfactory.c
|
||||
endif
|
||||
else
|
||||
KERNSRC := ${CHIBIOS}/os/nil/src/ch.c \
|
||||
${CHIBIOS}/os/common/oslib/src/chmboxes.c \
|
||||
${CHIBIOS}/os/common/oslib/src/chmemcore.c \
|
||||
${CHIBIOS}/os/common/oslib/src/chmempools.c \
|
||||
${CHIBIOS}/os/common/oslib/src/chheap.c
|
||||
$(CHIBIOS)/os/common/oslib/src/chmboxes.c \
|
||||
$(CHIBIOS)/os/common/oslib/src/chmemcore.c \
|
||||
$(CHIBIOS)/os/common/oslib/src/chheap.c \
|
||||
$(CHIBIOS)/os/common/oslib/src/chmempools.c \
|
||||
$(CHIBIOS)/os/common/oslib/src/chfactory.c
|
||||
endif
|
||||
|
||||
# Required include directories
|
||||
|
|
|
@ -76,7 +76,8 @@ KERNSRC := $(CHIBIOS)/os/rt/src/chsys.c \
|
|||
$(CHIBIOS)/os/common/oslib/src/chmboxes.c \
|
||||
$(CHIBIOS)/os/common/oslib/src/chmemcore.c \
|
||||
$(CHIBIOS)/os/common/oslib/src/chheap.c \
|
||||
$(CHIBIOS)/os/common/oslib/src/chmempools.c
|
||||
$(CHIBIOS)/os/common/oslib/src/chmempools.c \
|
||||
$(CHIBIOS)/os/common/oslib/src/chfactory.c
|
||||
endif
|
||||
|
||||
# Required include directories
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* @details A copy of this file must be placed in each project directory, it
|
||||
* contains the application specific kernel settings.
|
||||
*
|
||||
* @addtogroup config
|
||||
* @addtogroup NIL_CONFIG
|
||||
* @details Kernel related settings and hooks.
|
||||
* @{
|
||||
*/
|
||||
|
@ -29,7 +29,7 @@
|
|||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_NIL_CONF_
|
||||
#define _CHIBIOS_NIL_CONF_VER_5_0_
|
||||
#define _CHIBIOS_NIL_CONF_VER_3_0_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue