Skip to content

Commit b0364b3

Browse files
committed
Make it compatible with macOS
- use python's `os.path.realpath` instead of readlink, which provides the same behaviour under macOS - add the serial_id under macOS
1 parent ab40e4d commit b0364b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

k210-run

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fi
2626
FW="$(dirname "$ELF")/firmware.bin"
2727
riscv64-unknown-elf-objcopy -O binary "$ELF" "$FW"
2828

29-
dir=$(dirname $(readlink -f $0))
29+
dir=$(python3 -c 'import os,sys;print(os.path.realpath(sys.argv[1]))' ..)
3030

3131
declare -a known_serial_ids
3232

@@ -36,6 +36,9 @@ known_serial_ids[0]=/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
3636
# Sipeed MAIX bit, CH340 based, board
3737
known_serial_ids[1]=/dev/serial/by-id/usb-Kongou_Hikari_Sipeed-Debug_A1525D0091-if00-port0
3838

39+
# Sipeed MAIX bit, on macOS
40+
known_serial_ids[2]=/dev/tty.usbserial-00320000000
41+
3942
SERIAL_DEV=""
4043
for serial_dev in "${known_serial_ids[@]}"
4144
do

0 commit comments

Comments
 (0)