Skip to content

Commit 539b0fe

Browse files
committedJan 16, 2019
Improve CMake build support
1 parent 006b3d2 commit 539b0fe

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed
 

‎CMakeLists.txt

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1+
set(COMPONENT_SRCS
2+
"src/I2Cbus.cpp")
13
set(COMPONENT_ADD_INCLUDEDIRS "include")
2-
file(GLOB COMPONENT_SRCS src/*.cc src/*.cpp src/*.c)
3-
44
set(COMPONENT_REQUIRES
55
driver
66
)
77

8-
set(COMPONENT_PRIV_REQUIRES)
9-
108
register_component()
119

12-
add_definitions(-DI2CBUS_COMPONENT_TRUE=1)
10+
component_compile_options(PUBLIC "-DI2CBUS_COMPONENT_TRUE=1")

‎Kconfig.projbuild

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
menu "I2Cbus"
2+
3+
config I2CBUS_LOG_ERRORS
4+
bool "Log fail read/write operations (errors)"
5+
depends on ! LOG_DEFAULT_LEVEL_NONE
6+
default "y"
7+
help
8+
Log any read/write operation errors that might ocurr within I2Cbus library.
9+
10+
config I2CBUS_LOG_READWRITES
11+
bool "Log successuful read/write operations (debug)"
12+
depends on ! LOG_DEFAULT_LEVEL_NONE && ! LOG_DEFAULT_LEVEL_ERROR && ! LOG_DEFAULT_LEVEL_WARN
13+
default "n"
14+
help
15+
Log all successuful read/write data, including port, slave address,
16+
target register and the data written to. Useful for debugging.
17+
18+
choice
19+
prompt "Log level"
20+
depends on I2CBUS_LOG_READWRITES
21+
default I2CBUS_LOG_RW_LEVEL_VERBOSE
22+
help
23+
Log level for successuful read/write operations. Levels depends on LOG_DEFAULT_LEVEL.
24+
25+
config I2CBUS_LOG_RW_LEVEL_INFO
26+
bool "Info"
27+
config I2CBUS_LOG_RW_LEVEL_DEBUG
28+
bool "Debug"
29+
config I2CBUS_LOG_RW_LEVEL_VERBOSE
30+
bool "Verbose"
31+
endchoice
32+
33+
endmenu

0 commit comments

Comments
 (0)
Please sign in to comment.