#!/bin/sh set -e f="$1" v="$2" if [ -z "$f" -o -z "$v" ] then echo "Usage: inject ADC 0">&2 exit 1 fi python tobin.py "$f" "$v" >"${f}.bin" cbmctrl upload 8 0x600 "${f}.bin" #cbmctrl listen 8 15 cbmctrl command 8 "M-E" #echo -n -e "M-R\x00\x06\x50" >/dev/cbm #Q #cbmctrl write Q #bmctrl unlisten #bmctrl status 8 vs="$(printf "%02X" "$v")" mkdir -p "${f}" mkdir -p "${f}/${vs}" #sleep 10 rm -f "${f}/${vs}/output" cbmctrl download 8 0x700 0x100 "${f}/${vs}/output" || { rm -f "${f}/${vs}/output" exit 1 }