changeset 264:3edeadec6804

aci2: AT@SPKR command implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 04 Aug 2017 20:50:23 +0000
parents 6c66a681224c
children 0aa748b6413a
files src/aci2/aci/ati_audio.c src/aci2/aci/ati_cmd.c
diffstat 2 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/aci2/aci/ati_audio.c	Fri Aug 04 20:29:46 2017 +0000
+++ b/src/aci2/aci/ati_audio.c	Fri Aug 04 20:50:23 2017 +0000
@@ -66,6 +66,26 @@
 #include "audio/audio_api.h"
 #include "audio.h"	/* Condat */
 
+#include "fc-target.cfg"
+#include "armio.h"
+
+#ifdef CONFIG_TARGET_FCDEV3B
+/* AT@SPKR - turn loudspeaker amplifier on or off */
+GLOBAL T_ATI_RSLT atAtSPKR ( char *cl, UBYTE srcId )
+{
+	int state;
+
+	cl = parse(cl, "D", &state);
+	if (!cl)
+		return (ATI_FAIL);
+	if (state)
+		AI_SetBit(1);
+	else
+		AI_ResetBit(1);
+	return (ATI_CMPL);
+}
+#endif
+
 /* AT@SND - emit sound through Condat API */
 GLOBAL T_ATI_RSLT atAtSND ( char *cl, UBYTE srcId )
 {
--- a/src/aci2/aci/ati_cmd.c	Fri Aug 04 20:29:46 2017 +0000
+++ b/src/aci2/aci/ati_cmd.c	Fri Aug 04 20:50:23 2017 +0000
@@ -75,6 +75,8 @@
 #include "aci_bat.h"
 #endif
 
+#include "fc-target.cfg"
+
 #define OLD_NON_STANDARDIZED_ATCMD "&ABDEFHILMOPQSTVWXZ"
 
 /*==== EXTERNALS ======================================================*/
@@ -672,6 +674,9 @@
 EXTERN T_ATI_RSLT atAtBAND (CHAR *cl, UBYTE srcId);
 
 /* FreeCalypso additions */
+#ifdef CONFIG_TARGET_FCDEV3B
+EXTERN T_ATI_RSLT atAtSPKR (char *cl, UBYTE srcId);
+#endif
 EXTERN T_ATI_RSLT atAtSND (char *cl, UBYTE srcId);
 EXTERN T_ATI_RSLT atAtE1 (char *cl, UBYTE srcId);
 EXTERN T_ATI_RSLT atAtE2 (char *cl, UBYTE srcId);
@@ -1070,6 +1075,9 @@
     {"@RST",       AT_CMD_P_RST,   atAtRST,       0,       0,    0},
     {"@BAND",     AT_CMD_P_BAND,   atAtBAND,     0,       0,    0},
     /* FreeCalypso additions */
+#ifdef CONFIG_TARGET_FCDEV3B
+    {"@SPKR",	AT_CMD_AT_SPKR,  atAtSPKR,	0,	0,	0},
+#endif
     {"@SND",	AT_CMD_AT_SND,   atAtSND,	0,	0,	0},
     {"@E1",	AT_CMD_AT_E1,    atAtE1,	0,	0,	0},
     {"@E2",	AT_CMD_AT_E2,    atAtE2,	0,	0,	0},