Page 1 of 1

TwoWire class function begin()

Posted: Sat Nov 07, 2020 2:15 pm
by kriss0
Hi All,

i have question while reading the Wire.cpp source code. in the Wire.h there are 4 different function declarations for begin(...), shown below. but in the Wire.cpp file at some point, the code called the function as begin(), with no arguments. this does not match any of the 4 function declarations in the Wire.h. and i could not understand how this call will work. i tried to google cpp overloading examples but found all of them would have at least one arguments in the function call.

Can you help give any clues?

below are the function declarations in Wire.h file:

Code: Select all

    void begin(bool generalCall = false);
    void begin(uint8_t, uint8_t);
    void begin(uint8_t, bool generalCall = false);
    void begin(int, bool generalCall = false);

Re: TwoWire class function begin()

Posted: Sat Nov 07, 2020 2:51 pm
by fpiSTM
begin with no argument simply call the begin with default arguments set to false:

Code: Select all

void begin(bool generalCall = false);