diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/recorder/radio.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index 9eac63a520..d60d1bd4d7 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "config.h" | 20 | #include "config.h" |
21 | #include <stdio.h> | 21 | #include <stdio.h> |
22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
23 | #include <stdlib.h> | ||
23 | #include "sprintf.h" | 24 | #include "sprintf.h" |
24 | #include "lcd.h" | 25 | #include "lcd.h" |
25 | #include "mas.h" | 26 | #include "mas.h" |
@@ -160,7 +161,7 @@ bool radio_screen(void) | |||
160 | bool done = false; | 161 | bool done = false; |
161 | int button; | 162 | int button; |
162 | int freq; | 163 | int freq; |
163 | int i_freq; | 164 | int freq_diff; |
164 | bool stereo = false; | 165 | bool stereo = false; |
165 | int search_dir = 0; | 166 | int search_dir = 0; |
166 | int fw, fh; | 167 | int fw, fh; |
@@ -254,10 +255,10 @@ bool radio_screen(void) | |||
254 | sleep(1); | 255 | sleep(1); |
255 | 256 | ||
256 | /* Now check how close to the IF frequency we are */ | 257 | /* Now check how close to the IF frequency we are */ |
257 | i_freq = radio_get(RADIO_IF_MEASURED); | 258 | freq_diff = radio_get(RADIO_DEVIATION); |
258 | 259 | ||
259 | /* Stop searching if the IF frequency is close to 10.7MHz */ | 260 | /* Stop searching if the tuning is close */ |
260 | if(i_freq > 1065 && i_freq < 1075) | 261 | if(abs(freq_diff) < 50) |
261 | { | 262 | { |
262 | search_dir = 0; | 263 | search_dir = 0; |
263 | curr_preset = find_preset(curr_freq); | 264 | curr_preset = find_preset(curr_freq); |