diff options
Diffstat (limited to 'apps/plugins/fft/fft.c')
-rw-r--r-- | apps/plugins/fft/fft.c | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/apps/plugins/fft/fft.c b/apps/plugins/fft/fft.c index eeb6611488..4719446475 100644 --- a/apps/plugins/fft/fft.c +++ b/apps/plugins/fft/fft.c @@ -334,16 +334,7 @@ GREY_INFO_STRUCT # define FFT_AMP_SCALE BUTTON_PLAY # define FFT_QUIT BUTTON_POWER -#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) -# define FFT_PREV_GRAPH BUTTON_PREV -# define FFT_NEXT_GRAPH BUTTON_NEXT -# define FFT_ORIENTATION BUTTON_HOME -# define FFT_FREQ_SCALE BUTTON_OPTION -# define FFT_WINDOW (BUTTON_HOME|BUTTON_POWER) -# define FFT_AMP_SCALE BUTTON_PLAY -# define FFT_QUIT BUTTON_POWER - -#elif (CONFIG_KEYPAD == XDUOO_X20_PAD) +#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) # define FFT_PREV_GRAPH BUTTON_PREV # define FFT_NEXT_GRAPH BUTTON_NEXT # define FFT_ORIENTATION BUTTON_HOME @@ -361,7 +352,7 @@ GREY_INFO_STRUCT # define FFT_AMP_SCALE BUTTON_PLAY # define FFT_QUIT BUTTON_POWER -#elif (CONFIG_KEYPAD == IHIFI_770_PAD) +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) # define FFT_PREV_GRAPH BUTTON_PREV # define FFT_NEXT_GRAPH BUTTON_NEXT # define FFT_ORIENTATION BUTTON_HOME @@ -370,13 +361,13 @@ GREY_INFO_STRUCT # define FFT_AMP_SCALE BUTTON_PLAY # define FFT_QUIT BUTTON_POWER -#elif (CONFIG_KEYPAD == IHIFI_800_PAD) -# define FFT_PREV_GRAPH BUTTON_PREV -# define FFT_NEXT_GRAPH BUTTON_NEXT -# define FFT_ORIENTATION BUTTON_HOME -# define FFT_FREQ_SCALE BUTTON_VOL_UP -# define FFT_WINDOW BUTTON_VOL_DOWN -# define FFT_AMP_SCALE BUTTON_PLAY +#elif (CONFIG_KEYPAD == EROSQ_PAD) +# define FFT_PREV_GRAPH BUTTON_SCROLL_BACK +# define FFT_NEXT_GRAPH BUTTON_SCROLL_FWD +# define FFT_ORIENTATION BUTTON_VOL_UP +# define FFT_FREQ_SCALE BUTTON_VOL_DOWN +# define FFT_WINDOW BUTTON_BACK +# define FFT_AMP_SCALE BUTTON_MENU # define FFT_QUIT BUTTON_POWER #elif !defined(HAVE_TOUCHSCREEN) @@ -530,7 +521,7 @@ static struct fft_config int amp_scale; int freq_scale; int window_func; -} fft_disk = +} fft_disk = { /* Defaults */ .orientation = FFT_OR_VERT, @@ -647,7 +638,7 @@ static void apply_window_func(enum fft_window_func mode) /* Calculates the magnitudes from complex numbers and returns the maximum */ static unsigned calc_magnitudes(enum fft_amp_scale scale) { - /* A major assumption made when calculating the Q*MAX constants + /* A major assumption made when calculating the Q*MAX constants * is that the maximum magnitude is 29 bits long. */ unsigned this_max = 0; kiss_fft_cpx *this_output = output[output_head] + 1; /* skip DC */ @@ -806,7 +797,7 @@ static void draw_lines_vertical(unsigned this_max, unsigned graph_max) { int bins_acc = LCD_WIDTH / 2; unsigned bins_max = 0; - + for(int i = 0, x = 0; i < ARRAYLEN_PLOT; ++i) { unsigned bin = plot[i]; @@ -1107,7 +1098,7 @@ static inline bool fft_get_fft(void) /* This block can introduce discontinuities in our data. Meaning, the * FFT will not be done a continuous segment of the signal. Which can * be bad. Or not. - * + * * Anyway, this is a demo, not a scientific tool. If you want accuracy, * do a proper spectrum analysis.*/ @@ -1409,7 +1400,7 @@ static void fft_setting_update(unsigned which) [FFT_OR_HORZ] = draw_bars_horizontal, [FFT_OR_VERT] = draw_bars_vertical, }, - [FFT_DM_SPECTROGRAM] = + [FFT_DM_SPECTROGRAM] = { [FFT_OR_HORZ] = draw_spectrogram_horizontal, [FFT_OR_VERT] = draw_spectrogram_vertical, @@ -1533,7 +1524,7 @@ static void fft_cleanup(void) { myosd_destroy(); - fft_close_fft(); + fft_close_fft(); #ifdef HAVE_ADJUSTABLE_CPU_FREQ rb->cancel_cpu_boost(); |