emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/arduino-mode 139b154 051/107: add support for --board opti


From: ELPA Syncer
Subject: [nongnu] elpa/arduino-mode 139b154 051/107: add support for --board option with header argument :boarder
Date: Sun, 29 Aug 2021 10:58:15 -0400 (EDT)

branch: elpa/arduino-mode
commit 139b154746e8643c89403abd5a0119c73363afdb
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>

    add support for --board option with header argument :boarder
---
 ob-arduino.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/ob-arduino.el b/ob-arduino.el
index f15b6f4..9805ae1 100644
--- a/ob-arduino.el
+++ b/ob-arduino.el
@@ -23,13 +23,21 @@
   :group 'ob-arduino
   :type 'string)
 
+(defcustom ob-arduino:board "arduino:avr:uno"
+  "Default Arduino board."
+  :group 'ob-arduino
+  :type 'string)
+
 ;;;###autoload
 (defun org-babel-execute:arduino (body params)
   "org-babel arduino hook."
   (let* ((port (cdr (assoc :port params)))
+         (board (cdr (assoc :board params)))
          (cmd (mapconcat 'identity (list
                                     ob-arduino:program "--upload"
-                                    (if port (concat "--port " port))) " "))
+                                    (if port (concat "--port " port))
+                                    (if board (concat "--board " board))
+                                    ) " "))
          (code (org-babel-expand-body:generic body params))
          (src-file (org-babel-temp-file "ob-arduino-" ".ino")))
     ;; delete all `ob-arduino' temp files, otherwise arduino will compile all
@@ -48,6 +56,7 @@
      (concat ob-arduino:program
              " " "--upload"
              " " (if port (concat "--port " port))
+             " " (if board (concat "--board " board))
              " " src-file)
      "" ; pass empty string "" as `BODY' to 
`org-babel--shell-command-on-region'
      ;; to fix command `arduino' don't accept string issue.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]