get index of parameter counting only those capable of representation as float */
| 70 | get index of parameter counting only those capable of representation as float |
| 71 | */ |
| 72 | int16_t Parameters::param_index_float(const Parameters::Param *f) |
| 73 | { |
| 74 | uint16_t count = 0; |
| 75 | for (const auto &p : params) { |
| 76 | if (p.flags & PARAM_FLAG_HIDDEN) { |
| 77 | continue; |
| 78 | } |
| 79 | switch (p.ptype) { |
| 80 | case ParamType::UINT8: |
| 81 | case ParamType::INT8: |
| 82 | case ParamType::UINT32: |
| 83 | case ParamType::FLOAT: |
| 84 | if (&p == f) { |
| 85 | return count; |
| 86 | } |
| 87 | count++; |
| 88 | break; |
| 89 | } |
| 90 | } |
| 91 | return -1; |
| 92 | } |
| 93 | |
| 94 | /* |
| 95 | find by name |
no outgoing calls
no test coverage detected