forked from foldedtoad/dwm3000
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
53 lines (43 loc) · 1.56 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* Copyright (c) 2019 - Frederic Mes, RTLOC
*
* This file is part of Zephyr-DWM1001.
*
* Zephyr-DWM1001 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Zephyr-DWM1001 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Zephyr-DWM1001. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include "port.h"
#define LOG_LEVEL 3
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main);
#define STACKSIZE 1024
#define PRIORITY 99
#define DELAY_TIME K_MSEC(1000)
extern int app_main(void);
/*---------------------------------------------------------------------------*/
/* */
/*---------------------------------------------------------------------------*/
void main_thread(void * id, void * unused1, void * unused2)
{
LOG_INF("%s", __func__);
peripherals_init();
spi_peripheral_init();
k_sleep(K_MSEC(1000));
app_main();
while(1) { /* spin */}
}
K_THREAD_DEFINE(main_id, STACKSIZE, main_thread,
NULL, NULL, NULL, PRIORITY, 0, 0);