summaryrefslogtreecommitdiff
path: root/apps/iap/iap-lingo2.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/iap/iap-lingo2.c')
-rw-r--r--apps/iap/iap-lingo2.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/apps/iap/iap-lingo2.c b/apps/iap/iap-lingo2.c
index d4c2f18c2f..946e51222d 100644
--- a/apps/iap/iap-lingo2.c
+++ b/apps/iap/iap-lingo2.c
@@ -30,6 +30,10 @@
30#include "button.h" 30#include "button.h"
31#include "audio.h" 31#include "audio.h"
32#include "settings.h" 32#include "settings.h"
33#include "tuner.h"
34#if CONFIG_TUNER
35#include "ipod_remote_tuner.h"
36#endif
33 37
34/* 38/*
35 * This macro is meant to be used inside an IAP mode message handler. 39 * This macro is meant to be used inside an IAP mode message handler.
@@ -57,6 +61,9 @@ static void cmd_ack(const unsigned char cmd, const unsigned char status)
57void iap_handlepkt_mode2(const unsigned int len, const unsigned char *buf) 61void iap_handlepkt_mode2(const unsigned int len, const unsigned char *buf)
58{ 62{
59 static bool poweron_pressed = false; 63 static bool poweron_pressed = false;
64#if CONFIG_TUNER
65 static bool remote_mute = false;
66#endif
60 unsigned int cmd = buf[1]; 67 unsigned int cmd = buf[1];
61 68
62 /* We expect at least three bytes in the buffer, one for the 69 /* We expect at least three bytes in the buffer, one for the
@@ -95,7 +102,21 @@ void iap_handlepkt_mode2(const unsigned int len, const unsigned char *buf)
95 if(buf[2] != 0) 102 if(buf[2] != 0)
96 { 103 {
97 if(buf[2] & 1) 104 if(buf[2] & 1)
105 {
98 REMOTE_BUTTON(BUTTON_RC_PLAY); 106 REMOTE_BUTTON(BUTTON_RC_PLAY);
107#if CONFIG_TUNER
108 if (radio_present == 1) {
109 if (remote_mute == 0) {
110 /* Not Muted so radio on*/
111 tuner_set(RADIO_MUTE,0);
112 } else {
113 /* Muted so radio off*/
114 tuner_set(RADIO_MUTE,1);
115 }
116 remote_mute = !remote_mute;
117 }
118#endif
119 }
99 if(buf[2] & 2) 120 if(buf[2] & 2)
100 REMOTE_BUTTON(BUTTON_RC_VOL_UP); 121 REMOTE_BUTTON(BUTTON_RC_VOL_UP);
101 if(buf[2] & 4) 122 if(buf[2] & 4)
@@ -111,11 +132,21 @@ void iap_handlepkt_mode2(const unsigned int len, const unsigned char *buf)
111 { 132 {
112 if (audio_status() != AUDIO_STATUS_PLAY) 133 if (audio_status() != AUDIO_STATUS_PLAY)
113 REMOTE_BUTTON(BUTTON_RC_PLAY); 134 REMOTE_BUTTON(BUTTON_RC_PLAY);
135#if CONFIG_TUNER
136 if (radio_present == 1) {
137 tuner_set(RADIO_MUTE,0);
138 }
139#endif
114 } 140 }
115 if(buf[3] & 2) /* pause */ 141 if(buf[3] & 2) /* pause */
116 { 142 {
117 if (audio_status() == AUDIO_STATUS_PLAY) 143 if (audio_status() == AUDIO_STATUS_PLAY)
118 REMOTE_BUTTON(BUTTON_RC_PLAY); 144 REMOTE_BUTTON(BUTTON_RC_PLAY);
145#if CONFIG_TUNER
146 if (radio_present == 1) {
147 tuner_set(RADIO_MUTE,1);
148 }
149#endif
119 } 150 }
120 if(buf[3] & 128) /* Shuffle */ 151 if(buf[3] & 128) /* Shuffle */
121 { 152 {
@@ -295,9 +326,8 @@ void iap_handlepkt_mode2(const unsigned int len, const unsigned char *buf)
295 { 326 {
296#ifdef LOGF_ENABLE 327#ifdef LOGF_ENABLE
297 logf("iap: Unsupported Mode02 Command"); 328 logf("iap: Unsupported Mode02 Command");
298#else
299 cmd_ack(cmd, IAP_ACK_BAD_PARAM);
300#endif 329#endif
330 cmd_ack(cmd, IAP_ACK_BAD_PARAM);
301 break; 331 break;
302 } 332 }
303 } 333 }