1
0
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:
James Cotton 2012-08-03 12:43:50 -05:00
parent ccbbda1b51
commit 8eac518a9c

View File

@ -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];