aboutsummaryrefslogtreecommitdiffstats
path: root/demos/various/NIL-ARMCM0-GENERIC
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/various/NIL-ARMCM0-GENERIC
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/various/NIL-ARMCM0-GENERIC')
-rw-r--r--demos/various/NIL-ARMCM0-GENERIC/Makefile11
-rw-r--r--demos/various/NIL-ARMCM0-GENERIC/chconf.h (renamed from demos/various/NIL-ARMCM0-GENERIC/nilconf.h)135
-rw-r--r--demos/various/NIL-ARMCM0-GENERIC/main.c4
3 files changed, 125 insertions, 25 deletions
diff --git a/demos/various/NIL-ARMCM0-GENERIC/Makefile b/demos/various/NIL-ARMCM0-GENERIC/Makefile
index de47bb7c3..93e973860 100644
--- a/demos/various/NIL-ARMCM0-GENERIC/Makefile
+++ b/demos/various/NIL-ARMCM0-GENERIC/Makefile
@@ -69,6 +69,11 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
USE_EXCEPTIONS_STACKSIZE = 0x400
endif
+# Enables the use of FPU (no, softfp, hard).
+ifeq ($(USE_FPU),)
+ USE_FPU = no
+endif
+
#
# Architecture or project specific options
##############################################################################
@@ -83,7 +88,7 @@ PROJECT = ch
# Imported source files and paths
CHIBIOS = ../../..
# Startup files.
-include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk
+include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk
# HAL-OSAL files (optional).
#include $(CHIBIOS)/os/hal/hal.mk
#include $(CHIBIOS)/os/hal/ports/STM32/STM32F0xx/platform.mk
@@ -91,7 +96,7 @@ include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.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_v6m.mk
+include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/port_v6m.mk
# Other files (optional).
#include $(CHIBIOS)/test/nil/test.mk
@@ -207,7 +212,7 @@ 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/various/NIL-ARMCM0-GENERIC/nilconf.h b/demos/various/NIL-ARMCM0-GENERIC/chconf.h
index 27b6bac60..aa27df6e2 100644
--- a/demos/various/NIL-ARMCM0-GENERIC/nilconf.h
+++ b/demos/various/NIL-ARMCM0-GENERIC/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 2
+#define CH_CFG_NUM_THREADS 2
/** @} */
@@ -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 1000
+#define CH_CFG_ST_FREQUENCY 1000
/**
* @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 0
+#define CH_CFG_ST_TIMEDELTA 0
/** @} */
@@ -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/various/NIL-ARMCM0-GENERIC/main.c b/demos/various/NIL-ARMCM0-GENERIC/main.c
index 023db0b8c..8ff3c7295 100644
--- a/demos/various/NIL-ARMCM0-GENERIC/main.c
+++ b/demos/various/NIL-ARMCM0-GENERIC/main.c
@@ -14,7 +14,7 @@
limitations under the License.
*/
-#include "nil.h"
+#include "ch.h"
#if !defined(SYSTEM_CLOCK)
#define SYSTEM_CLOCK 8000000U
@@ -83,7 +83,7 @@ int main(void) {
* Hardware initialization, in this simple demo just the systick timer is
* initialized.
*/
- SysTick->LOAD = SYSTEM_CLOCK / NIL_CFG_ST_FREQUENCY - (systime_t)1;
+ SysTick->LOAD = SYSTEM_CLOCK / CH_CFG_ST_FREQUENCY - (systime_t)1;
SysTick->VAL = (uint32_t)0;
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk |
SysTick_CTRL_ENABLE_Msk;