Add inital src and cmake
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -86,3 +86,6 @@ dkms.conf
|
|||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
|
# Build and output
|
||||||
|
_build
|
||||||
|
build
|
||||||
|
|||||||
7
CMakeLists.txt
Normal file
7
CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.20.0)
|
||||||
|
|
||||||
|
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||||
|
|
||||||
|
project(timer_fw)
|
||||||
|
|
||||||
|
target_sources(app PRIVATE src/main.c)
|
||||||
6
prj.conf
Normal file
6
prj.conf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
CONFIG_GPIO=y
|
||||||
|
CONFIG_SERIAL=y
|
||||||
|
CONFIG_CONSOLE=y
|
||||||
|
CONFIG_UART_CONSOLE=y
|
||||||
|
CONFIG_LOG=y
|
||||||
|
CONFIG_LOG_DEFAULT_LEVEL=3
|
||||||
16
src/main.c
Normal file
16
src/main.c
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#include <zephyr/kernel.h>
|
||||||
|
#include <zephyr/logging/log.h>
|
||||||
|
|
||||||
|
LOG_MODULE_REGISTER(timer_fw, LOG_LEVEL_INF);
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
LOG_INF("Timer firmware booted!");
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
LOG_INF("heartbeat");
|
||||||
|
k_sleep(K_SECONDS(5));
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user