Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run event loop in delay on app thread only #1055

monkbroc opened this issue Jul 9, 2016 · 1 comment


Copy link

commented Jul 9, 2016

I have an application running without system thread with the hardware logic running in a separate wiring Thread and only cloud related things in loop().

When calling delay() in the hardware thread, it processes cloud events. Since the main thread also processes cloud events this leads to random crashes.

The workaround is to call HAL_Delay_Milliseconds().

The fix is to ensure that delay() only processes cloud events when called on the main thread.

This issue applies with system thread enabled our disabled.

I'll add a test case when my internet comes back at home.


  • Minimum test case added
  • Device, system and user firmware versions stated
  • Particle confirmed

This comment has been minimized.

Copy link

commented Jul 9, 2016

Let's try to work this through so the code is covered by a unit test that exercises the different cases/emulates different calling threads, as well as a suite of acceptance test apps to actually test the desired outcome for real. This is particularly difficult with the way the code is presently structured.

@m-mcgowan m-mcgowan added this to the 0.7.x milestone Jul 13, 2016

@avtolstoy avtolstoy referenced this issue Aug 14, 2016
7 of 7 tasks complete

@technobly technobly modified the milestones: 0.6.x, 0.7.x Aug 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.