Browse Source

use mChList[] instead of switch-case

(cherry picked from commit fdaf80e964a6ecb2423b0c1d8d03bb0184904ab8)
(cherry picked from commit 48c832be5eb05a96204fa1ec70fdf198e06ac94d)
(cherry picked from commit effe05a616615d709455d32c46c2254c8cfe399e)
pull/1465/head
you69man 1 year ago
parent
commit
199d4b3873
  1. 13
      src/hm/Heuristic.h

13
src/hm/Heuristic.h

@ -217,15 +217,12 @@ class Heuristic {
} }
inline uint8_t id2Ch(uint8_t id) { inline uint8_t id2Ch(uint8_t id) {
switch(id) { if (id < RF_MAX_CHANNEL_ID)
case 0: return 3; return mChList[id];
case 1: return 23; else
case 2: return 40; return 3; // standard
case 3: return 61;
case 4: return 75;
}
return 3; // standard
} }
uint8_t mChList[RF_MAX_CHANNEL_ID] = {03, 23, 40, 61, 75};
}; };

Loading…
Cancel
Save