nix: rm verify, add mosquitto helper

This commit is contained in:
occheung 2020-09-23 12:31:10 +08:00
parent c935236d68
commit c0e0c381ec
1 changed files with 6 additions and 8 deletions

View File

@ -10,7 +10,7 @@ let
runOpenOcd = writeShellScriptBin "run-openocd" '' runOpenOcd = writeShellScriptBin "run-openocd" ''
openocd \ openocd \
-f board/st_nucleo_h743zi.cfg \ -f openocd/openocd.cfg \
-c init & -c init &
sleep 1 sleep 1
''; '';
@ -49,12 +49,6 @@ let
&& flash-fpga-config && flash-fpga-config
''; '';
verifyFPGAConfig = writeShellScriptBin "verify-fpga-config" ''
gdb -x gdb_config/fpga_verify.gdb
diff build/top.bin mem.bin
rm mem.bin
'';
resetFlash = writeShellScriptBin "reset-flash" '' resetFlash = writeShellScriptBin "reset-flash" ''
gdb -batch -x gdb_config/reset.gdb gdb -batch -x gdb_config/reset.gdb
echo "Reset is complete, please reset the openocd server." echo "Reset is complete, please reset the openocd server."
@ -64,6 +58,10 @@ let
openocd -f openocd/openocd.cfg -f openocd/$1.cfg openocd -f openocd/openocd.cfg -f openocd/$1.cfg
''; '';
publishMqtt = writeShellScriptBin "publish-mqtt" ''
mosquitto_pub -h localhost -t $1 -m "$2" -d
'';
in in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "nix-shell"; name = "nix-shell";
@ -85,8 +83,8 @@ in
compileMigenScript compileMigenScript
flashFPGAConfig flashFPGAConfig
configureFPGA configureFPGA
verifyFPGAConfig
resetFlash resetFlash
openocdFlash openocdFlash
publishMqtt
]; ];
} }