Changed consts such as e, pi, one to macros as suggested by mth for compiler optimization purposes.

This commit is contained in:
Flatmush 2011-02-14 21:53:27 +00:00
parent 87c75fa880
commit e06f826388
2 changed files with 7 additions and 4 deletions

View File

@ -1,10 +1,11 @@
#include "fix16.h"
/* Replaced as defines, these are left here to uncomment for code dependant on the symbols.
const fix16_t fix16_pi = 205887;
const fix16_t fix16_e = 178145;
const fix16_t fix16_one = 0x00010000;
*/

View File

@ -11,11 +11,13 @@ extern "C"
#define fix16_MAX (fix16_t)0x7FFFFFFF /*!< the maximum value of fix16_t */
#define fix16_MIN (fix16_t)0x80000000 /*!< the minimum value of fix16_t */
#define fix16_pi 205887 /*!< fix16_t value of pi */
#define fix16_e 178145 /*!< fix16_t value of e */
#define fix16_one 0x00010000 /*!< fix16_t value of 1 */
typedef int32_t fix16_t;
extern const fix16_t fix16_pi; /*!< fix16_t value of pi */
extern const fix16_t fix16_e; /*!< fix16_t value of e */
extern const fix16_t fix16_one; /*!< fix16_t value of 1 */
/*! Coverts a fix16_t to a double and returns the result.
*/