diff options
Diffstat (limited to 'backport/backport-include/linux/cordic.h')
-rw-r--r-- | backport/backport-include/linux/cordic.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backport/backport-include/linux/cordic.h b/backport/backport-include/linux/cordic.h index 7f27b007..67d6a4ae 100644 --- a/backport/backport-include/linux/cordic.h +++ b/backport/backport-include/linux/cordic.h @@ -57,4 +57,16 @@ struct cordic_iq cordic_calc_iq(s32 theta); #endif /* __CORDIC_H_ */ #endif /* LINUX_VERSION_CODE > KERNEL_VERSION(3,1,0)) */ + +#ifndef CORDIC_FLOAT +#define CORDIC_ANGLE_GEN 39797 +#define CORDIC_PRECISION_SHIFT 16 +#define CORDIC_NUM_ITER (CORDIC_PRECISION_SHIFT + 2) + +#define CORDIC_FIXED(X) ((s32)((X) << CORDIC_PRECISION_SHIFT)) +#define CORDIC_FLOAT(X) (((X) >= 0) \ + ? ((((X) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1) \ + : -((((-(X)) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1)) +#endif + #endif /* _BACKPORT_LINUX_CORDIC_H */ |