diff --git a/drivers/math/math.c b/drivers/math/math.c index 9adc6886c06..7e7105028a6 100644 --- a/drivers/math/math.c +++ b/drivers/math/math.c @@ -127,6 +127,7 @@ static int math_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { /* CORDIC calulcate */ +#ifdef CONFIG_MATH_CORDIC case MATHIOC_CORDIC_CALC: { FAR struct cordic_calc_s *calc = @@ -139,7 +140,9 @@ static int math_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; } +#endif +#ifdef CONFIG_MATH_FFT case MATHIOC_FFT_CALC: { FAR struct fft_calc_s *calc = @@ -152,6 +155,7 @@ static int math_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; } +#endif } leave_critical_section(flags); @@ -215,6 +219,7 @@ errout: * ****************************************************************************/ +#ifdef CONFIG_MATH_CORDIC int cordic_register(FAR const char *path, FAR struct cordic_lowerhalf_s *lower) { @@ -225,6 +230,7 @@ int cordic_register(FAR const char *path, return math_register(path, &config); } +#endif /**************************************************************************** * Name: fft_register @@ -234,6 +240,7 @@ int cordic_register(FAR const char *path, * ****************************************************************************/ +#ifdef CONFIG_MATH_FFT int fft_register(FAR const char *path, FAR struct fft_lowerhalf_s *lower) { @@ -244,3 +251,4 @@ int fft_register(FAR const char *path, return math_register(path, &config); } +#endif diff --git a/include/nuttx/math/cordic.h b/include/nuttx/math/cordic.h index fc83bdfc615..c4c6e40e5d5 100644 --- a/include/nuttx/math/cordic.h +++ b/include/nuttx/math/cordic.h @@ -119,6 +119,8 @@ struct cordic_calc_s /* CORDIC request configuration */ uint8_t func; /* CORDIC function */ + int8_t input_scale; /* CORDIC input scale factor */ + int8_t output_scale; /* CORDIC output scale factor */ bool res2_incl; /* Include secondary result if available */ /* Input data */ diff --git a/include/nuttx/math/math.h b/include/nuttx/math/math.h index a589416e4e4..bdd470c501c 100644 --- a/include/nuttx/math/math.h +++ b/include/nuttx/math/math.h @@ -25,8 +25,12 @@ * Included Files ****************************************************************************/ +#ifdef CONFIG_MATH_CORDIC #include +#endif +#ifdef CONFIG_MATH_FFT #include +#endif /**************************************************************************** * Public Types @@ -39,8 +43,12 @@ struct math_config_s { +#ifdef CONFIG_MATH_CORDIC FAR struct cordic_lowerhalf_s *cordic; +#endif +#ifdef CONFIG_MATH_FFT FAR struct fft_lowerhalf_s *fft; +#endif }; /****************************************************************************