In OPENMV2 board, try to utilize the mpy thread functionality. Upset, the function is not working fine. three thread are scheduled by around 10s interval. Code as below:
import pyb
import time
import _thread
def led(id, dt):
while 1:
pyb.LED(id).toggle()
time.sleep(dt)
#led(2, 1000)
_thread.start_new_thread(led, (1, 1000))
_thread.start_new_thread(led, (2, 1000))
_thread.start_new_thread(led, (3, 1000))
By comparing with pyboard, after enable the _thread module in mpconfiguration.h, the _thread func working well. thread are scheduling as multi-thread working.
in mpconfiguration.h for pyboard
#define MICROPY_PY_THREAD (1)
#define MICROPY_PY_THREAD_GIL (1)
Thus, whether there is extra more configuration needed in OpenMV project to enable the thread function?
Kindly waiting for your support