# HG changeset patch # User Space Falcon # Date 1429989680 0 # Node ID 6c5d3fecbc678ed9ae1969f8460c8fe3443f6ecb # Parent 43e1b343b7fd1f7e39cf1d004005a846d5e89fa9 gdi: audio.c compiles diff -r 43e1b343b7fd -r 6c5d3fecbc67 gsm-fw/g23m-glue/gdi/Makefile --- a/gsm-fw/g23m-glue/gdi/Makefile Thu Apr 23 07:01:32 2015 +0000 +++ b/gsm-fw/g23m-glue/gdi/Makefile Sat Apr 25 19:21:20 2015 +0000 @@ -1,5 +1,18 @@ -# stub Makefile, to be filled out -all: +CC= arm-elf-gcc +AR= arm-elf-ar +RANLIB= arm-elf-ranlib + +CFLAGS= -O2 -fno-builtin -mthumb-interwork -mthumb +CPPFLAGS=-I. -I../../include -I../../include/condat -I../../gpf/inc \ + -I../../cdginc + +OBJS= audio.o + +all: libgdi.a + +libgdi.a: ${OBJS} + ${AR} cru $@ ${OBJS} + ${RANLIB} $@ clean: rm -f *.[oa] *.out *errs diff -r 43e1b343b7fd -r 6c5d3fecbc67 gsm-fw/g23m-glue/gdi/audio.c --- a/gsm-fw/g23m-glue/gdi/audio.c Thu Apr 23 07:01:32 2015 +0000 +++ b/gsm-fw/g23m-glue/gdi/audio.c Sat Apr 25 19:21:20 2015 +0000 @@ -63,12 +63,16 @@ #endif #define ENTITY_CST +#include "config.h" +#include "fixedconf.h" +#include "condat-features.h" + /* in order to stay backwardcompatible this riv_audio define is entered as only ti15++ version do have the riveria frame it needs to be disabled for the rest */ -#if defined (ALR) +#if 0 //defined (ALR) #define RIV_AUDIO 1 #else #undef RIV_AUDIO @@ -95,18 +99,30 @@ #include "prim.h" #include "gsm.h" #include "tok.h" -#include "cst/cst.h" -#include "cst/cus_cst.h" +#include "../cst/cst.h" +#include "../cst/cus_cst.h" #include "gdi.h" #include "audio.h" #if defined (RIV_AUDIO) + /* #include "bt_general.h" */ #include "rv/rv_general.h" #if /*!defined (_TTY_SIMU) &&*/ defined (FF_TTY) #include "tty/tty_api.h" #endif #include "audio/audio_api.h" + +#elif AUDIO_TASK + +#define BOOL_FLAG +#define CHAR_FLAG +#include "../../L1/include/l1_confg.h" +#include "../../L1/include/l1_types.h" +#include "../../L1/audio_cust0/l1audio_cust.h" +#include "../../L1/audio_include/l1audio_msgty.h" +#include "../../L1/audio_include/l1audio_signa.h" + #endif /*==== DEFINE =====================================================*/ @@ -179,13 +195,15 @@ /*==== FUNCTIONS ==================================================*/ -#if defined (_TMS470) +#if 1 //defined (_TMS470) +#if CONFIG_BUZZER EXTERN void BZ_Init (void); EXTERN void BZ_Enable (void); EXTERN void BZ_Disable (void); EXTERN void BZ_Tone (int f); EXTERN void BZ_Volume (int v); +#endif #ifdef ALR EXTERN void ABB_DlVolume (UBYTE v); @@ -278,7 +296,7 @@ #else /* (RIV_AUDIO) */ -#if defined (_TMS470) +#if 1 //defined (_TMS470) /* * unit is TDMA frames @@ -302,7 +320,7 @@ #define F_1209 (( 149 << 8) + 111) #define F_1336 (( 128 << 8) + 118) #define F_1477 (( 102 << 8) + 125) -#define F_1633 (( 73 << 8) + 130) +#define F_1633 (( 73 << 8) + 130) #else @@ -333,7 +351,7 @@ #endif /* (RIV_AUDIO) */ - +#if 0 extern const T_DESCR The_Ale_is_dear[111]; extern const T_DESCR Danza_de_Astureses[21]; extern const T_DESCR rising_chromatic[47]; @@ -341,15 +359,12 @@ extern const T_DESCR MELODY_ONE[11]; extern const T_DESCR MELODY_HELLO[23]; extern const T_DESCR bugle[39]; - +#endif /* * Tone generation tables */ -//Apr 04, 2005 REF: ENH 30063 xdeepadh -#ifndef FF_MMI_NO_BUZZER //If Buzzer is available -//ct_ring will be used for all the ringing tones. -//When the buzzer is not available,midi ringer will be used to play the ringing tones. +#if CONFIG_BUZZER static const T_DESCR ct_ring [] = /* command 1 command 2 length */ { 800, 0, TDMA_12, 900, 0, TDMA_12, @@ -374,8 +389,34 @@ 0, 0, TDMA_866, 0xFFFF, 0xFFFF, 0 }; +#else +static const T_DESCR ct_ring [] = /* command 1 command 2 length */ + { F_770, 0, TDMA_12, + F_941, 0, TDMA_12, + F_770, 0, TDMA_12, + F_941, 0, TDMA_12, + F_770, 0, TDMA_12, + F_941, 0, TDMA_12, + F_770, 0, TDMA_12, + F_941, 0, TDMA_12, + F_770, 0, TDMA_12, + F_941, 0, TDMA_12, + F_770, 0, TDMA_12, + F_941, 0, TDMA_12, + F_770, 0, TDMA_12, + F_941, 0, TDMA_12, + F_770, 0, TDMA_12, + F_941, 0, TDMA_12, + F_770, 0, TDMA_12, + F_941, 0, TDMA_12, + F_770, 0, TDMA_12, + F_941, 0, TDMA_12, + 0, 0, TDMA_866, + 0xFFFF, 0xFFFF, 0 + }; +#endif -#endif +#if CONFIG_BUZZER static const T_DESCR ct_auth_num [] = /* command 1 command 2 length */ { 950, 0, TDMA_71, 1400, 0, TDMA_71, @@ -383,6 +424,15 @@ 0, 0, TDMA_216, 0xFFFF, 0xFFFF, 0 }; +#else +static const T_DESCR ct_auth_num [] = /* command 1 command 2 length */ + { F_941, 0, TDMA_71, + F_1477, 0, TDMA_71, + F_1633, 0, TDMA_71, + 0, 0, TDMA_216, + 0xFFFF, 0xFFFF, 0 + }; +#endif static const T_DESCR ct_busy [] = /* command 1 command 2 length */ { F_425, 0, TDMA_108, @@ -396,6 +446,7 @@ 0xFFFF, 0xFFFF, 0 }; +#if CONFIG_BUZZER static const T_DESCR ct_congest [] = /* command 1 command 2 length */ { 425, 0, TDMA_43, 0, 0, TDMA_43, @@ -416,6 +467,28 @@ { 425, 0, TDMA_43, 0xFFFF, 0xFFFF, 0 }; +#else +static const T_DESCR ct_congest [] = /* command 1 command 2 length */ + { F_425, 0, TDMA_43, + 0, 0, TDMA_43, + 0xFFFF, 0xFFFF, 0 + }; + +static const T_DESCR ct_dropped [] = /* command 1 command 2 length */ + { F_425, 0, TDMA_43, + 0, 0, TDMA_43, + F_425, 0, TDMA_43, + 0, 0, TDMA_43, + F_425, 0, TDMA_43, + 0, 0, TDMA_43, + 0xFFFF, 0xFFFF, 0 + }; + +static const T_DESCR ct_ack [] = /* command 1 command 2 length */ + { F_425, 0, TDMA_43, + 0xFFFF, 0xFFFF, 0 + }; +#endif static const T_DESCR ct_cw [] = /* command 1 command 2 length */ { F_425, 0, TDMA_43, @@ -522,11 +595,7 @@ /* * Tone Type Table */ -//Apr 04, 2005 REF: ENH 30063 xdeepadh - #ifndef FF_MMI_NO_BUZZER //If Buzzer is available - //If Buzzer is available, ringing tones and gsm tones will be played in the buzzer. - //If the buzzer is not availble, the gsm tones will be routed to the speaker and - //the ringing tones will be played with midi ringer +#if CONFIG_BUZZER static const UBYTE TONE_TYPE [] = { BUZZER, /* ringing tone 0 */ BUZZER, /* ringing tone 1 */ BUZZER, /* ringing tone 2 */ @@ -568,7 +637,6 @@ AUDIO, /* keybeep */ AUDIO /* ringing tone if NOIBT */ }; - #endif //Apr 04, 2005 REF: ENH 30063 xdeepadh @@ -579,8 +647,7 @@ */ static const T_DESCR * const TONE_DESCR [] = { -#ifndef FF_MMI_NO_BUZZER - ct_ring, /* ringing tone 0 */ + ct_ring, /* ringing tone 0 */ ct_ring, /* ringing tone 1 */ ct_ring, /* ringing tone 2 */ ct_ring, /* ringing tone 3 */ @@ -596,7 +663,6 @@ ct_ring, /* ringing tone 13 */ ct_ring, /* ringing tone 14 */ ct_ring, /* ringing tone 15 */ -#endif ct_auth_num,/* error/special information */ ct_busy, /* subscriber busy */ ct_congest, /* congestion */ @@ -736,7 +802,7 @@ | STATE : code ROUTINE : audio_Init | +--------------------------------------------------------------------+ - PURPOSE : The function initializes the driverīs internal data. + PURPOSE : The function initializes the driver's internal data. The function returns DRV_OK in case of a successful completition. The function returns DRV_INITIALIZED if the driver has already been initialized and is ready to @@ -803,7 +869,7 @@ #endif //Apr 04, 2005 REF: ENH 30063 xdeepadh //For Buzzer init -#ifndef FF_MMI_NO_BUZZER +#if CONFIG_BUZZER BZ_Init (); /* initialize buzzer */ #endif audio_SetMute ( AUDIO_SPEAKER, AUDIO_MUTING_OFF ); @@ -813,7 +879,7 @@ audio_SetAmplf ( AUDIO_MICROPHONE, 75 ); //Apr 04, 2005 REF: ENH 30063 xdeepadh //Set volume for Buzzer -#ifndef FF_MMI_NO_BUZZER +#if CONFIG_BUZZER audio_SetAmplf ( AUDIO_BUZZER, 175 ); #endif @@ -860,10 +926,10 @@ #endif //Apr 04, 2005 REF: ENH 30063 xdeepadh //Disable Buzzer -#ifndef FF_MMI_NO_BUZZER +#if CONFIG_BUZZER BZ_Disable (); #endif - act_tone.status = NO_TONE; + act_tone.status = NO_TONE_STATE; } /* @@ -1028,7 +1094,7 @@ } //Apr 04, 2005 REF: ENH 30063 xdeepadh //If Buzzer is available, set the minimum and maximum volume -#ifndef FF_MMI_NO_BUZZER +#if CONFIG_BUZZER else if (in_DeviceID EQ AUDIO_BUZZER) { out_StatusPtr -> min_volume = AUDIO_MIN_BUZ_VOLUME; @@ -1162,7 +1228,7 @@ } //Apr 04, 2005 REF: ENH 30063 xdeepadh //If Buzzer is available , set the volume -#ifndef FF_MMI_NO_BUZZER +#if CONFIG_BUZZER else if (in_DeviceID EQ AUDIO_BUZZER) { act_buzVolume = in_Amplf; @@ -1204,12 +1270,12 @@ } //Apr 04, 2005 REF: ENH 30063 xdeepadh //If Buzzer is available, set the out volume - #ifndef FF_MMI_NO_BUZZER +#if CONFIG_BUZZER else if (in_DeviceID EQ AUDIO_BUZZER) { *out_Amplf = act_buzVolume; } - #endif +#endif else { return DRV_INVALID_PARAMS; @@ -1258,7 +1324,7 @@ //Apr 04, 2005 REF: ENH 30063 xdeepadh //If Buzzer is available, disable the buzzer -#ifndef FF_MMI_NO_BUZZER +#if CONFIG_BUZZER case BUZZER_ON: BZ_Disable (); case BUZZER_SILENT: @@ -1297,7 +1363,7 @@ #endif #else /* MPHC is not present in GTI case */ - #ifndef FF_GTI + #if !defined(FF_GTI) && AUDIO_TASK PALLOC (keybeep, MMI_KEYBEEP_REQ); keybeep->d_k_x1_kt0 = F_697; @@ -1312,7 +1378,7 @@ act_tone.call_tone = in_SoundID; //Apr 04, 2005 REF: ENH 30063 xdeepadh //Before playing the tone, set the status and the tone type . -#ifndef FF_MMI_NO_BUZZER //If Buzzer is available +#if CONFIG_BUZZER act_tone.status = BUZZER_SILENT; act_tone.type = (UBYTE)TONE_TYPE[in_SoundID]; #else //If Buzzer is not available @@ -1324,7 +1390,7 @@ act_tone.descr_index = 0; //Apr 04, 2005 REF: ENH 30063 xdeepadh //If Buzzer is available, call the audio_buzzer -#ifndef FF_MMI_NO_BUZZER +#if CONFIG_BUZZER if (act_tone.type EQ BUZZER) { act_tone.volume = act_buzVolume; @@ -1389,7 +1455,7 @@ { //Apr 04, 2005 REF: ENH 30063 xdeepadh //If Buzzer is available, disable it. -#ifndef FF_MMI_NO_BUZZER +#if CONFIG_BUZZER case BUZZER_ON: BZ_Disable (); case BUZZER_SILENT: @@ -1421,7 +1487,7 @@ audio_tones_stop(riv_audio_rp); #endif #else - #ifndef FF_GTI + #if !defined(FF_GTI) && AUDIO_TASK PALLOC (audio, MMI_TONE_REQ); audio->d_k_x1_t0 = 0; @@ -1442,7 +1508,7 @@ #endif /* FF_GTI */ #endif } - act_tone.status = NO_TONE; + act_tone.status = NO_TONE_STATE; break; default: @@ -1545,7 +1611,7 @@ */ //Apr 04, 2005 REF: ENH 30063 xdeepadh //For Buzzer -#ifndef FF_MMI_NO_BUZZER +#if CONFIG_BUZZER if (act_tone.type EQ BUZZER) audio_buzzer (); else @@ -1565,10 +1631,10 @@ */ //Apr 04, 2005 REF: ENH 30063 xdeepadh -#ifndef FF_MMI_NO_BUZZER //If buzzer is available +#if CONFIG_BUZZER LOCAL void audio_buzzer (void) { - if (act_tone.status EQ NO_TONE) + if (act_tone.status EQ NO_TONE_STATE) return; switch (act_tone.descr @@ -1613,7 +1679,7 @@ audio_buzzer (); } else - act_tone.status = NO_TONE; + act_tone.status = NO_TONE_STATE; break; default: @@ -1639,8 +1705,8 @@ break; } } +#endif -#endif /* +--------------------------------------------------------------------+ | PROJECT : GSM-PS (6103) MODULE : DRV_AUDIO | @@ -1655,7 +1721,7 @@ { TRACE_EVENT("audio_audio"); - if (act_tone.status EQ NO_TONE) + if (act_tone.status EQ NO_TONE_STATE) return; switch (act_tone.descr @@ -1687,7 +1753,7 @@ audio_audio (); } else - act_tone.status = NO_TONE; + act_tone.status = NO_TONE_STATE; break; default: @@ -1710,7 +1776,7 @@ t.tones[2].start_tone = 0; // t.tones[2].stop_tone = 1; - NDH : Removed as this does not comply with the i/f spec t.tones[2].stop_tone = (USHORT) ((60 * len) / 13); - t.tones[2].frequency_tone = NO_TONE; + t.tones[2].frequency_tone = 0; t.tones[2].amplitude_tone = 0; t.frame_duration = (USHORT) ((60 * len) / 13); t.sequence_duration = (USHORT) ((60 * len) / 13); /* why 120 ??? -> changed to 60 */ @@ -1723,7 +1789,7 @@ audio_tones_start(&t,riv_audio_rp); #endif #else - #ifndef FF_GTI + #if !defined(FF_GTI) && AUDIO_TASK PALLOC (audio, MMI_TONE_REQ); /* * Convert TDMA frames to 20 ms -> 3/13 diff -r 43e1b343b7fd -r 6c5d3fecbc67 gsm-fw/include/condat/audio.h --- a/gsm-fw/include/condat/audio.h Thu Apr 23 07:01:32 2015 +0000 +++ b/gsm-fw/include/condat/audio.h Sat Apr 25 19:21:20 2015 +0000 @@ -68,7 +68,7 @@ /* * Audio Status */ -/*#define NO_TONE 0 already defined in audio.h in L1 */ +#define NO_TONE_STATE 0 #define BUZZER_ON 1 #define BUZZER_SILENT 2 #define TONE_ON 3 diff -r 43e1b343b7fd -r 6c5d3fecbc67 gsm-fw/include/condat/custom.h --- a/gsm-fw/include/condat/custom.h Thu Apr 23 07:01:32 2015 +0000 +++ b/gsm-fw/include/condat/custom.h Sat Apr 25 19:21:20 2015 +0000 @@ -49,7 +49,7 @@ header if we compile the frame */ #ifdef ENTITY_CST -#include "cst/cus_cst.h" +#include "../../g23m-glue/cst/cus_cst.h" #endif #if defined (ENTITY_SMI) || defined (ENTITY_MFW) || defined (ENTITY_ACI) || defined (ENTITY_MMI)