aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/kernel/include/ch.h13
-rw-r--r--os/kernel/include/chsys.h3
-rw-r--r--os/kernel/src/chsys.c6
-rw-r--r--testhal/STM32/SPI/main.c9
4 files changed, 27 insertions, 4 deletions
diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h
index 6f783c00c..3641c826f 100644
--- a/os/kernel/include/ch.h
+++ b/os/kernel/include/ch.h
@@ -88,8 +88,21 @@
#include "chqueues.h"
#include "chstreams.h"
#include "chioch.h"
+#include "chfiles.h"
#include "chdebug.h"
+#if !defined(__DOXYGEN__)
+extern WORKING_AREA(_idle_thread_wa, IDLE_THREAD_STACK_SIZE);
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void _idle_thread(void *p);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _CH_H_ */
/** @} */
diff --git a/os/kernel/include/chsys.h b/os/kernel/include/chsys.h
index ae013d7c7..2f94c5209 100644
--- a/os/kernel/include/chsys.h
+++ b/os/kernel/include/chsys.h
@@ -178,12 +178,9 @@
*/
#define CH_FAST_IRQ_HANDLER(id) PORT_FAST_IRQ_HANDLER(id)
-extern WORKING_AREA(_idle_thread_wa, IDLE_THREAD_STACK_SIZE);
-
#ifdef __cplusplus
extern "C" {
#endif
- void _idle_thread(void *p);
void chSysInit(void);
void chSysTimerHandlerI(void);
#if CH_USE_NESTED_LOCKS && !CH_OPTIMIZE_SPEED
diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c
index 80d037dd6..d34e7e73a 100644
--- a/os/kernel/src/chsys.c
+++ b/os/kernel/src/chsys.c
@@ -34,6 +34,10 @@
#include "ch.h"
+/**
+ * @brief Idle thread working area.
+ * @see IDLE_THREAD_STACK_SIZE
+ */
WORKING_AREA(_idle_thread_wa, IDLE_THREAD_STACK_SIZE);
/**
@@ -87,7 +91,7 @@ void chSysInit(void) {
/* This thread has the lowest priority in the system, its role is just to
serve interrupts in its context while keeping the lowest energy saving
mode compatible with the system status.*/
- chThdCreateStatic(idle_thread_wa, sizeof(_idle_thread_wa), IDLEPRIO,
+ chThdCreateStatic(_idle_thread_wa, sizeof(_idle_thread_wa), IDLEPRIO,
(tfunc_t)_idle_thread, NULL);
}
diff --git a/testhal/STM32/SPI/main.c b/testhal/STM32/SPI/main.c
index 1ebf1b45e..a8a8595f1 100644
--- a/testhal/STM32/SPI/main.c
+++ b/testhal/STM32/SPI/main.c
@@ -95,6 +95,15 @@ int main(int argc, char **argv) {
(void)argv;
/*
+ * SPI1 I/O pins setup.
+ */
+ palSetPadMode(IOPORT1, 5, PAL_MODE_STM32_ALTERNATE_PUSHPULL); /* SCK. */
+ palSetPadMode(IOPORT1, 6, PAL_MODE_STM32_ALTERNATE_PUSHPULL); /* MISO.*/
+ palSetPadMode(IOPORT1, 7, PAL_MODE_STM32_ALTERNATE_PUSHPULL); /* MOSI.*/
+ palSetPadMode(IOPORT1, GPIOA_SPI1NSS, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPad(IOPORT1, GPIOA_SPI1NSS);
+
+ /*
* Prepare transmit pattern.
*/
for (i = 0; i < sizeof(txbuf); i++)