hello_dual_core.py
# Questo lavoro è concesso in licenza MIT.
# Copyright (c) 2013-2026 OpenMV LLC. Tutti i diritti riservati.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# Esempio Hello Dual-Core
#
# L'Alif AE3 ha due core: il core High-Performance (HP) che esegue lo script
# principale, e il core High-Efficiency (HE) per il lavoro in background a basso consumo. Questo
# esempio avvia un task sul core HE. Il suo output print() viene inoltrato tramite
# l'endpoint OpenAMP predefinito allo stdout del core HP.
import time
import openamp
# Questa funzione asincrona viene eseguita sul core HE.
@openamp.async_remote
async def task1(ept):
import asyncio
while True:
print("Hello from the HE core!")
await asyncio.sleep(1)
# Avviare (boot) il core HE e avviare i task registrati.
rproc = openamp.RemoteProc(0x80320000)
rproc.start()
# Questo ciclo viene eseguito sul core HP.
while True:
print("Hello from the HP core!")
time.sleep(1)