Browse Source

fix that assert

copy 9 years ago
parent
commit
90f4ff5d3a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/pit.js

+ 2 - 1
src/pit.js

@@ -72,6 +72,8 @@ PIT.prototype.get_timer2 = function()
 
 PIT.prototype.timer = function(time, no_irq)
 {
+    dbg_assert(time >= this.next_tick);
+
     var current,
         mode,
         steps = (time - this.next_tick) * OSCILLATOR_FREQ >>> 0;
@@ -80,7 +82,6 @@ PIT.prototype.timer = function(time, no_irq)
     {
         return;
     }
-    dbg_assert(steps >= 0);
 
     this.next_tick += steps / OSCILLATOR_FREQ;