Git Product home page Git Product logo

platformio-mode's People

Contributors

bricewge avatar dantecatalfamo avatar ollelinderos avatar peterhoeg avatar purcell avatar thomasf avatar zachmassia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

platformio-mode's Issues

ansi cursor escape codes prevent finding source file for compiler errors

I am running platformio with the current (MELPA installed) platformio-mode.el. When compile errors are generated, the escape characters for cursor motion are causing problems with the error file,line matching in emacs. I can work around this in two ways so far:

  1. Modifying system .bashrc to define
  export PLATFORMIO_NO_ANSI=true 
  export PLATFORMIO_FORCE_ANSI=false

resolves the issue.

  1. Changing command in platformio-mode.el in the platformio--exec function to run/build on line 81 from
    (cmd (concat "platformio -f -c emacs " target)))
    to
    (cmd (concat "platformio -f --no-ansi -c emacs " target)))

I was tying to figure out how to add the --no-ansi flag to the platformio.ini file, but have had no luck with this yet.

I am running emacs 26.3 on Ubuntu20.04

Here is a list of my installed packages:

  company-irony      1.1.0         installed
  company-irony-c... 1.0.0         installed
  csv-mode           1.15          installed
  eldoc              1.11.0        installed
  elpy               1.35.0        installed
  flycheck           31            installed
  flycheck-irony     0.1.0         installed
  gnuplot            0.8.0         installed
  lua-mode           20201010      installed
  platformio-mode    0.2.2         installed
  company            0.9.13        dependency
  dash               2.18.1        dependency
  epl                0.9           dependency
  highlight-inden... 0.7.0         dependency
  irony              1.4.0         dependency
  pkg-info           0.6           dependency
  projectile         2.3.0         dependency
  pyvenv             1.21          dependency
  s                  1.12.0        dependency
  yasnippet          0.14.0        dependency

Thank you for the nice package - Rick Sorensen

Eglot

I use clangd as my auto completion engine, how do we integrate it or is there not any support at all and how do we install and use new libraries?

Platformio can't see correct working directory

This is related to #10. I am also using spacemacs. No matter what I try, I can't get platformio-mode to use the correct directory when building. It always uses ~/code, not ~/code/embedded/esp32/test/ (~/code/embedded/esp32/test/src/ is the current directory). I tried using cd to correct the directory of the main.cpp buffer but it had no effect. I then went to the PIO buffer and changed the directory, but it had no effect. I tried the line (add-to-list 'projectile-project-root-files "platformio.ini") in my .spacemacs, but it tells me Error in dotspacemacs/user-config: Symbol’s value as variable is void: projectile-project-root-files.
I used describe-variable to look at default-directory and it told me this:

default-directory is a variable defined in ‘C source code’.
Its value is "/home/vatrat/code/embedded/esp32/test/src/"
Local in buffer main.cpp; global value is nil

  Automatically becomes permanently buffer-local when set.
  This variable is safe as a file local variable if its value
  satisfies the predicate ‘stringp’.

However, when I run C-c i b or C-c i u from the same file PIO shows

-*- mode: platformio-compilation; default-directory: "~/code/" -*-
PIOCompilation started at Mon Dec  4 19:16:17

platformio -f -c emacs run 
Error: Please setup environments in `platformio.ini` file

PIOCompilation exited abnormally with code 1 at Mon Dec  4 19:16:18

Not able to stop device monitor in Emacs

platformio-mode uses the same miniterm as the pio CLI thats great except when invoking the device monitor one is told:

--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

except all of these are key commands are clobbered by Emacs typically. So instead I have to switch to the buffer, delete the buffer, then delete the window. What am I missing? I'd love to be able to hit q to kill these windows, or something a little less clunky. Any ideas?

Not in project

Hello,

Thank you for this package but I am getting an error every time I try to run a Command. It says that I am not a project.

My work around is to initialize a git repo for my project. How can I make projectile recognize the platformio.ini and assign it as a project?

Thank you

Regenterate clang completion file for irony-mode etc.

If I understand it correctly one has to run platformio init --ide emacs to
regenerate the .clang_complete file. Do you know if there some way to tell
platformio to only generate that specific template?

