aboutsummaryrefslogtreecommitdiffstats
path: root/demos/nil
diff options
context:
space:
mode:
Diffstat (limited to 'demos/nil')
-rw-r--r--demos/nil/NIL-STM32F051-DISCOVERY/Makefile2
-rw-r--r--demos/nil/NIL-STM32F051-DISCOVERY/main.c19
-rw-r--r--demos/nil/NIL-STM32F051-DISCOVERY/nilconf.h4
3 files changed, 12 insertions, 13 deletions
diff --git a/demos/nil/NIL-STM32F051-DISCOVERY/Makefile b/demos/nil/NIL-STM32F051-DISCOVERY/Makefile
index 47e3d2f8c..efa0f7d96 100644
--- a/demos/nil/NIL-STM32F051-DISCOVERY/Makefile
+++ b/demos/nil/NIL-STM32F051-DISCOVERY/Makefile
@@ -64,7 +64,7 @@ CHIBIOS = ../../..
#include $(CHIBIOS)/os/hal/ports/STM32F0xx/platform.mk
include $(CHIBIOS)/os/nil/nil.mk
#include $(CHIBIOS)/os/rt/osal/osal.mk
-include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f0xx.mk
+include $(CHIBIOS)/os/nil/ports/ARMCMx/compilers/GCC/mk/port_stm32f0xx.mk
#include $(CHIBIOS)/test/test.mk
# Define linker script file here
diff --git a/demos/nil/NIL-STM32F051-DISCOVERY/main.c b/demos/nil/NIL-STM32F051-DISCOVERY/main.c
index 5fcf9da8c..f601b10a4 100644
--- a/demos/nil/NIL-STM32F051-DISCOVERY/main.c
+++ b/demos/nil/NIL-STM32F051-DISCOVERY/main.c
@@ -18,20 +18,19 @@
*/
#include "nil.h"
-#include "hwinit.h"
/*
* Thread 1.
*/
-NIL_WORKING_AREA(waThread1, 128);
-NIL_THREAD(Thread1, arg) {
+THD_WORKING_AREA(waThread1, 128);
+THD_FUNCTION(Thread1, arg) {
(void)arg;
while (true) {
- gpioSetPad(GPIOC, GPIOC_LED4);
+// gpioSetPad(GPIOC, GPIOC_LED4);
nilThdSleepMilliseconds(500);
- gpioClearPad(GPIOC, GPIOC_LED4);
+// gpioClearPad(GPIOC, GPIOC_LED4);
nilThdSleepMilliseconds(500);
}
}
@@ -39,15 +38,15 @@ NIL_THREAD(Thread1, arg) {
/*
* Thread 2.
*/
-NIL_WORKING_AREA(waThread2, 128);
-NIL_THREAD(Thread2, arg) {
+THD_WORKING_AREA(waThread2, 128);
+THD_FUNCTION(Thread2, arg) {
(void)arg;
while (true) {
- gpioSetPad(GPIOC, GPIOC_LED3);
+// gpioSetPad(GPIOC, GPIOC_LED3);
nilThdSleepMilliseconds(250);
- gpioClearPad(GPIOC, GPIOC_LED3);
+// gpioClearPad(GPIOC, GPIOC_LED3);
nilThdSleepMilliseconds(250);
}
}
@@ -71,7 +70,7 @@ int main(void) {
* - HW specific initialization.
* - Nil RTOS initialization.
*/
- hwInit();
+// hwInit();
nilSysInit();
/* This is now the idle thread loop, you may perform here a low priority
diff --git a/demos/nil/NIL-STM32F051-DISCOVERY/nilconf.h b/demos/nil/NIL-STM32F051-DISCOVERY/nilconf.h
index d6d73fad8..30016395f 100644
--- a/demos/nil/NIL-STM32F051-DISCOVERY/nilconf.h
+++ b/demos/nil/NIL-STM32F051-DISCOVERY/nilconf.h
@@ -41,7 +41,7 @@
/**
* @brief System tick frequency.
*/
-#define NIL_CFG_FREQUENCY 50000
+#define NIL_CFG_FREQUENCY 1000
/**
* @brief Time delta constant for the tick-less mode.
@@ -51,7 +51,7 @@
* The value one is not valid, timeouts are rounded up to
* this value.
*/
-#define NIL_CFG_TIMEDELTA 2
+#define NIL_CFG_TIMEDELTA 0
/**
* @brief System assertions.