aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--boards/simulator/board.c38
-rw-r--r--boards/simulator/board.h (renamed from demos/Win32-MinGW/board.h)10
-rw-r--r--boards/simulator/board.mk5
-rw-r--r--demos/Win32-MinGW/Makefile5
-rw-r--r--demos/Win32-MinGW/main.c10
-rw-r--r--os/hal/platforms/Posix/hal_lld.c11
-rw-r--r--os/hal/platforms/Win32/hal_lld.c11
-rw-r--r--readme.txt3
8 files changed, 64 insertions, 29 deletions
diff --git a/boards/simulator/board.c b/boards/simulator/board.c
new file mode 100644
index 000000000..8f655ccd1
--- /dev/null
+++ b/boards/simulator/board.c
@@ -0,0 +1,38 @@
+/*
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+
+ This file is part of ChibiOS/RT.
+
+ ChibiOS/RT is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS/RT is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "ch.h"
+#include "hal.h"
+
+/**
+ * @brief PAL setup.
+ * @details Digital I/O ports static configuration as defined in @p board.h.
+ */
+#if HAL_USE_PAL || defined(__DOXYGEN__)
+const PALConfig pal_default_config = {
+ {0, 0, 0},
+ {0, 0, 0}
+};
+#endif
+
+/*
+ * Board-specific initialization code.
+ */
+void boardInit(void) {
+}
diff --git a/demos/Win32-MinGW/board.h b/boards/simulator/board.h
index 7b89d92d0..1b0513d1d 100644
--- a/demos/Win32-MinGW/board.h
+++ b/boards/simulator/board.h
@@ -20,4 +20,14 @@
#ifndef _BOARD_H_
#define _BOARD_H_
+#if !defined(_FROM_ASM_)
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void boardInit(void);
+#ifdef __cplusplus
+}
+#endif
+#endif /* _FROM_ASM_ */
+
#endif /* _BOARD_H_ */
diff --git a/boards/simulator/board.mk b/boards/simulator/board.mk
new file mode 100644
index 000000000..a48747c66
--- /dev/null
+++ b/boards/simulator/board.mk
@@ -0,0 +1,5 @@
+# List of all the simulator board related files.
+BOARDSRC = ${CHIBIOS}/boards/simulator/board.c
+
+# Required include directories
+BOARDINC = ${CHIBIOS}/boards/simulator
diff --git a/demos/Win32-MinGW/Makefile b/demos/Win32-MinGW/Makefile
index c1a452297..652c60b44 100644
--- a/demos/Win32-MinGW/Makefile
+++ b/demos/Win32-MinGW/Makefile
@@ -57,6 +57,7 @@ UADEFS =
# Imported source files
CHIBIOS = ../..
+include $(CHIBIOS)/boards/simulator/board.mk
include ${CHIBIOS}/os/hal/hal.mk
include ${CHIBIOS}/os/hal/platforms/Win32/platform.mk
include ${CHIBIOS}/os/ports/GCC/SIMIA32/port.mk
@@ -69,6 +70,7 @@ SRC = ${PORTSRC} \
${TESTSRC} \
${HALSRC} \
${PLATFORMSRC} \
+ $(BOARDSRC) \
${CHIBIOS}/os/various/shell.c \
main.c
@@ -76,7 +78,8 @@ SRC = ${PORTSRC} \
ASRC =
# List all user directories here
-UINCDIR = $(PORTINC) $(KERNINC) $(TESTINC) $(HALINC) $(PLATFORMINC) \
+UINCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
+ $(HALINC) $(PLATFORMINC) $(BOARDINC) \
${CHIBIOS}/os/various
# List the user directory to look for the libraries here
diff --git a/demos/Win32-MinGW/main.c b/demos/Win32-MinGW/main.c
index aa6d29716..9ce9b284a 100644
--- a/demos/Win32-MinGW/main.c
+++ b/demos/Win32-MinGW/main.c
@@ -220,13 +220,13 @@ int main(void) {
EventListener sd1fel, sd2fel, tel;
/*
- * HAL initialization.
+ * System initializations.
+ * - HAL initialization, this also initializes the configured device drivers
+ * and performs the board-specific initializations.
+ * - Kernel initialization, the main() function becomes a thread and the
+ * RTOS is active.
*/
halInit();
-
- /*
- * ChibiOS/RT initialization.
- */
chSysInit();
/*
diff --git a/os/hal/platforms/Posix/hal_lld.c b/os/hal/platforms/Posix/hal_lld.c
index dfc4702ca..6f1433586 100644
--- a/os/hal/platforms/Posix/hal_lld.c
+++ b/os/hal/platforms/Posix/hal_lld.c
@@ -43,17 +43,6 @@
static struct timeval nextcnt;
static struct timeval tick = {0, 1000000 / CH_FREQUENCY};
-/**
- * @brief PAL setup.
- * @details Digital I/O ports static configuration as defined in @p board.h.
- */
-#if HAL_USE_PAL || defined(__DOXYGEN__)
-const PALConfig pal_default_config = {
- {0, 0, 0},
- {0, 0, 0}
-};
-#endif
-
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
diff --git a/os/hal/platforms/Win32/hal_lld.c b/os/hal/platforms/Win32/hal_lld.c
index 51781b94c..a03d91998 100644
--- a/os/hal/platforms/Win32/hal_lld.c
+++ b/os/hal/platforms/Win32/hal_lld.c
@@ -38,17 +38,6 @@
static LARGE_INTEGER nextcnt;
static LARGE_INTEGER slice;
-/**
- * @brief PAL setup.
- * @details Digital I/O ports static configuration as defined in @p board.h.
- */
-#if HAL_USE_PAL || defined(__DOXYGEN__)
-const PALConfig pal_default_config = {
- {0, 0, 0},
- {0, 0, 0}
-};
-#endif
-
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
diff --git a/readme.txt b/readme.txt
index a3d58dc0b..432368ad1 100644
--- a/readme.txt
+++ b/readme.txt
@@ -66,7 +66,8 @@
*** 2.1.6 ***
- FIX: Fixed error in sdPutTimeout() macro (bug 3138763)(backported in 2.0.9).
-- NEW: New ARM Cortex-Mx port for IAR compiler.
+- NEW: New ARM Cortex-Mx port for IAR compiler (probably will not be
+ included in 2.2.0, requires more testing).
- NEW: Now the STM32 CAN driver puts the lower half word of the ESR
register in the upper half word of the can status word for easier
debug.