Skip to main content
2 of 3
added 3 characters in body
Mikael Patel
  • 8k
  • 2
  • 16
  • 21

In Cosa you can find the following support for concurrent programming:

  1. Events, interface interrupt service routines
  2. Jobs, delayed, periodic or alarm functions with us, ms and seconds level timers (Watchdog, RTT or RTC).
  3. FSM, object-state function
  4. ProtoThreads, object-state pointer
  5. Threads, Semaphores, etc, multiple stacks
  6. UML Capsules and Connectors, dependency driven programming

There are plenty examples on how to use these. A good starting point is the Blink sketches. There is even a multi-threading Blink example with a thread that does the LED on/off and a controller thread that periodically changes the blink period. The thread stack size is only 64 bytes and it runs even on an ATtiny.

With all the AVR internal hardware modules (such as SPI, TWI, UART, etc) there is plenty of opportunities for concurrency.

Cheers!

Mikael Patel
  • 8k
  • 2
  • 16
  • 21