Push dev work to master #2

Merged
sixteenmillimeter merged 416 commits from dev into master 2018-07-19 15:29:02 +00:00
1 changed files with 4 additions and 4 deletions
Showing only changes of commit b7dd9e4fa1 - Show all commits

View File

@ -124,8 +124,8 @@ intval._startBwd = function () {
intval._stop = function () { intval._stop = function () {
intval._pin.fwd.writeSync(0) intval._pin.fwd.writeSync(0)
intval._pin.bwd.writeSync(0) intval._pin.bwd.writeSync(0)
const now = +new Date()
let len = (+new Date()) - intval._state.frame.start const len = now - intval._state.frame.start
log.info(`Frame stopped ${len}ms`) log.info(`Frame stopped ${len}ms`)
@ -158,14 +158,14 @@ intval._watchMicro = function (err, val) {
if (!intval._state.micro.primed) { if (!intval._state.micro.primed) {
intval._state.micro.primed = true intval._state.micro.primed = true
intval._state.micro.time = NOW intval._state.micro.time = NOW
log.info('Mircoswitch primed to stop motor') log.info('Microswitch primed to stop motor')
} }
} else if (val === 1 && intval._state.frame.active) { } else if (val === 1 && intval._state.frame.active) {
if (intval._state.micro.primed) { if (intval._state.micro.primed) {
intval._state.micro.primed = false intval._state.micro.primed = false
intval._state.micro.time = 0 intval._state.micro.time = 0
setTimeout( () => { setTimeout( () => {
log.info(`Stopped frame after ${NOW - intval._state.micro.time}ms`) intval._stop()
}, intval._microDelay) }, intval._microDelay)
} }
} }