aboutsummaryrefslogtreecommitdiffstats
path: root/demos/STM32/NIL-STM32F303-DISCOVERY
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 14:08:44 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 14:08:44 +0000
commite9990f73ef2625764f7cc12210ce5704ebfcdaa2 (patch)
treede980372545b0fde648a6dd016b54f5b69fe1240 /demos/STM32/NIL-STM32F303-DISCOVERY
parenta739e4e7abaf487e57647788fc93ca5e11727bbb (diff)
downloadChibiOS-e9990f73ef2625764f7cc12210ce5704ebfcdaa2.tar.gz
ChibiOS-e9990f73ef2625764f7cc12210ce5704ebfcdaa2.tar.bz2
ChibiOS-e9990f73ef2625764f7cc12210ce5704ebfcdaa2.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8905 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/STM32/NIL-STM32F303-DISCOVERY')
-rw-r--r--demos/STM32/NIL-STM32F303-DISCOVERY/Makefile8
-rw-r--r--demos/STM32/NIL-STM32F303-DISCOVERY/chconf.h (renamed from demos/STM32/NIL-STM32F303-DISCOVERY/nilconf.h)135
-rw-r--r--demos/STM32/NIL-STM32F303-DISCOVERY/main.c2
3 files changed, 120 insertions, 25 deletions
diff --git a/demos/STM32/NIL-STM32F303-DISCOVERY/Makefile b/demos/STM32/NIL-STM32F303-DISCOVERY/Makefile
index 7eba78d07..f14cadc0a 100644
--- a/demos/STM32/NIL-STM32F303-DISCOVERY/Makefile
+++ b/demos/STM32/NIL-STM32F303-DISCOVERY/Makefile
@@ -69,7 +69,7 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
USE_EXCEPTIONS_STACKSIZE = 0x400
endif
-# Enables the use of FPU on Cortex-M4 (no, softfp, hard).
+# Enables the use of FPU (no, softfp, hard).
ifeq ($(USE_FPU),)
USE_FPU = no
endif
@@ -88,7 +88,7 @@ PROJECT = ch
# Imported source files and paths
CHIBIOS = ../../..
# Startup files.
-include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk
+include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/ports/STM32/STM32F3xx/platform.mk
@@ -96,7 +96,7 @@ include $(CHIBIOS)/os/hal/boards/ST_STM32F3_DISCOVERY/board.mk
include $(CHIBIOS)/os/hal/osal/nil/osal.mk
# RTOS files (optional).
include $(CHIBIOS)/os/nil/nil.mk
-include $(CHIBIOS)/os/nil/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
+include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/port_v7m.mk
# Other files (optional).
include $(CHIBIOS)/test/nil/test.mk
@@ -212,5 +212,5 @@ ULIBS =
# End of user defines
##############################################################################
-RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
+RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
include $(RULESPATH)/rules.mk
diff --git a/demos/STM32/NIL-STM32F303-DISCOVERY/nilconf.h b/demos/STM32/NIL-STM32F303-DISCOVERY/chconf.h
index e0b6c53cd..f594de4b3 100644
--- a/demos/STM32/NIL-STM32F303-DISCOVERY/nilconf.h
+++ b/demos/STM32/NIL-STM32F303-DISCOVERY/chconf.h
@@ -15,7 +15,7 @@
*/
/**
- * @file nilconf.h
+ * @file chconf.h
* @brief Configuration file template.
* @details A copy of this file must be placed in each project directory, it
* contains the application specific kernel settings.
@@ -25,8 +25,10 @@
* @{
*/
-#ifndef _NILCONF_H_
-#define _NILCONF_H_
+#ifndef _CHCONF_H_
+#define _CHCONF_H_
+
+#define _CHIBIOS_NIL_CONF_
/*===========================================================================*/
/**
@@ -40,7 +42,7 @@
* @note This number is not inclusive of the idle thread which is
* Implicitly handled.
*/
-#define NIL_CFG_NUM_THREADS 4
+#define CH_CFG_NUM_THREADS 4
/** @} */
@@ -55,15 +57,15 @@
* @brief System time counter resolution.
* @note Allowed values are 16 or 32 bits.
*/
-#define NIL_CFG_ST_RESOLUTION 32
+#define CH_CFG_ST_RESOLUTION 32
/**
* @brief System tick frequency.
- * @note This value together with the @p NIL_CFG_ST_RESOLUTION
+ * @note This value together with the @p CH_CFG_ST_RESOLUTION
* option defines the maximum amount of time allowed for
* timeouts.
*/
-#define NIL_CFG_ST_FREQUENCY 50000
+#define CH_CFG_ST_FREQUENCY 2000
/**
* @brief Time delta constant for the tick-less mode.
@@ -73,7 +75,7 @@
* The value one is not valid, timeouts are rounded up to
* this value.
*/
-#define NIL_CFG_ST_TIMEDELTA 2
+#define CH_CFG_ST_TIMEDELTA 2
/** @} */
@@ -85,12 +87,79 @@
/*===========================================================================*/
/**
+ * @brief Semaphores APIs.
+ * @details If enabled then the Semaphores APIs are included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_SEMAPHORES TRUE
+
+/**
+ * @brief Mutexes APIs.
+ * @details If enabled then the mutexes APIs are included in the kernel.
+ *
+ * @note Feature not currently implemented.
+ * @note The default is @p FALSE.
+ */
+#define CH_CFG_USE_MUTEXES FALSE
+
+/**
* @brief Events Flags APIs.
* @details If enabled then the event flags APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
-#define NIL_CFG_USE_EVENTS TRUE
+#define CH_CFG_USE_EVENTS TRUE
+
+/**
+ * @brief Mailboxes APIs.
+ * @details If enabled then the asynchronous messages (mailboxes) APIs are
+ * included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ * @note Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_MAILBOXES TRUE
+
+/**
+ * @brief Core Memory Manager APIs.
+ * @details If enabled then the core memory manager APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMCORE TRUE
+
+/**
+ * @brief Heap Allocator APIs.
+ * @details If enabled then the memory heap allocator APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_HEAP TRUE
+
+/**
+ * @brief Memory Pools Allocator APIs.
+ * @details If enabled then the memory pools allocator APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMPOOLS TRUE
+
+/**
+ * @brief Managed RAM size.
+ * @details Size of the RAM area to be managed by the OS. If set to zero
+ * then the whole available RAM is used. The core memory is made
+ * available to the heap allocator and/or can be used directly through
+ * the simplified core memory allocator.
+ *
+ * @note In order to let the OS manage the whole RAM the linker script must
+ * provide the @p __heap_base__ and @p __heap_end__ symbols.
+ * @note Requires @p CH_CFG_USE_MEMCORE.
+ */
+#define CH_CFG_MEMCORE_SIZE 0
/** @} */
@@ -102,14 +171,40 @@
/*===========================================================================*/
/**
+ * @brief Debug option, kernel statistics.
+ *
+ * @note Feature not currently implemented.
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_STATISTICS FALSE
+
+/**
+ * @brief Debug option, system state check.
+ *
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_SYSTEM_STATE_CHECK FALSE
+
+/**
+ * @brief Debug option, parameters checks.
+ *
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_CHECKS FALSE
+
+/**
* @brief System assertions.
+ *
+ * @note The default is @p FALSE.
*/
-#define NIL_CFG_ENABLE_ASSERTS FALSE
+#define CH_DBG_ENABLE_ASSERTS FALSE
/**
* @brief Stack check.
+ *
+ * @note The default is @p FALSE.
*/
-#define NIL_CFG_ENABLE_STACK_CHECK FALSE
+#define CH_DBG_ENABLE_STACK_CHECK FALSE
/** @} */
@@ -123,8 +218,8 @@
/**
* @brief System initialization hook.
*/
-#if !defined(NIL_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__)
-#define NIL_CFG_SYSTEM_INIT_HOOK() { \
+#if !defined(CH_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__)
+#define CH_CFG_SYSTEM_INIT_HOOK() { \
}
#endif
@@ -132,13 +227,13 @@
* @brief Threads descriptor structure extension.
* @details User fields added to the end of the @p thread_t structure.
*/
-#define NIL_CFG_THREAD_EXT_FIELDS \
+#define CH_CFG_THREAD_EXT_FIELDS \
/* Add threads custom fields here.*/
/**
* @brief Threads initialization hook.
*/
-#define NIL_CFG_THREAD_EXT_INIT_HOOK(tr) { \
+#define CH_CFG_THREAD_EXT_INIT_HOOK(tr) { \
/* Add custom threads initialization code here.*/ \
}
@@ -148,7 +243,7 @@
* should be invoked from here.
* @note This macro can be used to activate a power saving mode.
*/
-#define NIL_CFG_IDLE_ENTER_HOOK() { \
+#define CH_CFG_IDLE_ENTER_HOOK() { \
}
/**
@@ -157,14 +252,14 @@
* should be invoked from here.
* @note This macro can be used to deactivate a power saving mode.
*/
-#define NIL_CFG_IDLE_LEAVE_HOOK() { \
+#define CH_CFG_IDLE_LEAVE_HOOK() { \
}
/**
* @brief System halt hook.
*/
-#if !defined(NIL_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
-#define NIL_CFG_SYSTEM_HALT_HOOK(reason) { \
+#if !defined(CH_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
+#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
}
#endif
@@ -174,6 +269,6 @@
/* Port-specific settings (override port settings defaulted in nilcore.h). */
/*===========================================================================*/
-#endif /* _NILCONF_H_ */
+#endif /* _CHCONF_H_ */
/** @} */
diff --git a/demos/STM32/NIL-STM32F303-DISCOVERY/main.c b/demos/STM32/NIL-STM32F303-DISCOVERY/main.c
index f4e71c4f9..8f275c634 100644
--- a/demos/STM32/NIL-STM32F303-DISCOVERY/main.c
+++ b/demos/STM32/NIL-STM32F303-DISCOVERY/main.c
@@ -15,7 +15,7 @@
*/
#include "hal.h"
-#include "nil.h"
+#include "ch.h"
#include "ch_test.h"
/*