Subversion Repositories FlightCtrl

Rev

Rev 2045 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2045 Rev 2048
Line 230... Line 230...
230
    sign = -sign;
230
    sign = -sign;
231
  }
231
  }
232
  result = pgm_read_word(&TAN_TABLE[(uint8_t) arg]);
232
  result = pgm_read_word(&TAN_TABLE[(uint8_t) arg]);
233
  return (sign == 1) ? result : -result;
233
  return (sign == 1) ? result : -result;
234
}
234
}
-
 
235
 
-
 
236
void intervalWrap(int32_t *number, int32_t limit) {
-
 
237
  if (*number >= limit) {
-
 
238
    *number -= limit; // 360 deg. wrap
-
 
239
  } else if (*number < 0) {
-
 
240
    *number += limit;
-
 
241
  }
-
 
242
}