diff options
Diffstat (limited to 'lib/chibios-contrib/demos/MSP430X/NIL-EXP430FR5969/main.c')
-rw-r--r-- | lib/chibios-contrib/demos/MSP430X/NIL-EXP430FR5969/main.c | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/lib/chibios-contrib/demos/MSP430X/NIL-EXP430FR5969/main.c b/lib/chibios-contrib/demos/MSP430X/NIL-EXP430FR5969/main.c new file mode 100644 index 000000000..503bbd085 --- /dev/null +++ b/lib/chibios-contrib/demos/MSP430X/NIL-EXP430FR5969/main.c | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | #include "hal.h" | ||
18 | #include "ch.h" | ||
19 | #include "ch_test.h" | ||
20 | #include "test_root.h" | ||
21 | |||
22 | /* | ||
23 | * Thread 2. | ||
24 | */ | ||
25 | THD_WORKING_AREA(waThread2, 2048); | ||
26 | THD_FUNCTION(Thread2, arg) { | ||
27 | |||
28 | (void)arg; | ||
29 | |||
30 | /* | ||
31 | * Activate the serial driver 0 using the driver default configuration. | ||
32 | */ | ||
33 | sdStart(&SD0, NULL); | ||
34 | |||
35 | while (chnGetTimeout(&SD0, TIME_INFINITE)) { | ||
36 | chnWrite(&SD0, (const uint8_t *)"Hello World!\r\n", 14); | ||
37 | test_execute((void*)&SD0); | ||
38 | chThdSleepMilliseconds(2000); | ||
39 | } | ||
40 | } | ||
41 | |||
42 | /* | ||
43 | * Threads static table, one entry per thread. The number of entries must | ||
44 | * match NIL_CFG_NUM_THREADS. | ||
45 | */ | ||
46 | THD_TABLE_BEGIN | ||
47 | THD_TABLE_ENTRY(wa_test_support, "test_support", test_support, | ||
48 | (void *)&nil.threads[1]) | ||
49 | THD_TABLE_ENTRY(waThread2, "hello", Thread2, NULL) | ||
50 | THD_TABLE_END | ||
51 | |||
52 | /* | ||
53 | * Application entry point. | ||
54 | */ | ||
55 | int main(void) { | ||
56 | |||
57 | /* | ||
58 | * System initializations. | ||
59 | * - HAL initialization, this also initializes the configured device drivers | ||
60 | * and performs the board-specific initializations. | ||
61 | * - Kernel initialization, the main() function becomes a thread and the | ||
62 | * RTOS is active. | ||
63 | */ | ||
64 | WDTCTL = WDTPW | WDTHOLD; | ||
65 | |||
66 | |||
67 | halInit(); | ||
68 | chSysInit(); | ||
69 | |||
70 | /* This is now the idle thread loop, you may perform here a low priority | ||
71 | task but you must never try to sleep or wait in this loop. Note that | ||
72 | this tasks runs at the lowest priority level so any instruction added | ||
73 | here will be executed after all other tasks have been started.*/ | ||
74 | while (true) { | ||
75 | } | ||
76 | } | ||