Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

link error on mbed::InterruptIn #86

Closed
@zvilius

Description

@zvilius

Using MbedPinMode parameters with the mbed::InterruptIn class results in link errors.

mbed::InterruptIn chan_a{PinName::P1_11, MbedPinMode::PullNone}; // #1
//mbed::DigitalIn chan_a{PinName::P1_11, MbedPinMode::PullNone}; // #2 is ok
//mbed::InterruptIn chan_a{PinName::P1_11};                      // #3 is ok by itself

void setup()
{
    //chan_a.mode(MbedPinMode::PullNone);       // this (in combination with #3) is bad
}

void loop()
{
}

The error (for case 1) is:
"C:\Users\Zest\Documents\ArduinoData\packages\arduino\hardware\mbed\1.1.4\variants\ARDUINO_NANO33BLE/libs/libcc_310_trng.a" -Wl,--no-whole-archive -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group

C:\Users\Zest\AppData\Local\Temp\arduino_build_748706\sketch\sketch_jun23b.ino.cpp.o: In function `__static_initialization_and_destruction_0':

C:\Users\Zest\Documents\Arduino\sketch_jun23b/sketch_jun23b.ino:1: undefined reference to `mbed::InterruptIn::InterruptIn(PinName, MbedPinMode)'

If I use the mbed::DigitalIn class (case 2) there is no error.
If I use the 1-argument constructor (case 3) there is no error.
However if I use the 1-argument constructor and then call the mode() method (see above), the mode() method fails to link.

Perhaps there is a build issue with the mbed library as it relates to the macro redefinition of the mbed version of PinMode to MbedPinMode? However it works for mbed::DigitalIn.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions