diff src/g23m-aci/aci/ati_audio.c @ 597:f18b29e27be5

First attempt at MCSI voice path automatic switching The function is implemented at the ACI level in both aci2 and aci3, successfully avoids triggering the DSP bug on the first call, but the shutdown of MCSI upon call completion is not working properly yet in either version.
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 27 Mar 2019 22:18:35 +0000
parents ade27cd84b97
children 8f50b202e81f
line wrap: on
line diff
--- a/src/g23m-aci/aci/ati_audio.c	Mon Mar 18 17:56:04 2019 +0000
+++ b/src/g23m-aci/aci/ati_audio.c	Wed Mar 27 22:18:35 2019 +0000
@@ -168,6 +168,8 @@
 }
 
 #ifdef CONFIG_TARGET_FCDEV3B
+extern UBYTE aci_digital_voice_autoswitch;
+
 /* AT@VPATH - configure digital voice path */
 GLOBAL T_ATI_RSLT atAtVPATH ( char *cl, UBYTE srcId )
 {
@@ -212,6 +214,33 @@
 
 	return (ATI_CMPL);
 }
+
+/* AT@VSEL - configure digital voice path automatic operation */
+GLOBAL T_ATI_RSLT atAtVSEL ( char *cl, UBYTE srcId )
+{
+	int vsel_int;
+
+	TRACE_FUNCTION("atAtVSEL()");
+
+	cl = parse(cl, "D", &vsel_int);
+	if (!cl)
+		return (ATI_FAIL);
+	if (vsel_int != 0 && vsel_int != 1)
+		return (ATI_FAIL);
+	aci_digital_voice_autoswitch = vsel_int;
+	return (ATI_CMPL);
+}
+
+GLOBAL T_ATI_RSLT queatAtVSEL (char *cl, UBYTE srcId)
+{
+	char *me="@VSEL: ";
+
+	TRACE_FUNCTION("queatAtVSEL()");
+
+	sprintf(g_sa, "%s%u", me, aci_digital_voice_autoswitch);
+	io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT);
+	return (ATI_CMPL);
+}
 #endif
 
 static char melody_E1_name[AUDIO_PATH_NAME_MAX_SIZE];