[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/arduino-mode 241b179 032/107: Merge https://github.com/mav
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/arduino-mode 241b179 032/107: Merge https://github.com/mavit/arduino-mode |
Date: |
Sun, 29 Aug 2021 10:58:11 -0400 (EDT) |
branch: elpa/arduino-mode
commit 241b179290aa56f8f43572ce0f0c67f84fc3f279
Merge: 3e2bad4 0aeea23
Author: Bernd Wachter <bwachter-spam@lart.info>
Commit: Bernd Wachter <bwachter-spam@lart.info>
Merge https://github.com/mavit/arduino-mode
---
arduino-mode-init.el | 2 +
arduino-mode.el | 138 +++++++++++++++++++++++---------------
emacs-common-arduino-mode.spec | 149 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 234 insertions(+), 55 deletions(-)
diff --git a/arduino-mode-init.el b/arduino-mode-init.el
new file mode 100644
index 0000000..341a9fe
--- /dev/null
+++ b/arduino-mode-init.el
@@ -0,0 +1,2 @@
+(autoload 'arduino-mode "arduino-mode" "Major mode for editing Arduino code."
t)
+(add-to-list 'auto-mode-alist '("\\.pde\\'" . arduino-mode))
diff --git a/arduino-mode.el b/arduino-mode.el
index e028cea..b5964f9 100644
--- a/arduino-mode.el
+++ b/arduino-mode.el
@@ -35,7 +35,8 @@
(require 'cl)
(require 'cc-langs)
(require 'cc-fonts)
- (require 'cc-menus))
+ (require 'cc-menus)
+ (require 'term))
(eval-and-compile
;; fall back on c-mode
@@ -54,59 +55,24 @@
(c-lang-const c-constant-kwds)))
(c-lang-defconst c-simple-stmt-kwds
- arduino (append
- '(;; Digital I/O
- "pinMode"
- "digitalWrite"
- "digitalRead"
- ;; Analog I/O
- "analogReference"
- "analogRead"
- "analogWrite"
- ;; Due only
- "analogReadResolution"
- "analogWriteResolution"
- ;; Advanced I/O
- "tone"
- "noTone"
- "shiftOut"
- "shiftIn"
- "pulseIn"
- ;; Time
- "millis"
- "micros"
- "delay"
- "delayMicroseconds"
- ;; Math
- "min"
- "max"
- "abs"
- "constrain"
- "map"
- "pow"
- "sqrt"
- ;; Trigonometry
- "sin"
- "cos"
- "tan"
- ;; Random Numbers
- "randomSeed"
- "random"
- ;; Bits and Bytes
- "lowByte"
- "highByte"
- "bitRead"
- "bitWrite"
- "bitSet"
- "bitClear"
- "bit"
- ;; External Interrupts
- "attachInterrupt"
- "detachInterrupt"
- ;; Interrupts
- "interrupts"
- "noInterrupts")
- (c-lang-const c-simple-stmt-kwds)))
+ arduino
+ (append
+ '("pinMode" "digitalWrite" "digitalRead" ; Digital I/O
+ "analogReference" "analogRead" "analogWrite" ; Analog I/O
+ "tone" "noTone" "shiftIn" "shiftOut" "pulseIn" ; Advanced I/O
+ "millis" "micros" "delay" "delayMicroseconds" ; Time
+ "min" "max" "abs" "constrain" "map" "pow" "sq" "sqrt" ; Math
+ "sin" "cos" "tan" ; Trigonometry
+ "randomSeed" "random" ; Random
Numbers
+ "lowByte" "highByte" "bitRead" "bitWrite" "bitSet" ; Bits and
Bytes
+ "bitClear" "bit"
+ "attachInterrupt" "detachInterrupt" ; External
Interrupts
+ "interrupts" "noInterrupts" ; Interrupts
+ "begin" "end" "available" "read" "flush" "print" "println" ; Serial
Communication
+ "write" "peek"
+ "analogReadResolution" "analogWriteResolution" ; Due only
+ )
+ (c-lang-const c-simple-stmt-kwds)))
(c-lang-defconst c-primary-expr-kwds
arduino (append
@@ -162,10 +128,72 @@ Each list item should be a regexp matching a single
identifier." :group 'arduino
;; Add bindings which are only useful for Arduino
map)
"Keymap used in arduino-mode buffers.")
+(define-key arduino-mode-map "\C-cg" 'arduino-upload)
+(unless (string-match "XEmacs" emacs-version)
+ (define-key arduino-mode-map "\C-cm" 'arduino-serial-monitor))
(easy-menu-define arduino-menu arduino-mode-map "Arduino Mode Commands"
(cons "Arduino" (c-lang-const c-mode-menu arduino)))
+; How does one add this directly to the Arduino menu in XEmacs?
+(if (string-match "XEmacs" emacs-version)
+ (easy-menu-add-item arduino-menu
+ (list "Micro-controller") ["Upload" arduino-upload t])
+ (easy-menu-add-item arduino-menu
+ nil ["----" nil nil])
+ (easy-menu-add-item arduino-menu
+ nil ["Upload" arduino-upload t])
+ (easy-menu-add-item arduino-menu
+ nil ["Serial monitor" arduino-serial-monitor t]))
+
+(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)
+ (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.")))))
+
+(unless (string-match "XEmacs" emacs-version)
+ (defun arduino-serial-monitor (port speed)
+ "Monitor the serial connection to the Arduino."
+ (interactive (list (serial-read-name) nil))
+
+ (if (get-buffer-process port)
+ (switch-to-buffer port)
+ (serial-term port (or speed (serial-read-speed))))))
+
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.pde\\'" . arduino-mode))
;;;###autoload
@@ -189,7 +217,7 @@ Key bindings:
local-abbrev-table arduino-mode-abbrev-table
abbrev-mode t
imenu-generic-expression cc-imenu-c-generic-expression)
- (use-local-map c-mode-map)
+ (use-local-map arduino-mode-map)
;; `c-init-language-vars' is a macro that is expanded at compile
;; time to a large `setq' with all the language variables and their
;; customized values for our language.
diff --git a/emacs-common-arduino-mode.spec b/emacs-common-arduino-mode.spec
new file mode 100644
index 0000000..908175b
--- /dev/null
+++ b/emacs-common-arduino-mode.spec
@@ -0,0 +1,149 @@
+%global pkg arduino-mode
+%global pkgname Arduino Mode
+%global gitcommit aa051bb
+
+Name: emacs-common-%{pkg}
+Version: 0
+Release: 0.3.20100907git%{gitcommit}%{?dist}
+Summary: Emacs editing mode for Arduino code
+
+Group: Development/Tools
+License: GPLv3+
+URL: http://github.com/mavit/%{pkg}/
+Source0: http://download.github.com/mavit-%{pkg}-%{gitcommit}.tar.gz
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch: noarch
+BuildRequires: emacs xemacs xemacs-packages-extra
+Requires: arduino-mk
+
+%description
+%{pkgname} is an add-on package for GNU Emacs and XEmacs, providing an
+editing mode for the Arduino electronics prototyping platform.
+
+This package contains the files common to both the GNU Emacs and XEmacs
+%{pkgname} packages.
+
+
+%package -n emacs-%{pkg}
+Summary: Compiled elisp files to run %{pkgname} under GNU Emacs
+Group: Development/Tools
+Requires: emacs(bin) >= %{_emacs_version}
+Requires: emacs-common-%{pkg} = %{version}-%{release}
+
+%description -n emacs-%{pkg}
+This package contains the byte compiled elisp packages to run
+%{pkgname} with GNU Emacs.
+
+
+%package -n emacs-%{pkg}-el
+Summary: Elisp source files for %{pkgname} under GNU Emacs
+Group: Development/Tools
+Requires: emacs-%{pkg} = %{version}-%{release}
+
+%description -n emacs-%{pkg}-el
+This package contains the elisp source files for %{pkgname} under GNU
+Emacs. You do not need to install this package to run
+%{pkgname}. Install the emacs-%{pkg} package to use %{pkgname} with
+GNU Emacs.
+
+
+%package -n xemacs-%{pkg}
+Summary: Compiled elisp files to run %{pkgname} under XEmacs
+Group: Development/Tools
+Requires: xemacs(bin) >= %{_xemacs_version}
+Requires: emacs-common-%{pkg} = %{version}-%{release}
+
+%description -n xemacs-%{pkg}
+This package contains the byte compiled elisp packages to use %{pkgname}
+with XEmacs.
+
+
+%package -n xemacs-%{pkg}-el
+Summary: Elisp source files for %{pkgname} under XEmacs
+Group: Development/Tools
+Requires: xemacs-%{pkg} = %{version}-%{release}
+
+%description -n xemacs-%{pkg}-el
+This package contains the elisp source files for %{pkgname} under
+XEmacs. You do not need to install this package to run
+%{pkgname}. Install the xemacs-%{pkg} package to use %{pkgname} with
+XEmacs.
+
+
+%prep
+%setup -q -n mavit-%{pkg}-%{gitcommit}
+
+
+%build
+%{_emacs_bytecompile} %{pkg}.el
+mv %{pkg}.elc %{pkg}.gnu.elc
+%{_xemacs_bytecompile} %{pkg}.el
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/%{_emacs_sitelispdir}/%{pkg} \
+ $RPM_BUILD_ROOT/%{_xemacs_sitelispdir}/%{pkg} \
+ $RPM_BUILD_ROOT/%{_emacs_sitestartdir} \
+ $RPM_BUILD_ROOT/%{_xemacs_sitestartdir}
+cp -a %{pkg}.el $RPM_BUILD_ROOT/%{_emacs_sitelispdir}/%{pkg}/
+cp -a %{pkg}.gnu.elc $RPM_BUILD_ROOT/%{_emacs_sitelispdir}/%{pkg}/%{pkg}.elc
+cp -a %{pkg}.el %{pkg}.elc $RPM_BUILD_ROOT/%{_xemacs_sitelispdir}/%{pkg}/
+cp -a %{pkg}-init.el $RPM_BUILD_ROOT/%{_emacs_sitestartdir}/
+cp -a %{pkg}-init.el $RPM_BUILD_ROOT/%{_xemacs_sitestartdir}/
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root,-)
+%doc
+
+
+%files -n emacs-%{pkg}
+%defattr(-,root,root,-)
+%{_emacs_sitelispdir}/%{pkg}/*.elc
+%{_emacs_sitestartdir}/*.el
+%dir %{_emacs_sitelispdir}/%{pkg}
+
+
+%files -n emacs-%{pkg}-el
+%defattr(-,root,root,-)
+%{_emacs_sitelispdir}/%{pkg}/*.el
+
+
+%files -n xemacs-%{pkg}
+%defattr(-,root,root,-)
+%{_xemacs_sitelispdir}/%{pkg}/*.elc
+%{_xemacs_sitestartdir}/*.el
+%dir %{_xemacs_sitelispdir}/%{pkg}
+
+
+%files -n xemacs-%{pkg}-el
+%defattr(-,root,root,-)
+%{_xemacs_sitelispdir}/%{pkg}/*.el
+
+
+%changelog
+* Wed Sep 22 2010 Peter Oliver <rpm@mavit.org.uk> - 0-0.3.20100907gitaa051bb
+- Add missing BuildRequires of xemacs-packages-extra.
+
+* Thu Sep 9 2010 Peter Oliver <rpm@mavit.org.uk> - 0-0.2.20100907gitaa051bb
+- Updated version of arduino-mode.
+
+* Tue Sep 7 2010 Peter Oliver <rpm@mavit.org.uk> - 0-0.1.20100907git3cc39d9
+- Apply package naming guidelines.
+
+* Tue Sep 7 2010 Peter Oliver <rpm@mavit.org.uk> - git2.3cc39d9-1
+- Updated version of arduino-mode.
+- Require arduino-mk.
+
+* Tue Sep 7 2010 Peter Oliver <rpm@mavit.org.uk> - git1.16e1d57-2
+- Use correct version of compiled code for GNU Emacs.
+
+* Tue Sep 7 2010 Peter Oliver <rpm@mavit.org.uk> - git1.16e1d57-1
+- Initial version.
+
- [nongnu] elpa/arduino-mode 5d10eca 002/107: add imenu support, (continued)
- [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
- [nongnu] elpa/arduino-mode 44c2728 025/107: Add to languages customisation group., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode bb89ac8 030/107: Merge pull request #11 from bookest/bug/undefined-cl-macroexpand-all, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 241b179 032/107: Merge https://github.com/mavit/arduino-mode,
ELPA Syncer <=
- [nongnu] elpa/arduino-mode aed4acb 034/107: Add additional customization, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode a468e63 035/107: Add basic support for file variables, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode d1233b1 036/107: Use configured preferences file for ede signature, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 9a168aa 038/107: fix void function `ede-project-autoload`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 1424952 039/107: add new keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 411815d 041/107: change arduino-upload keybinding to [C-c C-c], ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 20e284a 042/107: format code, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 59806cc 043/107: add .ino file extension to auto-mode-alist, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode a95ebba 044/107: remove XEmacs support part, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 3d8aa47 045/107: improve and add some commands for command-line arduino., ELPA Syncer, 2021/08/29