parent
48bfb67a22
commit
014b8293a5
|
@ -252,6 +252,5 @@ const char *portname(ioportid_t GPIOx);
|
|||
|
||||
void printSpiConfig(const char *msg, spi_device_e device);
|
||||
brain_pin_e parseBrainPin(const char *str);
|
||||
const char *hwPortname(brain_pin_e brainPin);
|
||||
|
||||
extern EnginePins enginePins;
|
||||
|
|
|
@ -189,6 +189,10 @@ void printSpiConfig(const char *msg, spi_device_e device) {
|
|||
#endif // HAL_USE_SPI
|
||||
}
|
||||
|
||||
__attribute__((weak)) const char * getBoardSpecificPinName(brain_pin_e brainPin) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char *hwPortname(brain_pin_e brainPin) {
|
||||
if (brainPin == GPIO_INVALID) {
|
||||
return "INVALID";
|
||||
|
@ -196,6 +200,11 @@ const char *hwPortname(brain_pin_e brainPin) {
|
|||
if (brainPin == GPIO_UNASSIGNED) {
|
||||
return "NONE";
|
||||
}
|
||||
const char * boardSpecificPinName = getBoardSpecificPinName(brainPin);
|
||||
if (boardSpecificPinName != nullptr) {
|
||||
return boardSpecificPinName;
|
||||
}
|
||||
|
||||
portNameStream.eos = 0; // reset
|
||||
if (brain_pin_is_onchip(brainPin)) {
|
||||
|
||||
|
|
|
@ -58,6 +58,8 @@ int getBrainPinIndex(brain_pin_e brainPin);
|
|||
int brainPin_to_index(brain_pin_e brainPin);
|
||||
unsigned int getBrainPinOnchipNum(void);
|
||||
unsigned int getBrainPinTotalNum(void);
|
||||
const char *hwPortname(brain_pin_e brainPin);
|
||||
const char * getBoardSpecificPinName(brain_pin_e brainPin);
|
||||
|
||||
#ifdef __cplusplus
|
||||
const char* & getBrainUsedPin(unsigned int idx);
|
||||
|
|
Loading…
Reference in New Issue