Автоопределение архитектуры процессора и загрузка соотв. sharelib

This commit is contained in:
Nikolay Kopitonenko 2024-03-19 06:43:12 +03:00
parent cf3327ad33
commit 0928a2b61b
1 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import sys, os, gc, optparse, logging, time
from cffi import FFI
import datetime
import datetime, platform
SCREEN_PATH="/home/pi/3dscreen"
@ -17,9 +17,12 @@ def load():
void free(void*);
""")
try:
arch = platform.machine()
if arch == "aarch64":
lib = ffi.dlopen(SCREEN_PATH+"/lib/lib3dscreen-arm64.so")
elif arch == "armv7l":
lib = ffi.dlopen(SCREEN_PATH+"/lib/lib3dscreen.so")
except:
else:
lib = ffi.dlopen("/lib/lib3dscreen-host.so")
def Klippy_Get_Autosave_Filename():