Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Booleans in platformio.ini not parsed properly #3022

Closed
1 task done
InvncibiltyCloak opened this issue Sep 15, 2019 · 2 comments
Closed
1 task done

Booleans in platformio.ini not parsed properly #3022

InvncibiltyCloak opened this issue Sep 15, 2019 · 2 comments
Labels
bug config platformio.ini
Milestone

Comments

@InvncibiltyCloak
Copy link

InvncibiltyCloak commented Sep 15, 2019

What kind of issue is this?

  • PlatformIO Core.
    If you’ve found a bug, please provide an information below.

Operating system: Ubuntu 19.04

PlatformIO Version: Version 4.0.3

Description of problem

I am attempting to override some of the options for my board, as described in the doc "Advanced Scripting - Override Board Configuration"

The option I want to override is a boolean in the JSON. I am trying to override upload.use_1200bps_touch. However, any value I enter into the platformio.ini file gets parsed as a string (not a boolean), and Python considers any non-empty string as True. Therefore it is nearly impossible to override this (or any other boolean) with the value False. The entry needs to be properly parsed to a boolean.

Steps to Reproduce

  1. Create platform.ini file for a board that has upload.use_1200bps_touch set to True by default.
  2. Add the option board_upload.use_1200bps_touch = False to platform.ini

Actual Results

The upload script still executes the use_1200bps_touch code, because False was parsed as a string which evaluates to True. You will see in the terminal "Forcing reset using 1200bps open/close on port" when this option executes.

Expected Results

False should be False. There should be no text "Forcing reset using 1200bps open/close on port" in the terminal.

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:a-star32U4]
platform = atmelavr
board = a-star32U4
board_upload.use_1200bps_touch = False
@InvncibiltyCloak
Copy link
Author

As a note, a workaround to this problem is to set the value to nothing, which is parsed as None, which evaluates to False in the code.

Example:

[env:a-star32U4]
platform = atmelavr
board = a-star32U4
board_upload.use_1200bps_touch = 

@ivankravets
Copy link
Member

Living an empty value is a true temporary solution here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug config platformio.ini
Projects
None yet
Development

No branches or pull requests

2 participants