diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2010-09-20 19:37:17 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2010-09-20 19:37:17 +0000 |
commit | c0edce8f5c51508ccaef9bb8460205b0ea2c9438 (patch) | |
tree | e1355b54824407f3c93e1bc7ba75b4206efe0fbb | |
parent | 855346a9480c5b923be2ee577f5451c4bac8374c (diff) | |
download | rockbox-c0edce8f5c51508ccaef9bb8460205b0ea2c9438.tar.gz rockbox-c0edce8f5c51508ccaef9bb8460205b0ea2c9438.zip |
iap: make variable serbuf non-global
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28128 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/debug_menu.c | 6 | ||||
-rw-r--r-- | apps/iap.c | 12 | ||||
-rw-r--r-- | firmware/drivers/tuner/ipod_remote_tuner.c | 4 | ||||
-rw-r--r-- | firmware/export/iap.h | 2 | ||||
-rw-r--r-- | firmware/export/ipod_remote_tuner.h | 4 |
5 files changed, 19 insertions, 9 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index c0a476dc10..94076bf64d 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -122,6 +122,10 @@ | |||
122 | #include "usb_core.h" | 122 | #include "usb_core.h" |
123 | #endif | 123 | #endif |
124 | 124 | ||
125 | #if defined(IPOD_ACCESSORY_PROTOCOL) | ||
126 | #include "iap.h" | ||
127 | #endif | ||
128 | |||
125 | /*---------------------------------------------------*/ | 129 | /*---------------------------------------------------*/ |
126 | /* SPECIAL DEBUG STUFF */ | 130 | /* SPECIAL DEBUG STUFF */ |
127 | /*---------------------------------------------------*/ | 131 | /*---------------------------------------------------*/ |
@@ -1182,7 +1186,7 @@ bool dbg_ports(void) | |||
1182 | #endif | 1186 | #endif |
1183 | 1187 | ||
1184 | #if defined(IPOD_ACCESSORY_PROTOCOL) | 1188 | #if defined(IPOD_ACCESSORY_PROTOCOL) |
1185 | extern unsigned char serbuf[]; | 1189 | const unsigned char *serbuf = iap_get_serbuf(); |
1186 | lcd_putsf(0, line++, "IAP PACKET: %02x %02x %02x %02x %02x %02x %02x %02x", | 1190 | lcd_putsf(0, line++, "IAP PACKET: %02x %02x %02x %02x %02x %02x %02x %02x", |
1187 | serbuf[0], serbuf[1], serbuf[2], serbuf[3], serbuf[4], serbuf[5], | 1191 | serbuf[0], serbuf[1], serbuf[2], serbuf[3], serbuf[4], serbuf[5], |
1188 | serbuf[6], serbuf[7]); | 1192 | serbuf[6], serbuf[7]); |
diff --git a/apps/iap.c b/apps/iap.c index 4d2ec625cd..f53717e625 100644 --- a/apps/iap.c +++ b/apps/iap.c | |||
@@ -52,7 +52,7 @@ static unsigned long iap_remotebtn = 0; | |||
52 | static int iap_repeatbtn = 0; | 52 | static int iap_repeatbtn = 0; |
53 | static bool iap_btnrepeat = false, iap_btnshuffle = false; | 53 | static bool iap_btnrepeat = false, iap_btnshuffle = false; |
54 | 54 | ||
55 | unsigned char serbuf[RX_BUFLEN]; | 55 | static unsigned char serbuf[RX_BUFLEN]; |
56 | static int serbuf_i = 0; | 56 | static int serbuf_i = 0; |
57 | 57 | ||
58 | static unsigned char response[TX_BUFLEN]; | 58 | static unsigned char response[TX_BUFLEN]; |
@@ -837,13 +837,13 @@ void iap_handlepkt(void) | |||
837 | /* tuner frequency from scan */ | 837 | /* tuner frequency from scan */ |
838 | case 0x13: | 838 | case 0x13: |
839 | { | 839 | { |
840 | rmt_tuner_freq(); | 840 | rmt_tuner_freq(serbuf); |
841 | break; | 841 | break; |
842 | } | 842 | } |
843 | /* RDS station name 0x21 1E 00 + ASCII text*/ | 843 | /* RDS station name 0x21 1E 00 + ASCII text*/ |
844 | case 0x21: | 844 | case 0x21: |
845 | { | 845 | { |
846 | rmt_tuner_rds_data(); | 846 | rmt_tuner_rds_data(serbuf); |
847 | break; | 847 | break; |
848 | } | 848 | } |
849 | } | 849 | } |
@@ -868,3 +868,9 @@ int remote_control_rx(void) | |||
868 | 868 | ||
869 | return btn; | 869 | return btn; |
870 | } | 870 | } |
871 | |||
872 | const unsigned char *iap_get_serbuf(void) | ||
873 | { | ||
874 | return serbuf; | ||
875 | } | ||
876 | |||
diff --git a/firmware/drivers/tuner/ipod_remote_tuner.c b/firmware/drivers/tuner/ipod_remote_tuner.c index a20735402e..92fcd902ab 100644 --- a/firmware/drivers/tuner/ipod_remote_tuner.c +++ b/firmware/drivers/tuner/ipod_remote_tuner.c | |||
@@ -57,7 +57,7 @@ static void rmt_tuner_signal_power(unsigned char value) | |||
57 | tuner_signal_power = (int)(value); | 57 | tuner_signal_power = (int)(value); |
58 | } | 58 | } |
59 | 59 | ||
60 | void rmt_tuner_freq(void) | 60 | void rmt_tuner_freq(const unsigned char *serbuf) |
61 | { | 61 | { |
62 | char tempdata[4]; | 62 | char tempdata[4]; |
63 | tempdata[0] = serbuf[6]; | 63 | tempdata[0] = serbuf[6]; |
@@ -285,7 +285,7 @@ static bool reply_timeout(void) | |||
285 | return (timeout >= TIMEOUT_VALUE); | 285 | return (timeout >= TIMEOUT_VALUE); |
286 | } | 286 | } |
287 | 287 | ||
288 | void rmt_tuner_rds_data(void) | 288 | void rmt_tuner_rds_data(const unsigned char *serbuf) |
289 | { | 289 | { |
290 | if (serbuf[3] == 0x1E) | 290 | if (serbuf[3] == 0x1E) |
291 | { | 291 | { |
diff --git a/firmware/export/iap.h b/firmware/export/iap.h index b6d6e64d68..fab218cf05 100644 --- a/firmware/export/iap.h +++ b/firmware/export/iap.h | |||
@@ -29,6 +29,6 @@ extern void iap_bitrate_set(int ratenum); | |||
29 | extern void iap_periodic(void); | 29 | extern void iap_periodic(void); |
30 | extern void iap_handlepkt(void); | 30 | extern void iap_handlepkt(void); |
31 | extern void iap_send_pkt(const unsigned char * data, int len); | 31 | extern void iap_send_pkt(const unsigned char * data, int len); |
32 | extern unsigned char serbuf[RX_BUFLEN]; | 32 | const unsigned char *iap_get_serbuf(void); |
33 | 33 | ||
34 | #endif | 34 | #endif |
diff --git a/firmware/export/ipod_remote_tuner.h b/firmware/export/ipod_remote_tuner.h index c22978b0e4..e87b967193 100644 --- a/firmware/export/ipod_remote_tuner.h +++ b/firmware/export/ipod_remote_tuner.h | |||
@@ -28,8 +28,8 @@ | |||
28 | 28 | ||
29 | extern int radio_present; | 29 | extern int radio_present; |
30 | 30 | ||
31 | extern void rmt_tuner_freq(void); | 31 | extern void rmt_tuner_freq(const unsigned char *serbuf); |
32 | extern void rmt_tuner_rds_data(void); | 32 | extern void rmt_tuner_rds_data(const unsigned char *serbuf); |
33 | 33 | ||
34 | int ipod_rmt_tuner_set(int setting, int value); | 34 | int ipod_rmt_tuner_set(int setting, int value); |
35 | int ipod_rmt_tuner_get(int setting); | 35 | int ipod_rmt_tuner_get(int setting); |