File tree 3 files changed +31
-7
lines changed
3 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 20
20
| --- | -------------------------------------------- |
21
21
| h | Shows this information. |
22
22
| q | Quits Run Mode. Switches back to Admin Mode. |
23
+ | Q | Reloads sketch. |
23
24
| w | Toggles window layout mode. |
24
25
25
26
### Step/Go-to
Original file line number Diff line number Diff line change @@ -384,9 +384,24 @@ void cmdLoop()
384
384
stop = atoi (command [1 ]);
385
385
stop = checkRange (HEAL , "step" , stop );
386
386
387
- runMode (stop );
388
- if (stop == 0 )
389
- putMsg (2 , "Back in Admin Mode!" );
387
+ while (1 )
388
+ {
389
+ int status = runMode (stop );
390
+
391
+ if (status == 1 )
392
+ {
393
+ // reload sketch (Q)
394
+ g_scenSource = 0 ;
395
+ loadCurrentSketch ();
396
+ }
397
+ else
398
+ {
399
+ // quit runMode (q)
400
+ break ;
401
+ }
402
+ }
403
+
404
+ if (stop == 0 ) putMsg (2 , "Back in Admin Mode!" );
390
405
}
391
406
else if (strstr (sstr , "res" )) // reset simulation
392
407
{
@@ -647,7 +662,7 @@ void cmdLoop()
647
662
}
648
663
}
649
664
650
- void runMode (int stop )
665
+ int runMode (int stop )
651
666
{
652
667
int step , res = 0 , ok = 0 ;
653
668
char ch , tempName [80 ], syscom [120 ], temp [80 ];
@@ -662,7 +677,8 @@ void runMode(int stop)
662
677
stop = g_steps ;
663
678
//if(stop > currentStep)
664
679
runAll (stop );
665
- return ;
680
+ // quit runMode
681
+ return 0 ;
666
682
}
667
683
668
684
putMsg (3 , "Run Mode. Press h for help." );
@@ -683,8 +699,13 @@ void runMode(int stop)
683
699
switch (ch )
684
700
{
685
701
case 'q' :
686
- return ;
702
+ // quit runMode
703
+ return 0 ;
704
+ case 'Q' :
705
+ // reload sketch
706
+ return 1 ;
687
707
case 'h' :
708
+ // help
688
709
readMsg (fileInfoRun );
689
710
break ;
690
711
case 'i' :
@@ -866,6 +887,8 @@ putMsg(2,syscom);
866
887
putMsg (msg_h - 2 , temp );
867
888
}
868
889
}
890
+
891
+ return 0 ;
869
892
}
870
893
871
894
int main (/* int argc, char *argv[] */ )
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ void mLog1(const char *p, int value1);
9
9
void wLog1 (const char * p , int value1 );
10
10
void wLog2 (const char * p , int value1 , int value2 );
11
11
void debug (char * msg );
12
- void runMode (int stop );
12
+ int runMode (int stop );
13
13
int runStep (int dir );
14
14
void cmdLoop ();
15
15
void iDelay (int ms );
You can’t perform that action at this time.
0 commit comments