Add graceful shutdown
This commit is contained in:
parent
4eed28046f
commit
2a49263797
@ -135,6 +135,15 @@ process.comlink.on('feedRate', (message) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
process.on('SIGINT', () => {
|
||||||
|
fn.log(`Exiting gracefully...`, 'INFO');
|
||||||
|
// Fail-safe to turn off all the outputs and keep the exhaust fan on
|
||||||
|
gpio.setPin(process.pinMap.get('auger').board, 0);
|
||||||
|
gpio.setPin(process.pinMap.get('igniter').board, 0);
|
||||||
|
gpio.setPin(process.pinMap.get('exhaust').board, 0); // Exhaust 0: On 1: Off
|
||||||
|
process.exit();
|
||||||
|
});
|
||||||
|
|
||||||
/***************************************************************************************/
|
/***************************************************************************************/
|
||||||
// Call Things
|
// Call Things
|
||||||
/***************************************************************************************/
|
/***************************************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user