I'm all new to platformio, I have just used it with arduino a couple of hours
but it seems to me that something should maybe be added to this emacs package
for regenerating those clang completions to get irony-mode working properly.

[propsal] need remote run

if platformio-mode support platformio's remote command would be really great.

i am developing firmware on WSL (cause emacs sucks on windws), and upload firmware using remote command cause my board attatched on remote server

Depend on built-in `project.el`.

Hello!

First of all, thanks for this great package! I've been using it for quite some time. Very neat and very useful!


Can we switch to depending on the project.el (built-in), instead of the projectile.el?

Currently, functions platformio-conditionally-enable and platformio--exec have been modified, in my local installation, to use project.el and look like this:

(defun platformio-conditionally-enable ()
  "Enable `platformio-mode' only when a `platformio.ini' file is present in project root."
  (condition-case nil
      (let* ((ini "platformio.ini")
	     (files (project-files (project-current t)))
	     (match (string-match-p ini (format "%s" files))))
	(when match
	  (platformio-mode 1)))
    (error nil)))

(defun platformio--exec (target)
  "Call `platformio ... TARGET' in the root of the project."
  (let* ((project (project-current t))
	 (default-directory (project-root project))
	 (buffers (project-buffers project))
         (cmd (concat "platformio -f -c emacs " target)))
    (unless default-directory
      (user-error "Not in a project, aborting"))
    (save-some-buffers (not compilation-ask-about-save)
                       (lambda ()
                         (when (member (current-buffer) buffers)
			   t)))
    (compilation-start cmd 'platformio-compilation-mode)))

There are certainly more elegant ways of doing what I did above, but the functions do their job.

If I can suggest, perhaps the usage of projectile.el could be preserved via some custom variable and some more code, for those who prefer it, but the mandatory dependency could come out with an implementation in the spirit of what I've been using in my settings.


What do you think?

Thanks!

i can't get work the mode. There is an error related with platformio-setup-compile-buffer function

This is the error when open emacs with debug-init:

Debugger entered--Lisp error: (void-function platformio-setup-compile-buffer)
  (platformio-setup-compile-buffer)
  eval-buffer(#<buffer  *load*> nil "/home/brolin/.emacs" nil t)  ; Reading at buffer position 9002
  load-with-code-conversion("/home/brolin/.emacs" "/home/brolin/.emacs" t t)
  load("~/.emacs" t t)
  #[0 "�\205\262

Do you have an idea or any clue of what happens?

Wrong type argument: stringp, nil

I have the mode enabled, but when I try to run the command inside the platfomio.ini buffer, the following error appears (I have the debug mode enabled):

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  locate-file-internal(nil ("./") nil #f(compiled-function (f) #<bytecode 0x400a65e5>))
  locate-file(nil ("./") nil #f(compiled-function (f) #<bytecode 0x400a65e5>))
  cd(nil)
  compilation-start("platformio -f -c emacs run " platformio-compilation-mode)
  platformio--exec("run ")
  platformio--run(nil nil)
  platformio-build(nil)
  funcall-interactively(platformio-build nil)
  call-interactively(platformio-build record nil)
  command-execute(platformio-build record)
  execute-extended-command(nil "platformio-build" "platformio-build")
  funcall-interactively(execute-extended-command nil "platformio-build" "platformio-build")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

'Add' button in Boards menu triggers "not in a projectile-project" user-error

I've installed platformio-mode from MELPA. I notice that the Add button in the platformio-boards menu ultimately invokes this code:

(defun platformio--exec (target)
  "Call `platformio ... TARGET' in the root of the project."
  (let ((default-directory (projectile-project-root))
        (cmd (concat "platformio -f -c emacs " target)))
    (unless default-directory
      (user-error "Not in a projectile project, aborting"))
   ...

However, when in the *PlatformIO Boards* buffer, (projectile-project-root) is (understandably) nil, so the user-error is triggered, even when I've generated the menu from a file that's part of a Projectile project. For context, the default-directory (not to be confused with your local variable) is my home directory. I've tried using the menu both with M-x and from the Tools menu.

doesn't play nice with `use-package`

There are no ;;;#autoload markers for platformio-setup-compile-buffer and platformio-conditionally-enable

I'm not sure if they are necessary for platformio-build etc though.

Which makes it so the whole file must be loaded anyways.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.