Repository navigation
Save last UnifiedConfiguration as default for target - #3449
Conversation
pkendall64
left a comment
There was a problem hiding this comment.
Nice QoL feature for us devs. 👏
|
Oh so I wasn't the only person struggling to remember if Generic 8285 RX was 16 or 18? :-D I'd also like to implement that if you're performing the platformio "Upload" operation (not just build), it skips the interactive prompt and just uses the default if it exists for the target. How do you feel about that, and if you like that idea too, does anyone have suggestions on how to better pass all this information to the DoConfiguration function that now has like 10 parameters? Passing a dict with string values would be a terrible solution and passing a class with just all the parameters in a struct-like form just adds more code for callers without any benefit. Is 10 function parameters the only way? |
|
Sadly, I think 10 params is probably the only way 😮💨 |
|
The only way to detect "upload" is pretty crazy since it isn't in the PIO environment
The default is always used on an "Upload" PIO operation, so if you need to clear it, use the "Clean" PIO operation which will remove the target's product default from the json file. |
QOL feature to save the product chosen during UnifiedConfiguration to allow the developer to just press enter to apply the last used configuration instead of having to remember which number they are working with each time. Upload also will use the default without prompting.
The product is saved per-target without the upload method, e.g Unified_LR1121_TX_via_WIFI is the same as Unified_LR1121_TX_via_UART. The value is stored in
.pio/default_target_config.jsonjust to keep it out of the way. PIO might periodically remove this directory but no real loss here as it is just here to allow us to press enter after starting a build to have it build, append the config, while going to get a drink!