adafruit / Adafruit_AS7341

Other
29 stars 18 forks source link

setBank() missing return statement (causes uC hang) #1

Closed stephenf7072 closed 4 years ago

stephenf7072 commented 4 years ago

Hi Brian, Thanks for a great library, I've just discovered in time to (partly, anyway) save myself writing one for my custom AS7341 board. I'm just in the process of integrating into my project.

I have noticed that trying to configure the LED was making my microcontroller hang, and tracked it down to the lack of a bool return statement in Adafruit_AS7341::setBank(). So either setCurrent() or setLEDCurrent() will cause this.

I changed the last line of setBank() to return bank_bit.write(low); and all is good. It doesn't seem like anything is actually using the return value though.

Cheers, Stephen

stephenf7072 commented 4 years ago

Fixed in Pull Request #2