This fixes some issues with the new arduino-cli, since compling a lot of libraries forces linking them as archives, breaking the inline. Must be tested in the CI to make sure it dones't break anyhing
21 lines
397 B
C++
21 lines
397 B
C++
#include "Arduino.h"
|
|
#include "pinDefinitions.h"
|
|
|
|
int PinNameToIndex(PinName P) {
|
|
for (pin_size_t i=0; i < PINS_COUNT; i++) {
|
|
if (g_APinDescription[i].name == P) {
|
|
return i;
|
|
}
|
|
}
|
|
return NOT_A_PIN;
|
|
}
|
|
|
|
#ifdef __cplusplus__
|
|
extern "C" {
|
|
#endif
|
|
PinName digitalPinToPinName(pin_size_t P) {
|
|
return (P >= PINS_COUNT ? NC : g_APinDescription[P].name);
|
|
};
|
|
#ifdef __cplusplus__
|
|
}
|
|
#endif |