Skip to content

Commit 0d360bd

Browse files
committed
feat: show remapped pins in chip debug reports
1 parent 2dce29f commit 0d360bd

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Diff for: cores/esp32/chip-debug-report.cpp

+14-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ static void printBoardInfo(void){
242242
static void printPerimanInfo(void){
243243
chip_report_printf("GPIO Info:\n");
244244
chip_report_printf("------------------------------------------\n");
245+
#if defined(BOARD_HAS_PIN_REMAP)
246+
chip_report_printf(" DPIN|GPIO : BUS_TYPE[bus/unit][chan]\n");
247+
#else
245248
chip_report_printf(" GPIO : BUS_TYPE[bus/unit][chan]\n");
249+
#endif
246250
chip_report_printf(" -------------------------------------- \n");
247251
for(uint8_t i = 0; i < SOC_GPIO_PIN_COUNT; i++){
248252
if(!perimanPinIsValid(i)){
@@ -252,8 +256,17 @@ static void printPerimanInfo(void){
252256
if(type == ESP32_BUS_TYPE_INIT){
253257
continue;//unused pin
254258
}
255-
const char* extra_type = perimanGetPinBusExtraType(i);
259+
#if defined(BOARD_HAS_PIN_REMAP)
260+
int dpin = gpioNumberToDigitalPin(i);
261+
if (dpin < 0) {
262+
continue;//pin is not exported
263+
} else {
264+
chip_report_printf(" D%-3d|%4u : ", dpin, i);
265+
}
266+
#else
256267
chip_report_printf(" %4u : ", i);
268+
#endif
269+
const char* extra_type = perimanGetPinBusExtraType(i);
257270
if(extra_type){
258271
chip_report_printf("%s", extra_type);
259272
}

0 commit comments

Comments
 (0)