Skip to content

Commit

Permalink
Fix beagleboard#52 : consider case when mux mode is not fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
vaishnavachath authored and Jason Kridner committed Aug 15, 2019
1 parent 1dcc7ff commit 128044e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ f.digitalWrite = function (pin, value, callback) {
if (debug) winston.debug('digitalWrite(' + [pin.key, value] + ');');
value = parseInt(Number(value), 2) ? 1 : 0;
//handle case digitalWrite() on Analog_Out
if (typeof pin.pwm != 'undefined') {
if (typeof pin.pwm != 'undefined' && typeof f.getPinMode(pin).mux != 'undefined') {
var gpioEnabled = (7 == f.getPinMode(pin).mux); //check whether pin set as gpio
if (!gpioEnabled) {
winston.debug([pin.key, value] + ' set as ANALOG_OUTPUT modifying duty cycle according to value');
Expand Down

0 comments on commit 128044e

Please sign in to comment.