Search found 68 matches

by hlovatt
Fri Aug 23, 2019 2:28 am
Forum: General Discussion and Questions
Topic: __debug__ always True
Replies: 3
Views: 3271

Re: __debug__ always True

Thanks, that explains what is going on. I didn't get any of the subtlety from the documentation! Thanks again.
by hlovatt
Thu Aug 22, 2019 8:22 am
Forum: General Discussion and Questions
Topic: __debug__ always True
Replies: 3
Views: 3271

Re: __debug__ always True

Just noticed that it works if I type the code in at the REPL but not when run from the file system :(
by hlovatt
Thu Aug 22, 2019 8:12 am
Forum: General Discussion and Questions
Topic: __debug__ always True
Replies: 3
Views: 3271

__debug__ always True

If I run: import micropython micropython.opt_level(3) print('Opt level: {}, Debug: {}'.format(micropython.opt_level(), __debug__)) On: MicroPython v1.11-167-g331c224e0 on 2019-07-21; PYBv1.1 with STM32F405RG I get: Opt level: 3, Debug: True I was expecting 2 and above to set `__debug__ = False`. Any...
by hlovatt
Thu Aug 22, 2019 2:13 am
Forum: General Discussion and Questions
Topic: Logging exceptions from interrupts
Replies: 2
Views: 3125

Re: Logging exceptions from interrupts

Yes. The following works but is more trouble than some form of global exception handling: """Test catching exceptions in MicroPython.""" import micropython import pyb # Raise an arithmetic exception. def arithmetic_exception(_): print(1 / 0) # Wrapper to catch exceptions from interrupts via schedule...
by hlovatt
Tue Aug 20, 2019 7:47 am
Forum: General Discussion and Questions
Topic: Logging exceptions from interrupts
Replies: 2
Views: 3125

Logging exceptions from interrupts

Dear Gurus, I want to log exceptions in a MicroPython program and then restart and report the exception after the restart. I am having trouble with exceptions from interrupts, see example below: import micropython import pyb # Raise an arithmetic exception. try: x = 1 / 0 except KeyboardInterrupt: r...
by hlovatt
Mon Aug 19, 2019 3:55 am
Forum: General Discussion and Questions
Topic: Does PyCharm Micropython Plugin still work?
Replies: 17
Views: 16986

Re: Does PyCharm Micropython Plugin still work?

It works for me on PyCharm 2018.2 but not 2019. On 2018.2 it does say pub is missing but if you tell PyCharm to ignore that error it does work. However no completion of course for pub stuff (which is a pain).
by hlovatt
Fri Aug 16, 2019 8:25 am
Forum: General Discussion and Questions
Topic: Does PyCharm Micropython Plugin still work?
Replies: 17
Views: 16986

Re: Does PyCharm Micropython Plugin still work?

I have the same issue with a PyBoard :(
by hlovatt
Fri Aug 16, 2019 8:24 am
Forum: General Discussion and Questions
Topic: Does PyCharm Micropython Plugin still work?
Replies: 17
Views: 16986

Re: Does PyCharm Micropython Plugin still work?

I have the same issue `pyb` isn't showing up under External Libraries/MicroPython, but `micropython` and `stdlib` are.