sparkfun / SparkFun_AS3935_Lightning_Detector_Arduino_Library

Other
37 stars 19 forks source link

maskDisturber function didn't set bit #19

Closed djsirius closed 1 year ago

djsirius commented 1 year ago

Subject of the issue

The disturber masking bit is not set, no matter if i set the value true or false. After i commented out the if statement lines in the file "SparkFun_AS3935.cpp". https://github.com/sparkfun/SparkFun_AS3935_Lightning_Detector_Arduino_Library/blob/2dcc8bae6b1000c60191cee73bbeaefad5e9f213/src/SparkFun_AS3935.cpp#L263

// REG0x03, bit [5], manufacturere default: 0. // This setting will change whether or not disturbers trigger the IRQ Pin. void SparkFun_AS3935::maskDisturber(bool _state) { // if ((_state == true) xor (_state == false)) // return;

_writeRegister(INT_MASK_ANT, DISTURB_MASK, _state, 5);

}

After that the bit got set correct.

Your workbench

edspark commented 1 year ago

I'll take a look ASAP, thanks.

edspark commented 1 year ago

Sorry about that, made a logical misstep with the xor. I just went ahead and removed the check because the function can only take true or false as an argument. Fixed in the latest release.