keybindings for compile and upload added

This commit is contained in:
Sameer Rahmani 2016-03-29 19:19:32 +04:30
parent 9992fe2973
commit c936e2a9f5
2 changed files with 24 additions and 4 deletions

2
fg42
View File

@ -4,4 +4,4 @@
export FG42_HOME=$HOME/src/FG42/FG42 export FG42_HOME=$HOME/src/FG42/FG42
#emacs -Q --no-splash --name FG42 --title FG42 -q -l --PATH--/fg42-config.el "$@" #emacs -Q --no-splash --name FG42 --title FG42 -q -l --PATH--/fg42-config.el "$@"
emacs-snapshot --name FG42 -Q -q --no-splash --title FG42 -l $FG42_HOME/fg42-config.el "$@" emacs-snapshot --name FG42 -q --no-site-file --no-site-lisp --no-splash --title FG42 -l $FG42_HOME/fg42-config.el "$@"

View File

@ -4,15 +4,32 @@
;;;###autoload ;;;###autoload
(defun create-makefile () (defun create-makefile ()
"Create the arduino make file in the same directory as the ino file if doesn't exits" "Create the arduino make file in the same directory as the ino file if doesn't exits."
(let ((makefile (concat (file-name-directory buffer-file-name) "Makefile")) (let ((makefile (concat (file-name-directory buffer-file-name) "Makefile"))
(makefile-src (concat fg42-home "/lib/extensions/arduino/Makefile"))) (makefile-src (concat fg42-home "/lib/extensions/arduino/Makefile")))
(message "asdasdasd")
(message makefile-src)
(if (not (file-exists-p makefile)) (if (not (file-exists-p makefile))
(progn (message "Creating arduino make file") (progn (message "Creating arduino make file")
(copy-file makefile-src makefile))))) (copy-file makefile-src makefile)))))
;;;###autoload
(defun compile-arduino ()
"Compile the current arduino project."
(interactive)
(recompile))
;;;###autoload
(defun compile-arduino ()
"Compile the current arduino project."
(interactive)
(recompile))
;;;###autoload
(defun compile-and-upload-arduino ()
"Compile and upload the current arduino project."
(compile-arduino)
(let (compile-command "make upload")
(recompile)))
;;;###autoload ;;;###autoload
(defun extensions/arduino-initialize () (defun extensions/arduino-initialize ()
"Arduino development plugin initialization." "Arduino development plugin initialization."
@ -22,6 +39,9 @@
"Gives FG42 the ability to edit arduino related contents." "Gives FG42 the ability to edit arduino related contents."
(add-hook 'arduino-mode-hook 'create-makefile) (add-hook 'arduino-mode-hook 'create-makefile)
(setq auto-mode-alist (cons '("\\.\\(pde\\|ino\\)$" . arduino-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.\\(pde\\|ino\\)$" . arduino-mode) auto-mode-alist))
(global-set-key (kbd "C-c c") 'compile-arduino)
(global-set-key (kbd "C-c u") 'compile-and-upload-arduino)
(autoload 'arduino-mode "arduino-mode" "Arduino editing mode." t))) (autoload 'arduino-mode "arduino-mode" "Arduino editing mode." t)))