summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-05-02 21:55:13 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-05-02 21:55:13 +0000
commit069567c0bc98304181d5bb47286c1852fdc0333e (patch)
tree77b8f071cb45b6717f3176d54707acca0eb105da /firmware
parent8aa1577a0b802f17b89166ea5de34a7a9354dc3b (diff)
iap: pass length and data pointer to iap_handlepkt functions, this prepares for iap large packet support.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29815 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/tuner/ipod_remote_tuner.c21
-rw-r--r--firmware/export/ipod_remote_tuner.h4
2 files changed, 14 insertions, 11 deletions
diff --git a/firmware/drivers/tuner/ipod_remote_tuner.c b/firmware/drivers/tuner/ipod_remote_tuner.c
index a7a16c5217..ad84cb9890 100644
--- a/firmware/drivers/tuner/ipod_remote_tuner.c
+++ b/firmware/drivers/tuner/ipod_remote_tuner.c
@@ -52,13 +52,16 @@ static void rmt_tuner_signal_power(unsigned char value)
tuner_signal_power = (int)(value);
}
-void rmt_tuner_freq(const unsigned char *serbuf)
+void rmt_tuner_freq(unsigned int len, const unsigned char *buf)
{
- unsigned int khz = (serbuf[3] << 24) | (serbuf[4] << 16) |
- (serbuf[5] << 8) | serbuf[6];
+ /* length currently unused */
+ (void)len;
+
+ unsigned int khz = (buf[2] << 24) | (buf[3] << 16) |
+ (buf[4] << 8) | buf[5];
tuner_frequency = khz *1000 ;
radio_tuned = true;
- rmt_tuner_signal_power(serbuf[7]);
+ rmt_tuner_signal_power(buf[6]);
}
static void rmt_tuner_set_freq(int curr_freq)
@@ -270,15 +273,15 @@ static bool reply_timeout(void)
return (timeout >= TIMEOUT_VALUE);
}
-void rmt_tuner_rds_data(const unsigned char *serbuf)
+void rmt_tuner_rds_data(unsigned int len, const unsigned char *buf)
{
- if (serbuf[3] == 0x1E)
+ if (buf[2] == 0x1E)
{
- strlcpy(rds_radioname,serbuf+5,8);
+ strlcpy(rds_radioname,buf+4,8);
}
- else if(serbuf[3] == 0x04)
+ else if(buf[2] == 0x04)
{
- strlcpy(rds_radioinfo,serbuf+5,(serbuf[0]-4));
+ strlcpy(rds_radioinfo,buf+4,len-4);
}
rds_event = true;
}
diff --git a/firmware/export/ipod_remote_tuner.h b/firmware/export/ipod_remote_tuner.h
index e87b967193..30c83a4135 100644
--- a/firmware/export/ipod_remote_tuner.h
+++ b/firmware/export/ipod_remote_tuner.h
@@ -28,8 +28,8 @@
extern int radio_present;
-extern void rmt_tuner_freq(const unsigned char *serbuf);
-extern void rmt_tuner_rds_data(const unsigned char *serbuf);
+extern void rmt_tuner_freq(unsigned int len, const unsigned char *buf);
+extern void rmt_tuner_rds_data(unsigned int len, const unsigned char *buf);
int ipod_rmt_tuner_set(int setting, int value);
int ipod_rmt_tuner_get(int setting);