1
0
Fork 0

add device init scripts and initialize at boot

This commit is contained in:
Florian Agbuya 2024-03-21 18:36:46 +08:00
parent bda5ec0523
commit 07e0d6aa0d
2 changed files with 11 additions and 3 deletions

View File

@ -22,8 +22,8 @@ MAP_SIZE = 0x1000
MAP_MASK = 0xFFF
PAGESIZE = 0x1000
LINIEN_OFFSET = 0x0
# LINIEN_OFFSET = 0x300000
# LINIEN_OFFSET = 0x0
LINIEN_OFFSET = 0x300000
# ----------------------------------------------------------------
# FRONT PANEL LEDS REGISTER ADDRESSES

View File

@ -113,7 +113,10 @@
};
in {
system.build.linien-server = linien-server;
environment.systemPackages = [ linien-server ];
environment.systemPackages = [
linien-server
(pkgs.python3.withPackages(ps: [ ps.spidev ps.smbus2 ]))
];
});
fast-servo-init = ({ config, pkgs, lib, ... }: {
@ -126,6 +129,11 @@
mkdir -p /lib/firmware
cp ${fast-servo-gateware}/gateware.bin /lib/firmware/
echo gateware.bin > /sys/class/fpga_manager/fpga0/firmware
# Run device init scripts
mkdir -p /opt/pyfastservo
cp ${./fast-servo/pyfastservo}/* /opt/pyfastservo
python3 /opt/pyfastservo/initialize.py
'';
});