Zanduino / MCP7940

Arduino Library to access the MCP7940M, MCP7940N and MCP7940x Real-Time chips
GNU General Public License v3.0
35 stars 22 forks source link

SetMFP never fails #32

Closed amgrays closed 6 years ago

amgrays commented 6 years ago

SetMFP() should return false if pin is being used for square wave or alarm output. The statement to test the control register (line 538) is incorrect and never gives a true result (to cause function to return false) because of operator precedence ('&' is below equals/not equals test). It should be if ((registerValue & 0x70) != 0)

SV-Zanshin commented 6 years ago

I missed that in testing, thanks. Fixed and committed.