deinit all timers?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
bitrat
Posts: 41
Joined: Fri Jul 26, 2019 4:13 am

deinit all timers?

Post by bitrat » Thu Sep 23, 2021 9:34 pm

Hi,

I was wondering if there is a way to deinit all timer callbacks in running code, without references to them.

Specifically, if I use ctrl-C to exit a program and drop into the REPL, timer callbacks are still executing. Should this happen, or is there a problem somewhere else in my code?

Cheers!

PS: I solved my earlier problem. I realised that my old code was catching all exceptions including ctrl-C and resetting. A case of more haste less speed... and not enough sleep...

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: deinit all timers?

Post by Roberthh » Fri Sep 24, 2021 9:30 am

Soft-Reset stops all timers. It can be forced with Ctrl-D or calling machine.soft_reset().

Post Reply