From a307974e72e6e895468dc9f920f231d4b5aeb6d6 Mon Sep 17 00:00:00 2001 From: luto Date: Fri, 16 Jan 2015 19:10:26 +0100 Subject: [PATCH] fix more PWM edgecases (rapid TOGGLE) --- src/app/js/emulator/emulator.js | 4 ++-- src/app/js/iobank/pin.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/js/emulator/emulator.js b/src/app/js/emulator/emulator.js index f5b8b31..5fc4051 100644 --- a/src/app/js/emulator/emulator.js +++ b/src/app/js/emulator/emulator.js @@ -25,10 +25,10 @@ if (typeof yasp == 'undefined') yasp = { }; /** number of milliseconds between two tickWrapper-calls * @member {Number} */ - this.tickDelay = 100; + this.tickDelay = 50; /** number of ticks inside one tickWrapper call * @member {Number} */ - this.ticksPerTick = 300; + this.ticksPerTick = 150; /** timeout id of the last tickWrapper-setTimeout * @member {Number} */ this.tickTimeout = 0; diff --git a/src/app/js/iobank/pin.js b/src/app/js/iobank/pin.js index d7d13b4..e28e441 100644 --- a/src/app/js/iobank/pin.js +++ b/src/app/js/iobank/pin.js @@ -48,7 +48,7 @@ if (typeof yasp == 'undefined') yasp = { }; this.pwmTimeoutFunc = function () { // called by setTimeout, which resets `this` - pin.setState(pin.state, true); + pin.setState(pin.pwmStatus.state, true); }; this.resetPwm(); @@ -84,7 +84,6 @@ if (typeof yasp == 'undefined') yasp = { }; */ yasp.Pin.prototype.clearPwmTimeout = function () { clearTimeout(this.pwmTimeout); - this.pwmTimeout = null; }; /**