adafruit / circuitpython_jupyter_kernel

Jupyter kernel to interact with CircuitPython board over USB
https://circuitpython-kernel.readthedocs.io/en/latest/
Other
37 stars 27 forks source link

add %softreset magic #16

Closed ghost closed 5 years ago

ghost commented 5 years ago

%softreset magic does just what the name says. Useful when debugging code that allocates resources (e.g. GPIO).

Also added a delay while sending code to the board. Apparently the MCU cannot keep up with "bit" cells with lots of code.

brentru commented 5 years ago

@bboser Thanks for the contribution - looks great! Let me know when the PR is ready so I can test this on my board, then pull it in.

ghost commented 5 years ago

Uh ops. I'm not very familiar with github and did not realize that changes I made since creating the pull request are now apparently included in the PR. In part the new code now reconnects if the board was disconnected and adds a delay during upload of big cells (apparently the board drops characters, not surprisingly). In addition I made a temporary upload to pipy, and that (plus probably a few other miscellaneous changes) should not be in the PR. Do you know how I can "tell" github to limit the PR to just the relevant files? One more thing that could be of use is a notebook with examples.

tannewt commented 5 years ago

@bboser The GitHub PR tracks the branch it was made from (your master). To move the extra commits from your master branch you'll need to git checkout -b new_branch_name to create a second branch for all of your changes, then git branch -D masterto delete the master branch "label", checkout the commit you want master to be with git checkout <commit hash> and then git checkout -b master to recreate master. Then you should be able to git push --force-with-lease to update GitHub's version of master. I suggest running git status between each step as a reference to where you are.

Feel free to ask for help on our Discord if you need it. https://adafru.it/discord

ghost commented 5 years ago

@tannewt Made the change, thanks for the instructions! The changes are now concentrated in a branch adafruit_pr. Should I submit a new PR for that branch and close the current one?

What you'd get:

Let me know what you would like me to do. If you want to close the PR and wait for a higher quality submission I understand, of course.

tannewt commented 5 years ago

Ya, if there is more in adafruit_pr please create a new PR and close this one.

The code quality looks fine to me so I'm happy to merge after @brentru confirms it works.

ghost commented 5 years ago

Closed, will resubmit cleaned-up version.