TwoWire class function begin()

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
kriss0
Posts: 1
Joined: Sat Nov 07, 2020 2:01 pm

TwoWire class function begin()

Post 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);
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: TwoWire class function begin()

Post by fpiSTM »

begin with no argument simply call the begin with default arguments set to false:

Code: Select all

void begin(bool generalCall = false);
Post Reply

Return to “General discussion”