From 2ccddd29059edd100dd0f753b075e076c69ed39b Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 15 Mar 2023 01:31:12 +0100 Subject: [PATCH] Set up embedded dev environment using PlatformIO --- +keybindings.el | 6 ++++++ +ui.el | 2 ++ config.el | 5 +++++ packages.el | 2 ++ 4 files changed, 15 insertions(+) diff --git a/+keybindings.el b/+keybindings.el index c5913e9..21a97f4 100644 --- a/+keybindings.el +++ b/+keybindings.el @@ -34,3 +34,9 @@ ;; Keybindings for citar (map! :leader :n "n B" #'citar-open-files :desc "Open associated PDF with bibliography entry") +;; Keybindings for PlatformIO +(map! :map (platformio-mode) + (:leader + :desc "Compile the project" "c c" #'platformio-build + :desc "Upload the project" "c u" #'platformio-upload + :desc "Monitor the serial console" "c m" #'platformio-device-monitor)) diff --git a/+ui.el b/+ui.el index 14f88d5..34e36d8 100644 --- a/+ui.el +++ b/+ui.el @@ -58,3 +58,5 @@ :action =wallabag) t) ;; Decrease size of icons in the modeline (setq all-the-icons-scale-factor 1.0) +;; Increase size of the PlatformIO compilation buffer +(set-popup-rule! "*platformio*" :size 0.25 :vslot -4 :select t :quit nil :ttl 0) diff --git a/config.el b/config.el index 022cbdb..3d511d4 100644 --- a/config.el +++ b/config.el @@ -138,3 +138,8 @@ (setq native-comp-deferred-compilation nil) (after! (doom-packages straight) (setq straight--native-comp-available t)) +;; Use PlatformIO for Arduino development +(use-package! platformio-mode + :after cc-mode + :config + (add-hook! 'c++-mode-hook (platformio-conditionally-enable))) diff --git a/packages.el b/packages.el index bc04d04..eebd761 100644 --- a/packages.el +++ b/packages.el @@ -26,3 +26,5 @@ (package! asoc :recipe (:host github :repo "troyp/asoc.el")) (package! doct :recipe (:host github :repo "progfolio/doct")) (package! org-capture-ref :recipe (:host github :repo "yantar92/org-capture-ref")) +;; Arduino development +(package! platformio-mode)