Merge pull request #2280 from blckmn/res_update1

Added brackets around MAX_RESOURCE_INDEX in cli
This commit is contained in:
Martin Budden 2017-02-01 08:15:53 +00:00 committed by GitHub
commit 2ce712658b
1 changed files with 5 additions and 1 deletions

View File

@ -3443,7 +3443,7 @@ static void cliVersion(char *cmdline)
#if defined(USE_RESOURCE_MGMT)
#define MAX_RESOURCE_INDEX(x) (x == 0 ? 1 : x)
#define MAX_RESOURCE_INDEX(x) ((x) == 0 ? 1 : (x))
typedef struct {
const uint8_t owner;
@ -3512,6 +3512,10 @@ static void printResourceOwner(uint8_t owner, uint8_t index)
static void resourceCheck(uint8_t resourceIndex, uint8_t index, ioTag_t tag)
{
if (!tag) {
return;
}
const char * format = "\r\nNOTE: %c%02d already assigned to ";
for (int r = 0; r < (int)ARRAYLEN(resourceTable); r++) {
for (int i = 0; i < MAX_RESOURCE_INDEX(resourceTable[r].maxIndex); i++) {