AP_RPM: instance range should use define instead of hardcoded value

This commit is contained in:
Tom Pittenger 2019-02-07 00:00:36 -07:00 committed by Tom Pittenger
parent a117e4571d
commit d27cd19daa

View File

@ -32,7 +32,7 @@ public:
virtual void update() = 0;
int8_t get_pin(void) const {
if (state.instance > 1) {
if (state.instance >= RPM_MAX_INSTANCES) {
return -1;
}
return ap_rpm._pin[state.instance].get();