Skip to content

Commit 5f318aa

Browse files
committed
support arduino-cli 1.0 json format
1 parent f4a26fc commit 5f318aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arduino-cli-mode.el

+3-2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@
194194

195195
(defun arduino-cli--board ()
196196
"Get connected Arduino board."
197-
(let* ((usb-devices (arduino-cli--cmd-json "board list"))
198-
(boards (seq-filter #'arduino-cli--arduino? usb-devices))
197+
(let* ((output (arduino-cli--cmd-json "board list"))
198+
(ports (alist-get 'detected_ports output))
199+
(boards (seq-filter #'arduino-cli--arduino? ports))
199200
(boards-info (seq-map (lambda (m) (thread-first (assoc 'boards m) cdr (seq-elt 0))) boards))
200201
(informed-boards (cl-mapcar (lambda (m n) (map-merge 'list m n)) boards boards-info))
201202
(selected-board (arduino-cli--dispatch-board informed-boards))

0 commit comments

Comments
 (0)