diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-09-04 10:26:42 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-09-04 10:26:42 +0000 |
commit | a923a46007f6ae63deac2183319ba064e7b2921c (patch) | |
tree | 754144a11546db58a8b28720a44fc4914b1d2548 /demos/nil/NIL-STM32F051-DISCOVERY/main.c | |
parent | 66d1c88211653eff42b6c76c8c207d43179630e8 (diff) | |
download | ChibiOS-a923a46007f6ae63deac2183319ba064e7b2921c.tar.gz ChibiOS-a923a46007f6ae63deac2183319ba064e7b2921c.tar.bz2 ChibiOS-a923a46007f6ae63deac2183319ba064e7b2921c.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6259 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/nil/NIL-STM32F051-DISCOVERY/main.c')
-rw-r--r-- | demos/nil/NIL-STM32F051-DISCOVERY/main.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/demos/nil/NIL-STM32F051-DISCOVERY/main.c b/demos/nil/NIL-STM32F051-DISCOVERY/main.c index d92c94b35..60eab1fd1 100644 --- a/demos/nil/NIL-STM32F051-DISCOVERY/main.c +++ b/demos/nil/NIL-STM32F051-DISCOVERY/main.c @@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "hal.h"
#include "nil.h"
/*
@@ -28,9 +29,9 @@ THD_FUNCTION(Thread1, arg) { (void)arg;
while (true) {
-// gpioSetPad(GPIOC, GPIOC_LED4);
+ palSetPad(GPIOC, GPIOC_LED4);
chThdSleepMilliseconds(500);
-// gpioClearPad(GPIOC, GPIOC_LED4);
+ palSetPad(GPIOC, GPIOC_LED4);
chThdSleepMilliseconds(500);
}
}
@@ -44,9 +45,9 @@ THD_FUNCTION(Thread2, arg) { (void)arg;
while (true) {
-// gpioSetPad(GPIOC, GPIOC_LED3);
+ palSetPad(GPIOC, GPIOC_LED3);
chThdSleepMilliseconds(250);
-// gpioClearPad(GPIOC, GPIOC_LED3);
+ palSetPad(GPIOC, GPIOC_LED3);
chThdSleepMilliseconds(250);
}
}
@@ -66,15 +67,19 @@ THD_TABLE_END int main(void) {
/*
- * System initializations:
- * - HW specific initialization.
- * - Nil RTOS 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.
*/
-// hwInit();
+ halInit();
chSysInit();
/* This is now the idle thread loop, you may perform here a low priority
- task but you must never try to sleep or wait in this loop.*/
+ task but you must never try to sleep or wait in this loop. Note that
+ this tasks runs at the lowest priority level so any instruction added
+ here will be executed after all other tasks have been started.*/
while (true) {
}
}
|