AP_Math: move is_valid_octal into adsb

This doesn't ensure the value is octal digits - there's more magic in
it.
This commit is contained in:
Peter Barker 2019-09-26 10:50:50 +10:00 committed by Andrew Tridgell
parent 919208c47c
commit 6e4813cc92
2 changed files with 0 additions and 20 deletions

View File

@ -321,23 +321,6 @@ Vector3f rand_vec3f(void)
}
#endif
bool is_valid_octal(uint16_t octal)
{
// treat "octal" as decimal and test if any decimal digit is > 7
if (octal > 7777) {
return false;
} else if (octal % 10 > 7) {
return false;
} else if ((octal % 100)/10 > 7) {
return false;
} else if ((octal % 1000)/100 > 7) {
return false;
} else if ((octal % 10000)/1000 > 7) {
return false;
}
return true;
}
/*
return true if two rotations are equivalent
This copes with the fact that we have some duplicates, like ROLL_180_YAW_90 and PITCH_180_YAW_270

View File

@ -274,9 +274,6 @@ float rand_float(void);
// generate a random Vector3f of size 1
Vector3f rand_vec3f(void);
// confirm a value is a valid octal value
bool is_valid_octal(uint16_t octal) WARN_IF_UNUSED;
// return true if two rotations are equal
bool rotation_equal(enum Rotation r1, enum Rotation r2) WARN_IF_UNUSED;