BetaRavener / uPyLoader

File transfer and communication tool for MicroPython boards
MIT License
354 stars 76 forks source link

Addprefport #12

Closed jdeltoft closed 7 years ago

jdeltoft commented 7 years ago

This adds the ability in settings to add a "preferred port" such as "com12" in my case. You can type in upper or lower case, and whitespace is also stripped. You still have to refresh once you plug in the usb device, but from then on it should stay set.

BetaRavener commented 7 years ago

Didn't you forget to commit settings.py file? Currently I get error on startup AttributeError: 'Settings' object has no attribute 'preferred_port'. I could fix it but if it's just an uncommitted file, it's better that you add it.

jdeltoft commented 7 years ago

Oh, actually I think you found a bug. I forgot to initialize preferred_port to NONE in setting.py. I will push that tonight.

jdeltoft commented 7 years ago

Ok, try this now. I didn't hit this myself because before I populated the saved preference, I had already try to save a value for it.

BetaRavener commented 7 years ago

Ok it seems to load up correctly and it's there in settings, so should be good. Can't test because I have only one COM port available at the moment. Going to merge this one in.

jdeltoft commented 7 years ago

Ok, great. I really like this one because now as long as my device is in before I start uPyLoader it sets the right port without intervention.