wayoda / LedControl

An Arduino library for MAX7219 and MAX7221 Led display drivers
Other
464 stars 243 forks source link

Minor test issues in setScanLimit() and setIntensity() methods #4

Closed bertsierra closed 9 years ago

bertsierra commented 9 years ago

I’ve spotted a couple of minor issues with the setScanLimit() and setIntensity() methods. The test ‘limit>=0 || limit<8’ on line 88 is always true, so spiTransfer is called even with bad limit values. Line 88 should be corrected as shown below:

if(limit>=0 && limit<8)

Similarly, on line 95 there is a test ‘intensity>=0 || intensity<16’ which is always true no matter what. Line 95 should be corrected as shown below:

if(intensity>=0 && intensity<16)

wayoda commented 9 years ago

Hi bertsierra, thanks for reporting the issue. I pushed the change to the repo, but before I do a new release I have to a hardware test (which will not happen before tomorrow).

Cheers Eberhard

wayoda commented 9 years ago

Tested your fix on my hardware and made a new release!

Thanks @bertsierra