[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/arduino-mode a409aa0 008/107: Automatically create a skele
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/arduino-mode a409aa0 008/107: Automatically create a skeleton Makefile. |
Date: |
Sun, 29 Aug 2021 10:58:07 -0400 (EDT) |
branch: elpa/arduino-mode
commit a409aa0c2199c9ce5f288644426298ee3d2b5639
Author: Peter Oliver <git@mavit.org.uk>
Commit: Peter Oliver <git@mavit.org.uk>
Automatically create a skeleton Makefile.
---
arduino-mode.el | 34 ++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/arduino-mode.el b/arduino-mode.el
index 4333d5e..ccecdfc 100644
--- a/arduino-mode.el
+++ b/arduino-mode.el
@@ -109,14 +109,44 @@ Each list item should be a regexp matching a single
identifier." :group 'arduino
(easy-menu-define arduino-menu arduino-mode-map "Arduino Mode Commands"
(cons "Arduino" (c-lang-const c-mode-menu arduino)))
+(defcustom arduino-makefile-name "Makefile"
+ "Name of Makefile used to compile and upload Arduino sketches."
+ :type 'string
+ :group 'arduino)
+
(defun arduino-upload ()
"Upload a sketch to an Arduino board.
You will need a suitable Makefile. See URL
`http://mjo.tc/atelier/2009/02/arduino-cli.html'."
(interactive)
- (make-local-variable 'compile-command)
- (compile "make -k upload"))
+ (if (file-exists-p arduino-makefile-name)
+ (progn
+ (make-local-variable 'compile-command)
+ (compile (concat "make -f " arduino-makefile-name " -k upload")))
+ (if (y-or-n-p (concat "No Makefile `" arduino-makefile-name
+ "' exists. Create it? "))
+ (let ((arduino-project-name
+ (file-name-nondirectory
+ (file-name-sans-extension (buffer-file-name)))))
+ (find-file-other-window arduino-makefile-name)
+ (insert "# Customise the following values as required:
+
+TARGET = " arduino-project-name "
+ARDUINO_LIBS =
+
+MCU = atmega328p
+F_CPU = 16000000
+ARDUINO_PORT = /dev/ttyUSB*
+AVRDUDE_ARD_BAUDRATE = 57600
+ARDUINO_DIR = /usr/share/arduino
+
+# If you do not already have Arduino.mk, find it at
+# http://mjo.tc/atelier/2009/02/arduino-cli.html
+include /usr/share/arduino/Arduino.mk
+")
+ (message "Edit the Makefile as required and re-run arduino-upload."))
+ (message (concat "No Makefile `" arduino-makefile-name "' exists.
Uploading cancelled.")))))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.pde\\'" . arduino-mode))
- [nongnu] elpa/arduino-mode 9b45a04 022/107: Merge pull request #4 from milkypostman/master, (continued)
- [nongnu] elpa/arduino-mode 9b45a04 022/107: Merge pull request #4 from milkypostman/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode b08dcbb 037/107: Warn if project loading/creation files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode c5af9a6 055/107: add keybinding for open source file with Arduino IDE, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode edf56c2 049/107: add two more commands to install boards and libraries, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 8881f12 062/107: fix void variable ede-arduino-preferences-file, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode fe17c8d 070/107: minor updates, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 8159916 074/107: [feature] display spinner for Arduino processes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 47a0689 075/107: bump version, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode d70f0cc 077/107: Merge tag 'v1.2' into develop, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 41789bc 006/107: Add convenience function arduino-upload to flash a chip., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode a409aa0 008/107: Automatically create a skeleton Makefile.,
ELPA Syncer <=
- [nongnu] elpa/arduino-mode 2a71e75 012/107: Use correct version of compiled code for GNU Emacs., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 3cc39d9 013/107: Add bindings for arduino-upload., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 5d10eca 002/107: add imenu support, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 0f73f82 004/107: highlight builtins for serial communication, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode dbb523c 005/107: Include additional keywords found in Arduino version 0018., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 16e1d57 010/107: Add init file., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode f4fd0e8 017/107: added autoload on .ino files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 68c1661 019/107: Add Version header., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 1fc4b2a 020/107: Add missing autoload cookie, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode effb0bc 024/107: Sync with the language reference as of 20150503, ELPA Syncer, 2021/08/29