aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/demos/STM32/RT-STM32L476-DISCOVERY-SB_CLIENT2/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/demos/STM32/RT-STM32L476-DISCOVERY-SB_CLIENT2/main.c')
-rw-r--r--lib/chibios/demos/STM32/RT-STM32L476-DISCOVERY-SB_CLIENT2/main.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/lib/chibios/demos/STM32/RT-STM32L476-DISCOVERY-SB_CLIENT2/main.c b/lib/chibios/demos/STM32/RT-STM32L476-DISCOVERY-SB_CLIENT2/main.c
new file mode 100644
index 000000000..28f417ce1
--- /dev/null
+++ b/lib/chibios/demos/STM32/RT-STM32L476-DISCOVERY-SB_CLIENT2/main.c
@@ -0,0 +1,50 @@
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 <stdint.h>
18#include <stdbool.h>
19#include <stddef.h>
20#include <stdio.h>
21
22#include "sbuser.h"
23
24/*
25 * Application entry point.
26 */
27int main(void) {
28
29 /* API layer initialization.*/
30 sbApiInit();
31
32 /*
33 * Normal main() activity, in this demo it does nothing except
34 * sleeping in a loop.
35 */
36#if 0
37 /* Test for exception on interrupt.*/
38 asm volatile ("mov r0, #64");
39 asm volatile ("mov sp, r0");
40 while (true) {
41 }
42#endif
43 while (true) {
44 msg_t msg = sbMsgWait();
45 printf("#2 Hello World (%u)!!\r\n", (unsigned)msg);
46// sbFileWrite(1U, (const uint8_t *)"#2 Hello World!!\r\n", 15U);
47 sbMsgReply(msg);
48// sbSleepMilliseconds(500);
49 }
50}