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 da3908c2e5 - Show all commits

View File

@ -162,7 +162,7 @@ intval._stop = function () {
*
*/
intval._watchMicro = function (err, val) {
const NOW = +new Date()
const now = +new Date()
if (err) {
log.error('_watchMicro', err)
}
@ -171,13 +171,13 @@ intval._watchMicro = function (err, val) {
if (val === 0 && intval._state.frame.active) {
if (!intval._state.micro.primed) {
intval._state.micro.primed = true
intval._state.micro.exposure = NOW
intval._state.micro.time = now
//log.info('Microswitch primed to stop motor')
}
} else if (val === 1 && intval._state.frame.active) {
if (intval._state.micro.primed && !intval._state.micro.paused) {
if (intval._state.micro.primed && !intval._state.micro.paused && (now - intval._state.frame.start) > intval._frame.open) {
intval._state.micro.primed = false
intval._state.micro.exposure = 0
intval._state.micro.time = 0
//setTimeout( () => {
intval._stop()
//}, intval._microDelay)