mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
If the sin table is empty don't attempt to use it and return 0.
This commit is contained in:
parent
ccbbda1b51
commit
8eac518a9c
@ -97,6 +97,9 @@ int sin_lookup_initalize()
|
||||
*/
|
||||
float sin_lookup_deg(float angle)
|
||||
{
|
||||
if (sin_table == NULL)
|
||||
return 0;
|
||||
|
||||
int i_ang = ((int32_t) angle) % 360;
|
||||
if (i_ang > 180) // for 180 to 270 deg
|
||||
return -sin_table[i_ang - 180];
|
||||
|
Loading…
x
Reference in New Issue
Block a user