tutorial: dummy subsystem
This commit is contained in:
parent
c665b64966
commit
6772c7bfc8
|
@ -0,0 +1,28 @@
|
||||||
|
.DS_Store
|
||||||
|
.idea
|
||||||
|
thumbs.db
|
||||||
|
*.zip
|
||||||
|
*.pyc
|
||||||
|
*_pb2.py
|
||||||
|
*.bak
|
||||||
|
*.hex
|
||||||
|
*.[oa]
|
||||||
|
*.pb.go
|
||||||
|
.vscode/ipch/**
|
||||||
|
!.gitkeep
|
||||||
|
|
||||||
|
_build
|
||||||
|
build
|
||||||
|
|
||||||
|
artifacts
|
||||||
|
doc/**
|
||||||
|
.unison*
|
||||||
|
node_modules
|
||||||
|
go.sum
|
||||||
|
**/_build
|
||||||
|
**/parking
|
||||||
|
|
||||||
|
test/**/build/
|
||||||
|
# test/unittest/generated
|
||||||
|
|
||||||
|
compile_commands.json
|
|
@ -0,0 +1,25 @@
|
||||||
|
cmake_minimum_required(VERSION 3.18)
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
project(
|
||||||
|
Dummy
|
||||||
|
VERSION 0.1
|
||||||
|
DESCRIPTION "Dummy - A dummy library"
|
||||||
|
LANGUAGES C
|
||||||
|
)
|
||||||
|
|
||||||
|
set_property(
|
||||||
|
TARGET ${PROJECT}
|
||||||
|
PROPERTY C_STANDARD 11
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(
|
||||||
|
${PROJECT_NAME}
|
||||||
|
src/dummy.c
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(
|
||||||
|
${PROJECT_NAME}
|
||||||
|
PUBLIC
|
||||||
|
include
|
||||||
|
)
|
|
@ -0,0 +1,19 @@
|
||||||
|
/**
|
||||||
|
* \file dummy.h
|
||||||
|
*
|
||||||
|
* \brief A dummy subsystem.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uint8_t dummy_random(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -0,0 +1,10 @@
|
||||||
|
/**
|
||||||
|
* \file dummy.c
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "dummy/dummy.h"
|
||||||
|
|
||||||
|
uint8_t dummy_random(void)
|
||||||
|
{
|
||||||
|
return 4U; // determined by fair dice roll.
|
||||||
|
}
|
Loading…
Reference in New Issue