summaryrefslogtreecommitdiff
path: root/firmware/drivers/tuner/ipod_remote_tuner.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/tuner/ipod_remote_tuner.c')
-rw-r--r--firmware/drivers/tuner/ipod_remote_tuner.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/firmware/drivers/tuner/ipod_remote_tuner.c b/firmware/drivers/tuner/ipod_remote_tuner.c
index 8b599cb79c..e283ddfb68 100644
--- a/firmware/drivers/tuner/ipod_remote_tuner.c
+++ b/firmware/drivers/tuner/ipod_remote_tuner.c
@@ -30,6 +30,7 @@
30#include "adc.h" 30#include "adc.h"
31#include "settings.h" 31#include "settings.h"
32#include "power.h" 32#include "power.h"
33#include "rds.h"
33 34
34static unsigned char tuner_param = 0x00, old_tuner_param = 0xFF; 35static unsigned char tuner_param = 0x00, old_tuner_param = 0xFF;
35/* temp var for tests to avoid looping execution in submenus settings*/ 36/* temp var for tests to avoid looping execution in submenus settings*/
@@ -40,7 +41,6 @@ int radio_present = 0;
40static int tuner_frequency = 0; 41static int tuner_frequency = 0;
41static int tuner_signal_power = 0; 42static int tuner_signal_power = 0;
42static bool radio_tuned = false; 43static bool radio_tuned = false;
43static bool rds_event = false;
44 44
45static char rds_radioname[9]; 45static char rds_radioname[9];
46static char rds_radioinfo[65]; 46static char rds_radioinfo[65];
@@ -90,6 +90,7 @@ static void rmt_tuner_sleep(int state)
90{ 90{
91 if (state == 0) 91 if (state == 0)
92 { 92 {
93 rds_init();
93 tuner_param = 0x00; 94 tuner_param = 0x00;
94 old_tuner_param = 0xFF; 95 old_tuner_param = 0xFF;
95 mono_mode = -1; 96 mono_mode = -1;
@@ -273,13 +274,12 @@ void rmt_tuner_rds_data(unsigned int len, const unsigned char *buf)
273{ 274{
274 if (buf[2] == 0x1E) 275 if (buf[2] == 0x1E)
275 { 276 {
276 strlcpy(rds_radioname,buf+4,8); 277 rds_push_info(RDS_INFO_PS, (uintptr_t)(buf+4), 8);
277 } 278 }
278 else if(buf[2] == 0x04) 279 else if(buf[2] == 0x04)
279 { 280 {
280 strlcpy(rds_radioinfo,buf+4,len-4); 281 rds_push_info(RDS_INFO_RT, (uintptr_t)(buf+4), len-4);
281 } 282 }
282 rds_event = true;
283} 283}
284 284
285/* tuner abstraction layer: set something to the tuner */ 285/* tuner abstraction layer: set something to the tuner */
@@ -421,31 +421,6 @@ int ipod_rmt_tuner_get(int setting)
421 case RADIO_STEREO: 421 case RADIO_STEREO:
422 val = true; 422 val = true;
423 break; 423 break;
424
425 case RADIO_EVENT:
426 if (rds_event)
427 {
428 val = 1;
429 rds_event = false;
430 }
431 break;
432 } 424 }
433 return val; 425 return val;
434} 426}
435
436char* ipod_get_rds_info(int setting)
437{
438 char *text = NULL;
439
440 switch(setting)
441 {
442 case RADIO_RDS_NAME:
443 text = rds_radioname;
444 break;
445
446 case RADIO_RDS_TEXT:
447 text = rds_radioinfo;
448 break;
449 }
450 return text;
451}