Fix epic_sleep() calls delaying load of new app
When core 1 repeatedly calls epic_sleep()
, this could delay an
epic_load() from core 0 because the reset interrupt can only be
delivered after such a call completed.
To work around this, add calls into do_load()
to notify the dispatcher
task that it should return early from calls like epic_sleep()
. This
gets a bit tricky because the dispatcher task also uses
ulTaskNotifyTake()
to wake up when new API calls arrive. To make sure
we still break out of epic_sleep()
, we need to call
xTaskNotifyGive()
twice in the wait loop.