Permalink
Browse files

Remove fatal when sol pulsing while one is already running.

This does not warrant a fatal, but really indicates a programmer
bug.  Now just exit without trying to pulse anything.

Test mode is now careful not to restart a pulse if it sees one
is still running, since it uses async requests.
  • Loading branch information...
1 parent 1b6703a commit 368a97c68e8cbdb82a963a94ffbc7f3078bc2ec9 @bcd committed Jul 6, 2011
Showing with 12 additions and 2 deletions.
  1. +9 −1 kernel/sol.c
  2. +3 −1 test/window.c
View
@@ -126,8 +126,16 @@ sol_req_start_specific (U8 sol, U8 mask, U8 time)
{
dbprintf ("Starting pulse %d now.\n", sol);
+ /* If the timer is nonzero, another request is already running.
+ This shouldn't happen. The solenoid code takes care not to start
+ a request when something is already active. The test mode code
+ calls this directly and bypasses those checks, but it enforces a delay
+ between pulses so it shouldn't occur. */
if (sol_pulse_timer != 0)
- fatal (ERR_SOL_REQUEST);
+ {
+ nonfatal (ERR_SOL_REQUEST);
+ return;
+ }
req_reg_write = sol_get_write_reg (sol);
if (req_reg_write == (IOPTR)0)
View
@@ -3126,10 +3126,12 @@ void solenoid_test_draw (void)
void solenoid_test_enter (void)
{
+ extern U8 sol_pulse_timer;
U8 sel = win_top->w_class.menu.selected;
+ if (sol_pulse_timer != 0)
+ return;
task_sleep (TIME_100MS);
sol_req_start_specific (sel, sol_duty_masks[sol_duty_level], browser_action);
- task_sleep (TIME_100MS);
}
void flasher_test_enter (void)

0 comments on commit 368a97c

Please sign in to comment.