Skip to content

Commit c0382db

Browse files
committed
support arduino-cli 1.0 json format
1 parent 1e1eb61 commit c0382db

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
@@ -177,8 +177,9 @@
177177

178178
(defun arduino-cli--board ()
179179
"Get connected Arduino board."
180-
(let* ((usb-devices (arduino-cli--cmd-json "board list"))
181-
(boards (seq-filter #'arduino-cli--arduino? usb-devices))
180+
(let* ((output (arduino-cli--cmd-json "board list"))
181+
(ports (alist-get 'detected_ports output))
182+
(boards (seq-filter #'arduino-cli--arduino? ports))
182183
(boards-info (seq-map (lambda (m) (thread-first (assoc 'boards m) cdr (seq-elt 0))) boards))
183184
(informed-boards (cl-mapcar (lambda (m n) (map-merge 'list m n)) boards boards-info))
184185
(selected-board (arduino-cli--dispatch-board informed-boards))

0 commit comments

Comments
 (0)