Task Scheduler

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
TeddyBonkers
 
Posts: 11
Joined: Tue Sep 14, 2021 3:21 pm

Task Scheduler

Post by TeddyBonkers »

Hi,
Is there something like a task scheduler in CircuitPython? I'm looking for something like uasyncio or periodic timers - I need to implement a CAN-based communication protocol, and it's hard to do it without interrupts.

Thanks

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Task Scheduler

Post by dastels »

As far as I know, CircuitPython doesn't have support for real-time programming (or interrupt driven, or concurrent). It skews toward education and hobby use. For more professional/industrial use have a look at MicroPython.

Dave

User avatar
TeddyBonkers
 
Posts: 11
Joined: Tue Sep 14, 2021 3:21 pm

Re: Task Scheduler

Post by TeddyBonkers »

Thanks Dave,

I was looking at MicroPython but I think it does not provide support for Feather M4 CAN, so I am probably stuck with the Arduino framework.

User avatar
danhalbert
 
Posts: 4649
Joined: Tue Aug 08, 2017 12:37 pm

Re: Task Scheduler

Post by danhalbert »

Take a look at https://github.com/WarriorOfWire/CircuitPython_async (formerly tasko), which is a library that uses async/await to provide an event loop. This is not real-time interrupts, as MicroPython provides, but it is tasking.

An even simpler library is here:
https://github.com/deshipu/meanwhile

We have had discussions about these kinds of capabilities here:
https://github.com/adafruit/circuitpython/issues/4542
https://github.com/adafruit/circuitpython/issues/1380 (discussion closed)

User avatar
TeddyBonkers
 
Posts: 11
Joined: Tue Sep 14, 2021 3:21 pm

Re: Task Scheduler

Post by TeddyBonkers »

I think the CircuitPython_async will do the job for my case. Thanks!

User avatar
danhalbert
 
Posts: 4649
Joined: Tue Aug 08, 2017 12:37 pm

Re: Task Scheduler

Post by danhalbert »


Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”