mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-01 18:21:39 +02:00
use mChList[] instead of switch-case
(cherry picked from commit fdaf80e964a6ecb2423b0c1d8d03bb0184904ab8) (cherry picked from commit 48c832be5eb05a96204fa1ec70fdf198e06ac94d) (cherry picked from commit effe05a616615d709455d32c46c2254c8cfe399e)
This commit is contained in:
parent
58044c34aa
commit
199d4b3873
1 changed files with 5 additions and 8 deletions
|
@ -217,15 +217,12 @@ class Heuristic {
|
|||
}
|
||||
|
||||
inline uint8_t id2Ch(uint8_t id) {
|
||||
switch(id) {
|
||||
case 0: return 3;
|
||||
case 1: return 23;
|
||||
case 2: return 40;
|
||||
case 3: return 61;
|
||||
case 4: return 75;
|
||||
}
|
||||
return 3; // standard
|
||||
if (id < RF_MAX_CHANNEL_ID)
|
||||
return mChList[id];
|
||||
else
|
||||
return 3; // standard
|
||||
}
|
||||
uint8_t mChList[RF_MAX_CHANNEL_ID] = {03, 23, 40, 61, 75};
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue