mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Clarified resource remapping output and fixed output in case of double mapping.
This commit is contained in:
parent
ed1ba7a89a
commit
950ed79749
1 changed files with 19 additions and 7 deletions
|
@ -3373,9 +3373,18 @@ static void printResource(uint8_t dumpMask, const master_t *defaultConfig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void printResourceOwner(uint8_t owner, uint8_t index)
|
||||||
|
{
|
||||||
|
cliPrintf("%s", ownerNames[resourceTable[owner].owner]);
|
||||||
|
|
||||||
|
if (resourceTable[owner].maxIndex > 0) {
|
||||||
|
cliPrintf(" %d", RESOURCE_INDEX(index));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void resourceCheck(uint8_t resourceIndex, uint8_t index, ioTag_t tag)
|
static void resourceCheck(uint8_t resourceIndex, uint8_t index, ioTag_t tag)
|
||||||
{
|
{
|
||||||
const char * format = "\r\n* NOTE * %c%d moved from %s";
|
const char * format = "\r\nNOTE: %c%02d already assigned to ";
|
||||||
for (int r = 0; r < (int)ARRAYLEN(resourceTable); r++) {
|
for (int r = 0; r < (int)ARRAYLEN(resourceTable); r++) {
|
||||||
for (int i = 0; i < MAX_RESOURCE_INDEX(resourceTable[r].maxIndex); i++) {
|
for (int i = 0; i < MAX_RESOURCE_INDEX(resourceTable[r].maxIndex); i++) {
|
||||||
if (*(resourceTable[r].ptr + i) == tag) {
|
if (*(resourceTable[r].ptr + i) == tag) {
|
||||||
|
@ -3388,14 +3397,17 @@ static void resourceCheck(uint8_t resourceIndex, uint8_t index, ioTag_t tag)
|
||||||
cleared = true;
|
cleared = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cliPrintf(format, DEFIO_TAG_GPIOID(tag) + 'A', DEFIO_TAG_PIN(tag), ownerNames[resourceTable[r].owner]);
|
cliPrintf(format, DEFIO_TAG_GPIOID(tag) + 'A', DEFIO_TAG_PIN(tag));
|
||||||
if (resourceTable[r].maxIndex > 0) {
|
|
||||||
cliPrintf(" %d", RESOURCE_INDEX(i));
|
printResourceOwner(r, i);
|
||||||
}
|
|
||||||
if (cleared) {
|
if (cleared) {
|
||||||
cliPrintf(". Cleared.");
|
cliPrintf(". ");
|
||||||
|
printResourceOwner(r, i);
|
||||||
|
cliPrintf(" disabled");
|
||||||
}
|
}
|
||||||
cliPrint("\r\n");
|
|
||||||
|
cliPrint(".\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue