diff options
Diffstat (limited to 'lib/chibios/demos/various/RT-ARM7-GENERIC/main.c')
-rw-r--r-- | lib/chibios/demos/various/RT-ARM7-GENERIC/main.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/lib/chibios/demos/various/RT-ARM7-GENERIC/main.c b/lib/chibios/demos/various/RT-ARM7-GENERIC/main.c new file mode 100644 index 000000000..020286299 --- /dev/null +++ b/lib/chibios/demos/various/RT-ARM7-GENERIC/main.c | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2018 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 "ch.h" | ||
18 | |||
19 | /* | ||
20 | * This is a periodic thread that does absolutely nothing except sleeping. | ||
21 | */ | ||
22 | static THD_WORKING_AREA(waThread1, 128); | ||
23 | static THD_FUNCTION(Thread1, arg) { | ||
24 | |||
25 | (void)arg; | ||
26 | |||
27 | chRegSetThreadName("sleeper"); | ||
28 | |||
29 | while (true) { | ||
30 | chThdSleepMilliseconds(1000); | ||
31 | } | ||
32 | } | ||
33 | |||
34 | /* | ||
35 | * Application entry point. | ||
36 | */ | ||
37 | int main(void) { | ||
38 | |||
39 | /* | ||
40 | * System initializations. | ||
41 | * - Kernel initialization, the main() function becomes a thread and the | ||
42 | * RTOS is active. | ||
43 | */ | ||
44 | chSysInit(); | ||
45 | |||
46 | /* | ||
47 | * Creates the example thread. | ||
48 | */ | ||
49 | (void) chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); | ||
50 | |||
51 | /* | ||
52 | * Normal main() thread activity, in this demo it just sleeps. | ||
53 | */ | ||
54 | while (true) { | ||
55 | chThdSleepMilliseconds(1000); | ||
56 | } | ||
57 | } | ||