Skip to content

Instantly share code, notes, and snippets.

View SebastianBoe's full-sized avatar
🌴
On vacation

Sebastian Bøe SebastianBoe

🌴
On vacation
  • Nordic Semiconductor
  • Trondheim, Norway
View GitHub Profile
add_definitions(${EXTRA_CPPFLAGS})
link_libraries(${EXTRA_LDFLAGS})
add_compile_options($<$<COMPILE_LANGUAGE:C>:${EXTRA_CFLAGS}>)
# EXTRA_*FLAGS are whitespace seperated. I need to convert these to lists.
# But this is not DRY
string(REPLACE " " ";" EXTRA_CPPFLAGS_AS_LIST ${EXTRA_CPPFLAGS})
string(REPLACE " " ";" EXTRA_LD_FLAGS_AS_LIST ${EXTRA_LD_FLAGS})
string(REPLACE " " ";" EXTRA_CFLAGS_AS_LIST ${EXTRA_CFLAGS})
cmake kconfig [OPTIONS..] [COMMAND] ...
Query or modify the current config.
Options:
-d --default=SOURCE[,SOURCE][...] # Determine how the default value is set. See below.
-p --tech=TECH # Determine what technology is used to prompt for user input. See below.
-a --auto=old|all # Automatically select the option's default value for old values or for all values
-A --update-autoconf # Update autoconf.h after updating current config
Traceback (most recent call last):
File "/home/sebo/zephyr/scripts/dts/flatten.py", line 203, in <module>
sys.exit(main())
File "/home/sebo/zephyr/scripts/dts/flatten.py", line 200, in main
args.boot_cpu, args.include_path)
File "/home/sebo/zephyr/scripts/dts/flatten.py", line 172, in flatten
tree = devicetree.parse_file(input, include_path=include_path)
File "/home/sebo/zephyr/scripts/dts/devicetree.py", line 271, in parse_file
new_node = parse_node(line, fd)
File "/home/sebo/zephyr/scripts/dts/devicetree.py", line 206, in parse_node
@SebastianBoe
SebastianBoe / kernel.patch
Created January 4, 2018 11:52
Hooking in external drivers
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 84deadfc5..e137c867b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -293,6 +293,9 @@ add_subdirectory(misc)
include(misc/generated/CMakeLists.txt)
add_subdirectory(boards)
add_subdirectory(ext)
+if(CONFIG_EXTERNAL_KERNEL_SYSTEMS)
+ add_subdirectory(${CONFIG_EXTERNAL_KERNEL_SYSTEMS} ${APPLICATION_BINARY_DIR}/external_kernel_systems)
# https://stackoverflow.com/a/6257321/1134134
import os, fnmatch
def findReplace(directory, find, replace, filePattern):
for path, dirs, files in os.walk(os.path.abspath(directory)):
for filename in fnmatch.filter(files, filePattern):
filepath = os.path.join(path, filename)
s = ""
with open(filepath) as f:
for line in f:
import serial
import sys
with serial.Serial(sys.argv[-1], baudrate=115200, timeout=100000) as ser:
ser.flushInput()
while True:
ser_bytes = ser.readline()
print(ser_bytes[0:len(ser_bytes)-2].decode("utf-8"))