Skip to content

Commit

Permalink
feat: show remapped pins in chip debug reports
Browse files Browse the repository at this point in the history
  • Loading branch information
pillo79 committed Nov 28, 2023
1 parent 2dce29f commit 0d360bd
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cores/esp32/chip-debug-report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ static void printBoardInfo(void){
static void printPerimanInfo(void){
chip_report_printf("GPIO Info:\n");
chip_report_printf("------------------------------------------\n");
#if defined(BOARD_HAS_PIN_REMAP)
chip_report_printf(" DPIN|GPIO : BUS_TYPE[bus/unit][chan]\n");
#else
chip_report_printf(" GPIO : BUS_TYPE[bus/unit][chan]\n");
#endif
chip_report_printf(" -------------------------------------- \n");
for(uint8_t i = 0; i < SOC_GPIO_PIN_COUNT; i++){
if(!perimanPinIsValid(i)){
Expand All @@ -252,8 +256,17 @@ static void printPerimanInfo(void){
if(type == ESP32_BUS_TYPE_INIT){
continue;//unused pin
}
const char* extra_type = perimanGetPinBusExtraType(i);
#if defined(BOARD_HAS_PIN_REMAP)
int dpin = gpioNumberToDigitalPin(i);
if (dpin < 0) {
continue;//pin is not exported
} else {
chip_report_printf(" D%-3d|%4u : ", dpin, i);
}
#else
chip_report_printf(" %4u : ", i);
#endif
const char* extra_type = perimanGetPinBusExtraType(i);
if(extra_type){
chip_report_printf("%s", extra_type);
}
Expand Down

0 comments on commit 0d360bd

Please sign in to comment.