From 49d855e30624134bc9850dce3dc5660ce5ebc328 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Mon, 2 Sep 2024 11:53:12 -0400 Subject: [PATCH] Change calls to pinMap --- src/custom_modules/functions.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/custom_modules/functions.js b/src/custom_modules/functions.js index fcaf638..80beec0 100644 --- a/src/custom_modules/functions.js +++ b/src/custom_modules/functions.js @@ -64,45 +64,45 @@ module.exports = { }).catch(e => console.error(e)); // Power on igniter - gpio.setPin(process.pinMap.igniter.board, 1).then(async () => { + gpio.setPin(process.pinMap.get('igniter').board, 1).then(async () => { // Wait for igniter preheat await module.exports.sleep(config.power.start.exhaustDelay); }).catch(e => console.error(e)); // Start exhaust - gpio.setPin(process.pinMap.exhaust.board, 1).then(async () => { + gpio.setPin(process.pinMap.get('exhaust').board, 1).then(async () => { // Finish igniter preheat await module.exports.sleep(config.power.start.augerDelay); }).catch(e => console.error(e)); // Check for vacuum - gpio.readPin(process.pinMap.vacuum.board).then(state => { + gpio.readPin(process.pinMap.get('vacuum').board).then(state => { if (state === '0') { // Power off exhaust - gpio.setPin(process.pinMap.exhaust.board, 0).then(() => { + gpio.setPin(process.pinMap.get('exhaust').board, 0).then(() => { // Report vacuum failure reject(new Error('Vacuum failure.')); return; }).catch(e => console.error(e)); } else { // Start auger - gpio.setPin(process.pinMap.auger.board, 1).then(async () => { + gpio.setPin(process.pinMap.get('auger').board, 1).then(async () => { // Wait for fire await module.exports.sleep(config.power.start.fireCheckDelay); // Power off igniter - gpio.setPin(process.pinMap.igniter.board, 0).then(() => { + gpio.setPin(process.pinMap.get('igniter').board, 0).then(() => { // Check for fire on pof - gpio.readPin(process.pinMap.pof.board).then(state => { + gpio.readPin(process.pinMap.get('pof').board).then(state => { if (state === '0') { // Power off auger - gpio.setPin(process.pinMap.auger.board, 0).then(() => { + gpio.setPin(process.pinMap.get('auger').board, 0).then(() => { // Report failed ignition reject(new Error('Failed ignition.')); }).catch(e => console.error(e)); } else { // Power off auger - gpio.setPin(process.pinMap.auger.board, 0).then(() => { + gpio.setPin(process.pinMap.get('auger').board, 0).then(() => { // Report successful ignition resolve('Successful ignition.'); }).catch(e => console.error(e));