aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/NRF51
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/NRF51')
-rw-r--r--testhal/NRF51/NRF51822/ADC/Makefile6
-rw-r--r--testhal/NRF51/NRF51822/ADC/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/ADC/mcuconf.h2
-rw-r--r--testhal/NRF51/NRF51822/EXT/Makefile8
-rw-r--r--testhal/NRF51/NRF51822/EXT/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/EXT/main.c4
-rw-r--r--testhal/NRF51/NRF51822/GPT/Makefile6
-rw-r--r--testhal/NRF51/NRF51822/GPT/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/GPT/mcuconf.h4
-rw-r--r--testhal/NRF51/NRF51822/I2C/Makefile6
-rw-r--r--testhal/NRF51/NRF51822/I2C/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/I2C/main.c2
-rw-r--r--testhal/NRF51/NRF51822/I2C/mcuconf.h2
-rw-r--r--testhal/NRF51/NRF51822/PWM/Makefile8
-rw-r--r--testhal/NRF51/NRF51822/PWM/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/PWM/mcuconf.h12
-rw-r--r--testhal/NRF51/NRF51822/RNG/Makefile33
-rw-r--r--testhal/NRF51/NRF51822/RNG/chconf.h60
-rw-r--r--testhal/NRF51/NRF51822/RNG/main.c7
-rw-r--r--testhal/NRF51/NRF51822/RNG/mcuconf.h4
-rw-r--r--testhal/NRF51/NRF51822/SPI/Makefile6
-rw-r--r--testhal/NRF51/NRF51822/SPI/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/SPI/main.c4
-rw-r--r--testhal/NRF51/NRF51822/SPI/mcuconf.h2
-rw-r--r--testhal/NRF51/NRF51822/WDG/Makefile6
-rw-r--r--testhal/NRF51/NRF51822/WDG/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/WDG/main.c8
27 files changed, 115 insertions, 82 deletions
diff --git a/testhal/NRF51/NRF51822/ADC/Makefile b/testhal/NRF51/NRF51822/ADC/Makefile
index 69d6e90..9024eb1 100644
--- a/testhal/NRF51/NRF51822/ADC/Makefile
+++ b/testhal/NRF51/NRF51822/ADC/Makefile
@@ -87,7 +87,7 @@ CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_nrf51.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
-include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF51/NRF51822/platform.mk
+include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF5/NRF51822/platform.mk
include $(CHIBIOS_CONTRIB)/os/hal/boards/WVSHARE_BLE400/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional).
@@ -136,11 +136,11 @@ TCSRC =
TCPPSRC =
# List ASM source files here
-ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
+ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
- $(CHIBIOS)/os/various
+ $(CHIBIOS)/os/various $(CHIBIOS)/os/license
#
# Project, sources and paths
diff --git a/testhal/NRF51/NRF51822/ADC/chconf.h b/testhal/NRF51/NRF51822/ADC/chconf.h
index 71b3bb4..790132e 100644
--- a/testhal/NRF51/NRF51822/ADC/chconf.h
+++ b/testhal/NRF51/NRF51822/ADC/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/ADC/mcuconf.h b/testhal/NRF51/NRF51822/ADC/mcuconf.h
index 123261a..e43ff4b 100644
--- a/testhal/NRF51/NRF51822/ADC/mcuconf.h
+++ b/testhal/NRF51/NRF51822/ADC/mcuconf.h
@@ -20,6 +20,6 @@
/*
* NRF51 driver system settings.
*/
-#define NRF51_ADC_USE_ADC1 TRUE
+#define NRF5_ADC_USE_ADC1 TRUE
#endif /* _MCUCONF_H_ */
diff --git a/testhal/NRF51/NRF51822/EXT/Makefile b/testhal/NRF51/NRF51822/EXT/Makefile
index 564444d..21c415a 100644
--- a/testhal/NRF51/NRF51822/EXT/Makefile
+++ b/testhal/NRF51/NRF51822/EXT/Makefile
@@ -80,13 +80,13 @@ endif
PROJECT = ch
# Imported source files and paths
-CHIBIOS = ../../../../../ChibiOS-RT
+CHIBIOS = ../../../../../ChibiOS-RT
CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
# Startup files.
include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_nrf51.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
-include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF51/NRF51822/platform.mk
+include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF5/NRF51822/platform.mk
include $(CHIBIOS_CONTRIB)/os/hal/boards/WVSHARE_BLE400/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional).
@@ -135,11 +135,11 @@ TCSRC =
TCPPSRC =
# List ASM source files here
-ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
+ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
- $(CHIBIOS)/os/various
+ $(CHIBIOS)/os/various $(CHIBIOS)/os/license
#
# Project, sources and paths
diff --git a/testhal/NRF51/NRF51822/EXT/chconf.h b/testhal/NRF51/NRF51822/EXT/chconf.h
index 50218e4..eeb3fa3 100644
--- a/testhal/NRF51/NRF51822/EXT/chconf.h
+++ b/testhal/NRF51/NRF51822/EXT/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/EXT/main.c b/testhal/NRF51/NRF51822/EXT/main.c
index 8d24d021..f24eb5d 100644
--- a/testhal/NRF51/NRF51822/EXT/main.c
+++ b/testhal/NRF51/NRF51822/EXT/main.c
@@ -52,7 +52,7 @@ static void extcb1(EXTDriver *extp, expchannel_t channel)
if (!debouncing1 && (pad1 == PAL_LOW)) {
debouncing1 = true;
chSysLockFromISR();
- chVTSetI(&vt1, MS2ST(DEBOUNCE_TIME), led1toggle, NULL);
+ chVTSetI(&vt1, TIME_MS2I(DEBOUNCE_TIME), led1toggle, NULL);
chSysUnlockFromISR();
} else if (debouncing1 && (pad1 == PAL_HIGH)) {
chSysLockFromISR();
@@ -73,7 +73,7 @@ static void extcb2(EXTDriver *extp, expchannel_t channel)
if (!debouncing2 && (pad2 == PAL_LOW)) {
debouncing2 = true;
chSysLockFromISR();
- chVTSetI(&vt2, MS2ST(DEBOUNCE_TIME), led2toggle, NULL);
+ chVTSetI(&vt2, TIME_MS2I(DEBOUNCE_TIME), led2toggle, NULL);
chSysUnlockFromISR();
} else if (debouncing2 && (pad2 == PAL_HIGH)) {
chSysLockFromISR();
diff --git a/testhal/NRF51/NRF51822/GPT/Makefile b/testhal/NRF51/NRF51822/GPT/Makefile
index 69d6e90..9024eb1 100644
--- a/testhal/NRF51/NRF51822/GPT/Makefile
+++ b/testhal/NRF51/NRF51822/GPT/Makefile
@@ -87,7 +87,7 @@ CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_nrf51.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
-include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF51/NRF51822/platform.mk
+include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF5/NRF51822/platform.mk
include $(CHIBIOS_CONTRIB)/os/hal/boards/WVSHARE_BLE400/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional).
@@ -136,11 +136,11 @@ TCSRC =
TCPPSRC =
# List ASM source files here
-ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
+ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
- $(CHIBIOS)/os/various
+ $(CHIBIOS)/os/various $(CHIBIOS)/os/license
#
# Project, sources and paths
diff --git a/testhal/NRF51/NRF51822/GPT/chconf.h b/testhal/NRF51/NRF51822/GPT/chconf.h
index 71b3bb4..790132e 100644
--- a/testhal/NRF51/NRF51822/GPT/chconf.h
+++ b/testhal/NRF51/NRF51822/GPT/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/GPT/mcuconf.h b/testhal/NRF51/NRF51822/GPT/mcuconf.h
index 7fd549f..bef0987 100644
--- a/testhal/NRF51/NRF51822/GPT/mcuconf.h
+++ b/testhal/NRF51/NRF51822/GPT/mcuconf.h
@@ -20,7 +20,7 @@
/*
* NRF51 driver system settings.
*/
-#define NRF51_GPT_USE_TIMER1 TRUE
-#define NRF51_GPT_USE_TIMER2 TRUE
+#define NRF5_GPT_USE_TIMER1 TRUE
+#define NRF5_GPT_USE_TIMER2 TRUE
#endif /* _MCUCONF_H_ */
diff --git a/testhal/NRF51/NRF51822/I2C/Makefile b/testhal/NRF51/NRF51822/I2C/Makefile
index 29a66d7..21c415a 100644
--- a/testhal/NRF51/NRF51822/I2C/Makefile
+++ b/testhal/NRF51/NRF51822/I2C/Makefile
@@ -86,7 +86,7 @@ CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_nrf51.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
-include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF51/NRF51822/platform.mk
+include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF5/NRF51822/platform.mk
include $(CHIBIOS_CONTRIB)/os/hal/boards/WVSHARE_BLE400/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional).
@@ -135,11 +135,11 @@ TCSRC =
TCPPSRC =
# List ASM source files here
-ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
+ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
- $(CHIBIOS)/os/various
+ $(CHIBIOS)/os/various $(CHIBIOS)/os/license
#
# Project, sources and paths
diff --git a/testhal/NRF51/NRF51822/I2C/chconf.h b/testhal/NRF51/NRF51822/I2C/chconf.h
index 3d441c6..3f6766a 100644
--- a/testhal/NRF51/NRF51822/I2C/chconf.h
+++ b/testhal/NRF51/NRF51822/I2C/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/I2C/main.c b/testhal/NRF51/NRF51822/I2C/main.c
index cd038b5..7523548 100644
--- a/testhal/NRF51/NRF51822/I2C/main.c
+++ b/testhal/NRF51/NRF51822/I2C/main.c
@@ -107,7 +107,7 @@ static THD_FUNCTION(PollFakeThread, arg) {
i2cflags_t errors;
i2cAcquireBus(&I2CD1);
- status = i2cMasterReceiveTimeout(&I2CD1, I2C_FAKE_ADDR, rx_data, 2, MS2ST(4));
+ status = i2cMasterReceiveTimeout(&I2CD1, I2C_FAKE_ADDR, rx_data, 2, TIME_MS2I(4));
i2cReleaseBus(&I2CD1);
if (status == MSG_RESET){
diff --git a/testhal/NRF51/NRF51822/I2C/mcuconf.h b/testhal/NRF51/NRF51822/I2C/mcuconf.h
index e1747ec..fd238a2 100644
--- a/testhal/NRF51/NRF51822/I2C/mcuconf.h
+++ b/testhal/NRF51/NRF51822/I2C/mcuconf.h
@@ -20,6 +20,6 @@
/*
* HAL driver system settings.
*/
-#define NRF51_I2C_USE_I2C0 TRUE
+#define NRF5_I2C_USE_I2C0 TRUE
#endif /* _MCUCONF_H_ */
diff --git a/testhal/NRF51/NRF51822/PWM/Makefile b/testhal/NRF51/NRF51822/PWM/Makefile
index 6119c51..de6ba9f 100644
--- a/testhal/NRF51/NRF51822/PWM/Makefile
+++ b/testhal/NRF51/NRF51822/PWM/Makefile
@@ -86,16 +86,14 @@ endif
PROJECT = ch
# Imported source files and paths
-CHIBIOS = ../../../../ChibiOS-RT
+CHIBIOS = ../../../../../ChibiOS-RT
CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
-CHIBIOS = /home/sdalu/ChibiOS/ChibiOS
-CHIBIOS_CONTRIB = /home/sdalu/ChibiOS/ChibiOS-Contrib
# Startup files.
include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_nrf51.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
-include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF51/NRF51822/platform.mk
+include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF5/NRF51822/platform.mk
include $(CHIBIOS_CONTRIB)/os/hal/boards/WVSHARE_BLE400/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional).
@@ -149,7 +147,7 @@ ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
INCDIR = $(CHIBIOS)/os/license \
$(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) \
- $(CHIBIOS)/os/various
+ $(CHIBIOS)/os/various $(CHIBIOS)/os/license
#
# Project, sources and paths
diff --git a/testhal/NRF51/NRF51822/PWM/chconf.h b/testhal/NRF51/NRF51822/PWM/chconf.h
index a753ec9..14c1bf3 100644
--- a/testhal/NRF51/NRF51822/PWM/chconf.h
+++ b/testhal/NRF51/NRF51822/PWM/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/PWM/mcuconf.h b/testhal/NRF51/NRF51822/PWM/mcuconf.h
index 374340b..fb5b21f 100644
--- a/testhal/NRF51/NRF51822/PWM/mcuconf.h
+++ b/testhal/NRF51/NRF51822/PWM/mcuconf.h
@@ -20,11 +20,11 @@
/*
* HAL driver system settings.
*/
-#define NRF51_SERIAL_USE_UART0 TRUE
-#define NRF51_ST_USE_RTC0 TRUE
-#define NRF51_ST_USE_RTC1 FALSE
-#define NRF51_ST_USE_TIMER0 FALSE
-#define NRF51_PWM_USE_TIMER0 TRUE
-#define NRF51_PWM_USE_GPIOTE_PPI TRUE
+#define NRF5_SERIAL_USE_UART0 TRUE
+#define NRF5_ST_USE_RTC0 TRUE
+#define NRF5_ST_USE_RTC1 FALSE
+#define NRF5_ST_USE_TIMER0 FALSE
+#define NRF5_PWM_USE_TIMER0 TRUE
+#define NRF5_PWM_USE_GPIOTE_PPI TRUE
#endif /* _MCUCONF_H_ */
diff --git a/testhal/NRF51/NRF51822/RNG/Makefile b/testhal/NRF51/NRF51822/RNG/Makefile
index a42eae4..1c2acf2 100644
--- a/testhal/NRF51/NRF51822/RNG/Makefile
+++ b/testhal/NRF51/NRF51822/RNG/Makefile
@@ -81,22 +81,23 @@ endif
PROJECT = ch
# Imported source files and paths
-#CHIBIOS = ../../../../../ChibiOS-RT
-#CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
-CHIBIOS = /home/sdalu/ChibiOS/ChibiOS_16.1.2
-CHIBIOS_CONTRIB = /home/sdalu/ChibiOS/Z/ChibiOS-Contrib
+CHIBIOS = ../../../../../ChibiOS-RT
+CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
# Startup files.
-include $(CHIBIOS_CONTRIB)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_nrf51.mk
+include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_nrf51.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
-include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF51/NRF51822/platform.mk
+include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF5/NRF51822/platform.mk
include $(CHIBIOS_CONTRIB)/os/hal/boards/NRF51-DK/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional).
include $(CHIBIOS)/os/rt/rt.mk
-include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
+include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
+# Other files (optional).
+include $(CHIBIOS)/test/rt/test.mk
+include $(CHIBIOS)/os/various/shell/shell.mk
# Define linker script file here
@@ -112,7 +113,7 @@ CSRC = $(STARTUPSRC) \
$(PLATFORMSRC) \
$(BOARDSRC) \
$(TESTSRC) \
- $(CHIBIOS)/os/various/shell.c \
+ $(SHELLSRC) \
$(CHIBIOS)/os/hal/lib/streams/memstreams.c \
$(CHIBIOS)/os/hal/lib/streams/chprintf.c \
main.c
@@ -142,11 +143,15 @@ TCSRC =
TCPPSRC =
# List ASM source files here
-ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
+ASMSRC =
+ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
-INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
+INCDIR = $(CHIBIOS)/os/license \
+ $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
- $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various
+ $(SHELLINC) \
+ $(CHIBIOS)/os/hal/lib/streams \
+ $(CHIBIOS)/os/various
#
# Project, sources and paths
@@ -213,7 +218,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
@@ -223,8 +228,8 @@ JLINK_PRE_FLASH = w4 4001e504 1
JLINK_ERASE_ALL = w4 4001e504 2\nw4 4001e50c 1\nsleep 100
-include /home/sdalu/ChibiOS/W/ChibiOS-Contrib/os/various/jlink.mk
-include /home/sdalu/ChibiOS/W/ChibiOS-Contrib/os/various/gdb.mk
+include $(CHIBIOS_CONTRIB)/os/various/jlink.mk
+include $(CHIBIOS_CONTRIB)/os/various/gdb.mk
flash: all jlink-flash
debug: gdb-debug
diff --git a/testhal/NRF51/NRF51822/RNG/chconf.h b/testhal/NRF51/NRF51822/RNG/chconf.h
index 20d7b4b..ed43625 100644
--- a/testhal/NRF51/NRF51822/RNG/chconf.h
+++ b/testhal/NRF51/NRF51822/RNG/chconf.h
@@ -25,8 +25,11 @@
* @{
*/
-#ifndef _CHCONF_H_
-#define _CHCONF_H_
+#ifndef CHCONF_H
+#define CHCONF_H
+
+#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
@@ -263,14 +266,6 @@
#define CH_CFG_USE_MAILBOXES TRUE
/**
- * @brief I/O Queues APIs.
- * @details If enabled then the I/O queues APIs are included in the kernel.
- *
- * @note The default is @p TRUE.
- */
-#define CH_CFG_USE_QUEUES TRUE
-
-/**
* @brief Core Memory Manager APIs.
* @details If enabled then the core memory manager APIs are included
* in the kernel.
@@ -357,12 +352,18 @@
/**
* @brief Debug option, trace buffer.
- * @details If enabled then the context switch circular trace buffer is
- * activated.
+ * @details If enabled then the trace buffer is activated.
*
- * @note The default is @p FALSE.
+ * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
+ */
+#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_ALL
+
+/**
+ * @brief Trace buffer entries.
+ * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
+ * different from @p CH_DBG_TRACE_MASK_DISABLED.
*/
-#define CH_DBG_ENABLE_TRACE TRUE
+#define CH_DBG_TRACE_BUFFER_SIZE 128
/**
* @brief Debug option, stack checks.
@@ -427,10 +428,6 @@
/**
* @brief Threads finalization hook.
* @details User finalization code added to the @p chThdExit() API.
- *
- * @note It is inserted into lock zone.
- * @note It is also invoked when the threads simply return in order to
- * terminate.
*/
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
/* Add threads finalization code here.*/ \
@@ -445,12 +442,27 @@
}
/**
+ * @brief ISR enter hook.
+ */
+#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
+ /* IRQ prologue code here.*/ \
+}
+
+/**
+ * @brief ISR exit hook.
+ */
+#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
+ /* IRQ epilogue code here.*/ \
+}
+
+/**
* @brief Idle thread enter hook.
* @note This hook is invoked within a critical zone, no OS functions
* should be invoked from here.
* @note This macro can be used to activate a power saving mode.
*/
#define CH_CFG_IDLE_ENTER_HOOK() { \
+ /* Idle-enter code here.*/ \
}
/**
@@ -460,6 +472,7 @@
* @note This macro can be used to deactivate a power saving mode.
*/
#define CH_CFG_IDLE_LEAVE_HOOK() { \
+ /* Idle-leave code here.*/ \
}
/**
@@ -488,12 +501,21 @@
/* System halt code here.*/ \
}
+/**
+ * @brief Trace hook.
+ * @details This hook is invoked each time a new record is written in the
+ * trace buffer.
+ */
+#define CH_CFG_TRACE_HOOK(tep) { \
+ /* Trace code here.*/ \
+}
+
/** @} */
/*===========================================================================*/
/* Port-specific settings (override port settings defaulted in chcore.h). */
/*===========================================================================*/
-#endif /* _CHCONF_H_ */
+#endif /* CHCONF_H */
/** @} */
diff --git a/testhal/NRF51/NRF51822/RNG/main.c b/testhal/NRF51/NRF51822/RNG/main.c
index b9572b8..6542d42 100644
--- a/testhal/NRF51/NRF51822/RNG/main.c
+++ b/testhal/NRF51/NRF51822/RNG/main.c
@@ -48,7 +48,7 @@ static void cmd_random(BaseSequentialStream *chp, int argc, char *argv[]) {
for (i = 0 ; i < size ; i++) {
chprintf(chp, "%02x ", random_buffer[i]);
- if (nl = (((i+1) % 20) == 0))
+ if ((nl = (((i+1) % 20)) == 0))
chprintf(chp, "\r\n");
}
if (!nl)
@@ -60,7 +60,7 @@ static void cmd_random(BaseSequentialStream *chp, int argc, char *argv[]) {
/*
* Shell
*/
-#define SHELL_WA_SIZE THD_WORKING_AREA_SIZE(2048)
+static THD_WORKING_AREA(shell_wa, 1024);
static const ShellCommand commands[] = {
{"random", cmd_random},
@@ -105,7 +105,8 @@ int main(void) {
* Shell manager initialization.
*/
shellInit();
- shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
+ chThdCreateStatic(shell_wa, sizeof(shell_wa), NORMALPRIO,
+ shellThread, (void *)&shell_cfg1);
/*
diff --git a/testhal/NRF51/NRF51822/RNG/mcuconf.h b/testhal/NRF51/NRF51822/RNG/mcuconf.h
index 7977f4b..dfde5a9 100644
--- a/testhal/NRF51/NRF51822/RNG/mcuconf.h
+++ b/testhal/NRF51/NRF51822/RNG/mcuconf.h
@@ -17,8 +17,8 @@
#ifndef _MCUCONF_H_
#define _MCUCONF_H_
-#define NRF51_RNG_USE_RNG1 TRUE
-#define NRF51_SERIAL_USE_UART0 TRUE
+#define NRF5_RNG_USE_RNG0 TRUE
+#define NRF5_SERIAL_USE_UART0 TRUE
#endif /* _MCUCONF_H_ */
diff --git a/testhal/NRF51/NRF51822/SPI/Makefile b/testhal/NRF51/NRF51822/SPI/Makefile
index 92070b1..b04500e 100644
--- a/testhal/NRF51/NRF51822/SPI/Makefile
+++ b/testhal/NRF51/NRF51822/SPI/Makefile
@@ -86,7 +86,7 @@ CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_nrf51.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
-include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF51/NRF51822/platform.mk
+include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF5/NRF51822/platform.mk
include $(CHIBIOS_CONTRIB)/os/hal/boards/WVSHARE_BLE400/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional).
@@ -135,11 +135,11 @@ TCSRC =
TCPPSRC =
# List ASM source files here
-ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
+ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
- $(CHIBIOS)/os/various
+ $(CHIBIOS)/os/various $(CHIBIOS)/os/license
#
# Project, sources and paths
diff --git a/testhal/NRF51/NRF51822/SPI/chconf.h b/testhal/NRF51/NRF51822/SPI/chconf.h
index f777f9d..49a050a 100644
--- a/testhal/NRF51/NRF51822/SPI/chconf.h
+++ b/testhal/NRF51/NRF51822/SPI/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/SPI/main.c b/testhal/NRF51/NRF51822/SPI/main.c
index 8d9c089..d53de25 100644
--- a/testhal/NRF51/NRF51822/SPI/main.c
+++ b/testhal/NRF51/NRF51822/SPI/main.c
@@ -23,7 +23,7 @@
static const SPIConfig hs_spicfg = {
.end_cb=NULL,
- .freq=NRF51_SPI_FREQ_1MBPS,
+ .freq=NRF5_SPI_FREQ_1MBPS,
.sckpad=SPI_SCK,
.mosipad=SPI_MOSI,
.misopad=SPI_MISO,
@@ -34,7 +34,7 @@ static const SPIConfig hs_spicfg = {
static const SPIConfig ls_spicfg = {
.end_cb=NULL,
- .freq=NRF51_SPI_FREQ_250KBPS,
+ .freq=NRF5_SPI_FREQ_250KBPS,
.sckpad=SPI_SCK,
.mosipad=SPI_MOSI,
.misopad=SPI_MISO,
diff --git a/testhal/NRF51/NRF51822/SPI/mcuconf.h b/testhal/NRF51/NRF51822/SPI/mcuconf.h
index 64d0639..7567d24 100644
--- a/testhal/NRF51/NRF51822/SPI/mcuconf.h
+++ b/testhal/NRF51/NRF51822/SPI/mcuconf.h
@@ -20,6 +20,6 @@
/*
* HAL driver system settings.
*/
-#define NRF51_SPI_USE_SPI0 TRUE
+#define NRF5_SPI_USE_SPI0 TRUE
#endif /* _MCUCONF_H_ */
diff --git a/testhal/NRF51/NRF51822/WDG/Makefile b/testhal/NRF51/NRF51822/WDG/Makefile
index c316b35..caa8b18 100644
--- a/testhal/NRF51/NRF51822/WDG/Makefile
+++ b/testhal/NRF51/NRF51822/WDG/Makefile
@@ -87,7 +87,7 @@ CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_nrf51.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
-include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF51/NRF51822/platform.mk
+include $(CHIBIOS_CONTRIB)/os/hal/ports/NRF5/NRF51822/platform.mk
include $(CHIBIOS_CONTRIB)/os/hal/boards/NRF51-DK/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional).
@@ -134,11 +134,11 @@ TCSRC =
TCPPSRC =
# List ASM source files here
-ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
+ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
- $(CHIBIOS)/os/various
+ $(CHIBIOS)/os/various $(CHIBIOS)/os/license
#
# Project, sources and paths
diff --git a/testhal/NRF51/NRF51822/WDG/chconf.h b/testhal/NRF51/NRF51822/WDG/chconf.h
index 4477bd5..9952575 100644
--- a/testhal/NRF51/NRF51822/WDG/chconf.h
+++ b/testhal/NRF51/NRF51822/WDG/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/WDG/main.c b/testhal/NRF51/NRF51822/WDG/main.c
index cdbf89b..92942b9 100644
--- a/testhal/NRF51/NRF51822/WDG/main.c
+++ b/testhal/NRF51/NRF51822/WDG/main.c
@@ -40,10 +40,10 @@ int main(void) {
palSetPad(IOPORT1, LED1);
WDGConfig WDG_config = {
- .flags.pause_on_sleep = 0,
- .flags.pause_on_halt = 0,
- .timeout_ms = 5000,
- .callback = timeout_callback
+ .pause_on_sleep = 0,
+ .pause_on_halt = 0,
+ .timeout_ms = 5000,
+ .callback = timeout_callback
};
wdgStart(&WDGD1, &WDG_config);