Naguissa / uMuxOutputLib

Arduino, ESP8266 and STM32 multiplexed outputs library
GNU Lesser General Public License v3.0
2 stars 0 forks source link

Constructor with frequency parameter doesn't work #2

Closed FOp42 closed 5 months ago

FOp42 commented 6 months ago

If I try to set the multiplex frequency, the object doesn't work at all because _nmuxes contains 0 instead of the given parameter nmuxes. Calling one constructor from the other doesn't seem to work as expected. Others gave me this hints: You create a nameless local object of type uMuxOutputLib in your constructor uMuxOutputLib, which is then immediately destroyed again. This local Object has nothing to do with the first. So the parameters all end up in Nirvana. Please try member initialization and delegating constructor. This is how you do it from C++11.

FOp42 commented 6 months ago

It should be possible to set a default value for the parameter frequency to have only one constructor instead of two while keeping the behavior to the user like described.

FOp42 commented 6 months ago

proposal.zip

Naguissa commented 5 months ago

Thanks for the report and proposal.

What IDE/Compiler and board are you using?

I tested it several months ago with Arduino IDE and few boards and I didn-t faced that problem< I-ll retest it again.

Cheers!

FOp42 commented 5 months ago

Software used :

Board selected :

Naguissa commented 5 months ago

Solved on new 1.0.3 release: https://github.com/Naguissa/uMuxOutputLib/releases

Thanks for reporting.