aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/chelper/__init__.py')
-rw-r--r--klippy/chelper/__init__.py22
1 files changed, 2 insertions, 20 deletions
diff --git a/klippy/chelper/__init__.py b/klippy/chelper/__init__.py
index 0a40dfeb..9bb2ebad 100644
--- a/klippy/chelper/__init__.py
+++ b/klippy/chelper/__init__.py
@@ -325,20 +325,11 @@ def logging_callback(msg):
def get_ffi():
global FFI_main, FFI_lib, pyhelper_logging_callback
if FFI_lib is None:
- srcdir = os.path.dirname(os.path.realpath(__file__))
- srcfiles = get_abs_files(srcdir, SOURCE_FILES)
- ofiles = get_abs_files(srcdir, OTHER_FILES)
- destlib = get_abs_files(srcdir, [DEST_LIB])[0]
- if check_build_code(srcfiles + ofiles + [__file__], destlib):
- if check_gcc_option(SSE_FLAGS):
- cmd = "%s %s %s" % (GCC_CMD, SSE_FLAGS, COMPILE_ARGS)
- else:
- cmd = "%s %s" % (GCC_CMD, COMPILE_ARGS)
- logging.info("Building C code module %s", DEST_LIB)
- do_build_code(cmd % (destlib, " ".join(srcfiles)))
FFI_main = cffi.FFI()
for d in defs_all:
FFI_main.cdef(d)
+ srcdir = os.path.dirname(os.path.realpath(__file__))
+ destlib = os.path.join(srcdir, "c_helper.so")
FFI_lib = FFI_main.dlopen(destlib)
# Setup error logging
pyhelper_logging_callback = FFI_main.callback(
@@ -362,13 +353,4 @@ HC_CMD = "sudo %s/hub-ctrl -h 0 -P 2 -p %d"
def run_hub_ctrl(enable_power):
srcdir = os.path.dirname(os.path.realpath(__file__))
hubdir = os.path.join(srcdir, HC_SOURCE_DIR)
- srcfiles = get_abs_files(hubdir, HC_SOURCE_FILES)
- destlib = get_abs_files(hubdir, [HC_TARGET])[0]
- if check_build_code(srcfiles, destlib):
- logging.info("Building C code module %s", HC_TARGET)
- do_build_code(HC_COMPILE_CMD % (destlib, " ".join(srcfiles)))
os.system(HC_CMD % (hubdir, enable_power))
-
-
-if __name__ == "__main__":
- get_ffi()