File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ int main() {
8989
9090 // We need to wait until we've actually measured the ADC before proceeding
9191 while (! (priority_ready & (1 << LOW_PRIORITY )))
92- ;
92+ PWR_Sleep () ;
9393
9494 //Only do this after we've initialized all channel data so the saftey works
9595 PROTOCOL_InitModules ();
Original file line number Diff line number Diff line change 3636#include " fltk_resample.h"
3737
3838bool changed = false ;
39+ static bool singlethread = false ;
3940
4041#define USE_OWN_PRINTF 0 // Disable sprintf mappingdue to need for %f
4142// Windows
@@ -557,6 +558,11 @@ void _ALARMhandler(int sig) {
557558
558559void CLOCK_Init ()
559560{
561+ singlethread = getenv (" SINGLETHREAD" ) != NULL ;
562+
563+ if (singlethread)
564+ return ;
565+
560566 timer_callback = NULL ;
561567 signal (SIGALRM, _ALARMhandler);
562568#if 1 // Mac OSX doesn't support posix timers, but does support itimers
@@ -653,6 +659,8 @@ u32 CLOCK_getms()
653659
654660void PWR_Sleep () {
655661 Fl::wait (0.1 );
662+ if (singlethread)
663+ ALARMhandler ();
656664}
657665void LCD_ForceUpdate () {
658666 if (changed) {
You can’t perform that action at this time.
0 commit comments