kaluma-project / kaluma

A tiny JavaScript runtime for RP2040 (Raspberry Pi Pico)
https://kalumajs.org
Apache License 2.0
650 stars 38 forks source link

Need API to get an available PIO state machine #437

Closed niklauslee closed 3 years ago

niklauslee commented 3 years ago

It is required when using multiple PIO libraries at the same time.

const {StateMachine} = require('rp2');
// ...
var sm = new StateMachine(StateMachine.getAvailableId(), ...);
// The sequence of StateMachine'id is [0, 4, 1, 5, 2, 6, 3, 7]