comparison gsm-fw/g23m-glue/gdi/audio.c @ 836:6c5d3fecbc67

gdi: audio.c compiles
author Space Falcon <falcon@ivan.Harhan.ORG>
date Sat, 25 Apr 2015 19:21:20 +0000
parents 549b7ac60300
children
comparison
equal deleted inserted replaced
835:43e1b343b7fd 836:6c5d3fecbc67
61 #ifndef DRV_AUDIO_C 61 #ifndef DRV_AUDIO_C
62 #define DRV_AUDIO_C 62 #define DRV_AUDIO_C
63 #endif 63 #endif
64 #define ENTITY_CST 64 #define ENTITY_CST
65 65
66 #include "config.h"
67 #include "fixedconf.h"
68 #include "condat-features.h"
69
66 /* 70 /*
67 in order to stay backwardcompatible this riv_audio define is entered as only 71 in order to stay backwardcompatible this riv_audio define is entered as only
68 ti15++ version do have the riveria frame it needs to be disabled for the rest 72 ti15++ version do have the riveria frame it needs to be disabled for the rest
69 */ 73 */
70 74
71 #if defined (ALR) 75 #if 0 //defined (ALR)
72 #define RIV_AUDIO 1 76 #define RIV_AUDIO 1
73 #else 77 #else
74 #undef RIV_AUDIO 78 #undef RIV_AUDIO
75 #endif 79 #endif
76 80
93 #include "p_mph5.h" 97 #include "p_mph5.h"
94 #endif /* ALR, FF_GTI */ 98 #endif /* ALR, FF_GTI */
95 #include "prim.h" 99 #include "prim.h"
96 #include "gsm.h" 100 #include "gsm.h"
97 #include "tok.h" 101 #include "tok.h"
98 #include "cst/cst.h" 102 #include "../cst/cst.h"
99 #include "cst/cus_cst.h" 103 #include "../cst/cus_cst.h"
100 #include "gdi.h" 104 #include "gdi.h"
101 #include "audio.h" 105 #include "audio.h"
102 106
103 #if defined (RIV_AUDIO) 107 #if defined (RIV_AUDIO)
108
104 /* #include "bt_general.h" */ 109 /* #include "bt_general.h" */
105 #include "rv/rv_general.h" 110 #include "rv/rv_general.h"
106 #if /*!defined (_TTY_SIMU) &&*/ defined (FF_TTY) 111 #if /*!defined (_TTY_SIMU) &&*/ defined (FF_TTY)
107 #include "tty/tty_api.h" 112 #include "tty/tty_api.h"
108 #endif 113 #endif
109 #include "audio/audio_api.h" 114 #include "audio/audio_api.h"
115
116 #elif AUDIO_TASK
117
118 #define BOOL_FLAG
119 #define CHAR_FLAG
120 #include "../../L1/include/l1_confg.h"
121 #include "../../L1/include/l1_types.h"
122 #include "../../L1/audio_cust0/l1audio_cust.h"
123 #include "../../L1/audio_include/l1audio_msgty.h"
124 #include "../../L1/audio_include/l1audio_signa.h"
125
110 #endif 126 #endif
111 127
112 /*==== DEFINE =====================================================*/ 128 /*==== DEFINE =====================================================*/
113 129
114 #define AUDIO_TRC_EVENT(_f_)\ 130 #define AUDIO_TRC_EVENT(_f_)\
177 193
178 UBYTE audio_is_free = TRUE; /* variable for disable no muting */ 194 UBYTE audio_is_free = TRUE; /* variable for disable no muting */
179 195
180 /*==== FUNCTIONS ==================================================*/ 196 /*==== FUNCTIONS ==================================================*/
181 197
182 #if defined (_TMS470) 198 #if 1 //defined (_TMS470)
183 199
200 #if CONFIG_BUZZER
184 EXTERN void BZ_Init (void); 201 EXTERN void BZ_Init (void);
185 EXTERN void BZ_Enable (void); 202 EXTERN void BZ_Enable (void);
186 EXTERN void BZ_Disable (void); 203 EXTERN void BZ_Disable (void);
187 EXTERN void BZ_Tone (int f); 204 EXTERN void BZ_Tone (int f);
188 EXTERN void BZ_Volume (int v); 205 EXTERN void BZ_Volume (int v);
206 #endif
189 207
190 #ifdef ALR 208 #ifdef ALR
191 EXTERN void ABB_DlVolume (UBYTE v); 209 EXTERN void ABB_DlVolume (UBYTE v);
192 EXTERN void ABB_DlMute (UBYTE mute); 210 EXTERN void ABB_DlMute (UBYTE mute);
193 EXTERN void ABB_UlMute (UBYTE value); 211 EXTERN void ABB_UlMute (UBYTE value);
276 #define F_1477 ((1477 << 5) + 5) /* (( 102 << 8 ) + 125) */ 294 #define F_1477 ((1477 << 5) + 5) /* (( 102 << 8 ) + 125) */
277 #define F_1633 ((1633 << 5) + 5) /* (( 73 << 8 ) + 130) */ 295 #define F_1633 ((1633 << 5) + 5) /* (( 73 << 8 ) + 130) */
278 296
279 #else /* (RIV_AUDIO) */ 297 #else /* (RIV_AUDIO) */
280 298
281 #if defined (_TMS470) 299 #if 1 //defined (_TMS470)
282 300
283 /* 301 /*
284 * unit is TDMA frames 302 * unit is TDMA frames
285 */ 303 */
286 #define TDMA_12 12 304 #define TDMA_12 12
300 #define F_852 (( 201 << 8) + 67) 318 #define F_852 (( 201 << 8) + 67)
301 #define F_941 (( 189 << 8) + 73) 319 #define F_941 (( 189 << 8) + 73)
302 #define F_1209 (( 149 << 8) + 111) 320 #define F_1209 (( 149 << 8) + 111)
303 #define F_1336 (( 128 << 8) + 118) 321 #define F_1336 (( 128 << 8) + 118)
304 #define F_1477 (( 102 << 8) + 125) 322 #define F_1477 (( 102 << 8) + 125)
305 #define F_1633 (( 73 << 8) + 130) 323 #define F_1633 (( 73 << 8) + 130)
306 324
307 #else 325 #else
308 326
309 /* 327 /*
310 * unit is milliseconds 328 * unit is milliseconds
331 349
332 #endif 350 #endif
333 351
334 #endif /* (RIV_AUDIO) */ 352 #endif /* (RIV_AUDIO) */
335 353
336 354 #if 0
337 extern const T_DESCR The_Ale_is_dear[111]; 355 extern const T_DESCR The_Ale_is_dear[111];
338 extern const T_DESCR Danza_de_Astureses[21]; 356 extern const T_DESCR Danza_de_Astureses[21];
339 extern const T_DESCR rising_chromatic[47]; 357 extern const T_DESCR rising_chromatic[47];
340 extern const T_DESCR rising_cscale[27]; 358 extern const T_DESCR rising_cscale[27];
341 extern const T_DESCR MELODY_ONE[11]; 359 extern const T_DESCR MELODY_ONE[11];
342 extern const T_DESCR MELODY_HELLO[23]; 360 extern const T_DESCR MELODY_HELLO[23];
343 extern const T_DESCR bugle[39]; 361 extern const T_DESCR bugle[39];
344 362 #endif
345 363
346 /* 364 /*
347 * Tone generation tables 365 * Tone generation tables
348 */ 366 */
349 //Apr 04, 2005 REF: ENH 30063 xdeepadh 367 #if CONFIG_BUZZER
350 #ifndef FF_MMI_NO_BUZZER //If Buzzer is available
351 //ct_ring will be used for all the ringing tones.
352 //When the buzzer is not available,midi ringer will be used to play the ringing tones.
353 static const T_DESCR ct_ring [] = /* command 1 command 2 length */ 368 static const T_DESCR ct_ring [] = /* command 1 command 2 length */
354 { 800, 0, TDMA_12, 369 { 800, 0, TDMA_12,
355 900, 0, TDMA_12, 370 900, 0, TDMA_12,
356 800, 0, TDMA_12, 371 800, 0, TDMA_12,
357 900, 0, TDMA_12, 372 900, 0, TDMA_12,
372 800, 0, TDMA_12, 387 800, 0, TDMA_12,
373 900, 0, TDMA_12, 388 900, 0, TDMA_12,
374 0, 0, TDMA_866, 389 0, 0, TDMA_866,
375 0xFFFF, 0xFFFF, 0 390 0xFFFF, 0xFFFF, 0
376 }; 391 };
377 392 #else
378 #endif 393 static const T_DESCR ct_ring [] = /* command 1 command 2 length */
394 { F_770, 0, TDMA_12,
395 F_941, 0, TDMA_12,
396 F_770, 0, TDMA_12,
397 F_941, 0, TDMA_12,
398 F_770, 0, TDMA_12,
399 F_941, 0, TDMA_12,
400 F_770, 0, TDMA_12,
401 F_941, 0, TDMA_12,
402 F_770, 0, TDMA_12,
403 F_941, 0, TDMA_12,
404 F_770, 0, TDMA_12,
405 F_941, 0, TDMA_12,
406 F_770, 0, TDMA_12,
407 F_941, 0, TDMA_12,
408 F_770, 0, TDMA_12,
409 F_941, 0, TDMA_12,
410 F_770, 0, TDMA_12,
411 F_941, 0, TDMA_12,
412 F_770, 0, TDMA_12,
413 F_941, 0, TDMA_12,
414 0, 0, TDMA_866,
415 0xFFFF, 0xFFFF, 0
416 };
417 #endif
418
419 #if CONFIG_BUZZER
379 static const T_DESCR ct_auth_num [] = /* command 1 command 2 length */ 420 static const T_DESCR ct_auth_num [] = /* command 1 command 2 length */
380 { 950, 0, TDMA_71, 421 { 950, 0, TDMA_71,
381 1400, 0, TDMA_71, 422 1400, 0, TDMA_71,
382 1800, 0, TDMA_71, 423 1800, 0, TDMA_71,
383 0, 0, TDMA_216, 424 0, 0, TDMA_216,
384 0xFFFF, 0xFFFF, 0 425 0xFFFF, 0xFFFF, 0
385 }; 426 };
427 #else
428 static const T_DESCR ct_auth_num [] = /* command 1 command 2 length */
429 { F_941, 0, TDMA_71,
430 F_1477, 0, TDMA_71,
431 F_1633, 0, TDMA_71,
432 0, 0, TDMA_216,
433 0xFFFF, 0xFFFF, 0
434 };
435 #endif
386 436
387 static const T_DESCR ct_busy [] = /* command 1 command 2 length */ 437 static const T_DESCR ct_busy [] = /* command 1 command 2 length */
388 { F_425, 0, TDMA_108, 438 { F_425, 0, TDMA_108,
389 0, 0, TDMA_108, 439 0, 0, TDMA_108,
390 F_425, 0, TDMA_108, 440 F_425, 0, TDMA_108,
394 F_425, 0, TDMA_108, 444 F_425, 0, TDMA_108,
395 0, 0, TDMA_108, 445 0, 0, TDMA_108,
396 0xFFFF, 0xFFFF, 0 446 0xFFFF, 0xFFFF, 0
397 }; 447 };
398 448
449 #if CONFIG_BUZZER
399 static const T_DESCR ct_congest [] = /* command 1 command 2 length */ 450 static const T_DESCR ct_congest [] = /* command 1 command 2 length */
400 { 425, 0, TDMA_43, 451 { 425, 0, TDMA_43,
401 0, 0, TDMA_43, 452 0, 0, TDMA_43,
402 0xFFFF, 0xFFFF, 0 453 0xFFFF, 0xFFFF, 0
403 }; 454 };
414 465
415 static const T_DESCR ct_ack [] = /* command 1 command 2 length */ 466 static const T_DESCR ct_ack [] = /* command 1 command 2 length */
416 { 425, 0, TDMA_43, 467 { 425, 0, TDMA_43,
417 0xFFFF, 0xFFFF, 0 468 0xFFFF, 0xFFFF, 0
418 }; 469 };
470 #else
471 static const T_DESCR ct_congest [] = /* command 1 command 2 length */
472 { F_425, 0, TDMA_43,
473 0, 0, TDMA_43,
474 0xFFFF, 0xFFFF, 0
475 };
476
477 static const T_DESCR ct_dropped [] = /* command 1 command 2 length */
478 { F_425, 0, TDMA_43,
479 0, 0, TDMA_43,
480 F_425, 0, TDMA_43,
481 0, 0, TDMA_43,
482 F_425, 0, TDMA_43,
483 0, 0, TDMA_43,
484 0xFFFF, 0xFFFF, 0
485 };
486
487 static const T_DESCR ct_ack [] = /* command 1 command 2 length */
488 { F_425, 0, TDMA_43,
489 0xFFFF, 0xFFFF, 0
490 };
491 #endif
419 492
420 static const T_DESCR ct_cw [] = /* command 1 command 2 length */ 493 static const T_DESCR ct_cw [] = /* command 1 command 2 length */
421 { F_425, 0, TDMA_43, 494 { F_425, 0, TDMA_43,
422 0, 0, TDMA_130, 495 0, 0, TDMA_130,
423 F_425, 0, TDMA_43, 496 F_425, 0, TDMA_43,
520 }; 593 };
521 594
522 /* 595 /*
523 * Tone Type Table 596 * Tone Type Table
524 */ 597 */
525 //Apr 04, 2005 REF: ENH 30063 xdeepadh 598 #if CONFIG_BUZZER
526 #ifndef FF_MMI_NO_BUZZER //If Buzzer is available
527 //If Buzzer is available, ringing tones and gsm tones will be played in the buzzer.
528 //If the buzzer is not availble, the gsm tones will be routed to the speaker and
529 //the ringing tones will be played with midi ringer
530 static const UBYTE TONE_TYPE [] = { BUZZER, /* ringing tone 0 */ 599 static const UBYTE TONE_TYPE [] = { BUZZER, /* ringing tone 0 */
531 BUZZER, /* ringing tone 1 */ 600 BUZZER, /* ringing tone 1 */
532 BUZZER, /* ringing tone 2 */ 601 BUZZER, /* ringing tone 2 */
533 BUZZER, /* ringing tone 3 */ 602 BUZZER, /* ringing tone 3 */
534 BUZZER, /* ringing tone 4 */ 603 BUZZER, /* ringing tone 4 */
566 AUDIO, /* DTMF digit * */ 635 AUDIO, /* DTMF digit * */
567 AUDIO, /* DTMF digit # */ 636 AUDIO, /* DTMF digit # */
568 AUDIO, /* keybeep */ 637 AUDIO, /* keybeep */
569 AUDIO /* ringing tone if NOIBT */ 638 AUDIO /* ringing tone if NOIBT */
570 }; 639 };
571
572 #endif 640 #endif
573 641
574 //Apr 04, 2005 REF: ENH 30063 xdeepadh 642 //Apr 04, 2005 REF: ENH 30063 xdeepadh
575 /* 643 /*
576 * Tone Description Table 644 * Tone Description Table
577 This table will have the ringing tones and the gsm tones. 645 This table will have the ringing tones and the gsm tones.
578 When the buzzer is not available, the ringing tones will be played with midi ringer 646 When the buzzer is not available, the ringing tones will be played with midi ringer
579 */ 647 */
580 static const T_DESCR * const TONE_DESCR [] = 648 static const T_DESCR * const TONE_DESCR [] =
581 { 649 {
582 #ifndef FF_MMI_NO_BUZZER 650 ct_ring, /* ringing tone 0 */
583 ct_ring, /* ringing tone 0 */
584 ct_ring, /* ringing tone 1 */ 651 ct_ring, /* ringing tone 1 */
585 ct_ring, /* ringing tone 2 */ 652 ct_ring, /* ringing tone 2 */
586 ct_ring, /* ringing tone 3 */ 653 ct_ring, /* ringing tone 3 */
587 ct_ring, /* ringing tone 4 */ 654 ct_ring, /* ringing tone 4 */
588 ct_ring, /* ringing tone 5 */ 655 ct_ring, /* ringing tone 5 */
594 ct_ring, /* ringing tone 11 */ 661 ct_ring, /* ringing tone 11 */
595 ct_ring, /* ringing tone 12 */ 662 ct_ring, /* ringing tone 12 */
596 ct_ring, /* ringing tone 13 */ 663 ct_ring, /* ringing tone 13 */
597 ct_ring, /* ringing tone 14 */ 664 ct_ring, /* ringing tone 14 */
598 ct_ring, /* ringing tone 15 */ 665 ct_ring, /* ringing tone 15 */
599 #endif
600 ct_auth_num,/* error/special information */ 666 ct_auth_num,/* error/special information */
601 ct_busy, /* subscriber busy */ 667 ct_busy, /* subscriber busy */
602 ct_congest, /* congestion */ 668 ct_congest, /* congestion */
603 ct_dropped, /* call dropped */ 669 ct_dropped, /* call dropped */
604 ct_ack, /* radio acknowledge */ 670 ct_ack, /* radio acknowledge */
734 +--------------------------------------------------------------------+ 800 +--------------------------------------------------------------------+
735 | PROJECT : GSM-PS (6103) MODULE : DRV_AUDIO | 801 | PROJECT : GSM-PS (6103) MODULE : DRV_AUDIO |
736 | STATE : code ROUTINE : audio_Init | 802 | STATE : code ROUTINE : audio_Init |
737 +--------------------------------------------------------------------+ 803 +--------------------------------------------------------------------+
738 804
739 PURPOSE : The function initializes the driverīs internal data. 805 PURPOSE : The function initializes the driver's internal data.
740 The function returns DRV_OK in case of a successful 806 The function returns DRV_OK in case of a successful
741 completition. The function returns DRV_INITIALIZED if 807 completition. The function returns DRV_INITIALIZED if
742 the driver has already been initialized and is ready to 808 the driver has already been initialized and is ready to
743 be used or is already in use. In case of an initialization 809 be used or is already in use. In case of an initialization
744 failure, which means the that the driver cannot be used, 810 failure, which means the that the driver cannot be used,
801 if (audio_handle < VSI_OK) 867 if (audio_handle < VSI_OK)
802 return DRV_INITFAILURE; 868 return DRV_INITFAILURE;
803 #endif 869 #endif
804 //Apr 04, 2005 REF: ENH 30063 xdeepadh 870 //Apr 04, 2005 REF: ENH 30063 xdeepadh
805 //For Buzzer init 871 //For Buzzer init
806 #ifndef FF_MMI_NO_BUZZER 872 #if CONFIG_BUZZER
807 BZ_Init (); /* initialize buzzer */ 873 BZ_Init (); /* initialize buzzer */
808 #endif 874 #endif
809 audio_SetMute ( AUDIO_SPEAKER, AUDIO_MUTING_OFF ); 875 audio_SetMute ( AUDIO_SPEAKER, AUDIO_MUTING_OFF );
810 audio_SetMute ( AUDIO_MICROPHONE, AUDIO_MUTING_OFF ); 876 audio_SetMute ( AUDIO_MICROPHONE, AUDIO_MUTING_OFF );
811 877
812 audio_SetAmplf ( AUDIO_SPEAKER, 175 ); 878 audio_SetAmplf ( AUDIO_SPEAKER, 175 );
813 audio_SetAmplf ( AUDIO_MICROPHONE, 75 ); 879 audio_SetAmplf ( AUDIO_MICROPHONE, 75 );
814 //Apr 04, 2005 REF: ENH 30063 xdeepadh 880 //Apr 04, 2005 REF: ENH 30063 xdeepadh
815 //Set volume for Buzzer 881 //Set volume for Buzzer
816 #ifndef FF_MMI_NO_BUZZER 882 #if CONFIG_BUZZER
817 audio_SetAmplf ( AUDIO_BUZZER, 175 ); 883 audio_SetAmplf ( AUDIO_BUZZER, 175 );
818 #endif 884 #endif
819 885
820 /* Setting the Side Tone has been moved from audio_SetAmplf CQ21055*/ 886 /* Setting the Side Tone has been moved from audio_SetAmplf CQ21055*/
821 #ifdef ALR 887 #ifdef ALR
858 vsi_t_close (VSI_CALLER audio_handle); 924 vsi_t_close (VSI_CALLER audio_handle);
859 audio_handle = VSI_ERROR; 925 audio_handle = VSI_ERROR;
860 #endif 926 #endif
861 //Apr 04, 2005 REF: ENH 30063 xdeepadh 927 //Apr 04, 2005 REF: ENH 30063 xdeepadh
862 //Disable Buzzer 928 //Disable Buzzer
863 #ifndef FF_MMI_NO_BUZZER 929 #if CONFIG_BUZZER
864 BZ_Disable (); 930 BZ_Disable ();
865 #endif 931 #endif
866 act_tone.status = NO_TONE; 932 act_tone.status = NO_TONE_STATE;
867 } 933 }
868 934
869 /* 935 /*
870 +--------------------------------------------------------------------+ 936 +--------------------------------------------------------------------+
871 | PROJECT : GSM-PS (6103) MODULE : DRV_AUDIO | 937 | PROJECT : GSM-PS (6103) MODULE : DRV_AUDIO |
1026 out_StatusPtr -> min_volume = AUDIO_MIN_VOLUME; 1092 out_StatusPtr -> min_volume = AUDIO_MIN_VOLUME;
1027 out_StatusPtr -> max_volume = AUDIO_MAX_VOLUME; 1093 out_StatusPtr -> max_volume = AUDIO_MAX_VOLUME;
1028 } 1094 }
1029 //Apr 04, 2005 REF: ENH 30063 xdeepadh 1095 //Apr 04, 2005 REF: ENH 30063 xdeepadh
1030 //If Buzzer is available, set the minimum and maximum volume 1096 //If Buzzer is available, set the minimum and maximum volume
1031 #ifndef FF_MMI_NO_BUZZER 1097 #if CONFIG_BUZZER
1032 else if (in_DeviceID EQ AUDIO_BUZZER) 1098 else if (in_DeviceID EQ AUDIO_BUZZER)
1033 { 1099 {
1034 out_StatusPtr -> min_volume = AUDIO_MIN_BUZ_VOLUME; 1100 out_StatusPtr -> min_volume = AUDIO_MIN_BUZ_VOLUME;
1035 out_StatusPtr -> max_volume = AUDIO_MAX_BUZ_VOLUME; 1101 out_StatusPtr -> max_volume = AUDIO_MAX_BUZ_VOLUME;
1036 } 1102 }
1160 #endif 1226 #endif
1161 act_speakerVolume = in_Amplf; 1227 act_speakerVolume = in_Amplf;
1162 } 1228 }
1163 //Apr 04, 2005 REF: ENH 30063 xdeepadh 1229 //Apr 04, 2005 REF: ENH 30063 xdeepadh
1164 //If Buzzer is available , set the volume 1230 //If Buzzer is available , set the volume
1165 #ifndef FF_MMI_NO_BUZZER 1231 #if CONFIG_BUZZER
1166 else if (in_DeviceID EQ AUDIO_BUZZER) 1232 else if (in_DeviceID EQ AUDIO_BUZZER)
1167 { 1233 {
1168 act_buzVolume = in_Amplf; 1234 act_buzVolume = in_Amplf;
1169 } 1235 }
1170 #endif 1236 #endif
1202 { 1268 {
1203 *out_Amplf = act_speakerVolume; 1269 *out_Amplf = act_speakerVolume;
1204 } 1270 }
1205 //Apr 04, 2005 REF: ENH 30063 xdeepadh 1271 //Apr 04, 2005 REF: ENH 30063 xdeepadh
1206 //If Buzzer is available, set the out volume 1272 //If Buzzer is available, set the out volume
1207 #ifndef FF_MMI_NO_BUZZER 1273 #if CONFIG_BUZZER
1208 else if (in_DeviceID EQ AUDIO_BUZZER) 1274 else if (in_DeviceID EQ AUDIO_BUZZER)
1209 { 1275 {
1210 *out_Amplf = act_buzVolume; 1276 *out_Amplf = act_buzVolume;
1211 } 1277 }
1212 #endif 1278 #endif
1213 else 1279 else
1214 { 1280 {
1215 return DRV_INVALID_PARAMS; 1281 return DRV_INVALID_PARAMS;
1216 } 1282 }
1217 1283
1256 switch (act_tone.status) 1322 switch (act_tone.status)
1257 { 1323 {
1258 1324
1259 //Apr 04, 2005 REF: ENH 30063 xdeepadh 1325 //Apr 04, 2005 REF: ENH 30063 xdeepadh
1260 //If Buzzer is available, disable the buzzer 1326 //If Buzzer is available, disable the buzzer
1261 #ifndef FF_MMI_NO_BUZZER 1327 #if CONFIG_BUZZER
1262 case BUZZER_ON: 1328 case BUZZER_ON:
1263 BZ_Disable (); 1329 BZ_Disable ();
1264 case BUZZER_SILENT: 1330 case BUZZER_SILENT:
1265 #endif 1331 #endif
1266 /* 1332 /*
1295 */ 1361 */
1296 return audio_keybeep_start(beep,riv_audio_rp); 1362 return audio_keybeep_start(beep,riv_audio_rp);
1297 #endif 1363 #endif
1298 #else 1364 #else
1299 /* MPHC is not present in GTI case */ 1365 /* MPHC is not present in GTI case */
1300 #ifndef FF_GTI 1366 #if !defined(FF_GTI) && AUDIO_TASK
1301 PALLOC (keybeep, MMI_KEYBEEP_REQ); 1367 PALLOC (keybeep, MMI_KEYBEEP_REQ);
1302 1368
1303 keybeep->d_k_x1_kt0 = F_697; 1369 keybeep->d_k_x1_kt0 = F_697;
1304 keybeep->d_k_x1_kt1 = F_697; 1370 keybeep->d_k_x1_kt1 = F_697;
1305 keybeep->d_dur_kb = 6; /* equal 120 ms */ 1371 keybeep->d_dur_kb = 6; /* equal 120 ms */
1310 else 1376 else
1311 { 1377 {
1312 act_tone.call_tone = in_SoundID; 1378 act_tone.call_tone = in_SoundID;
1313 //Apr 04, 2005 REF: ENH 30063 xdeepadh 1379 //Apr 04, 2005 REF: ENH 30063 xdeepadh
1314 //Before playing the tone, set the status and the tone type . 1380 //Before playing the tone, set the status and the tone type .
1315 #ifndef FF_MMI_NO_BUZZER //If Buzzer is available 1381 #if CONFIG_BUZZER
1316 act_tone.status = BUZZER_SILENT; 1382 act_tone.status = BUZZER_SILENT;
1317 act_tone.type = (UBYTE)TONE_TYPE[in_SoundID]; 1383 act_tone.type = (UBYTE)TONE_TYPE[in_SoundID];
1318 #else //If Buzzer is not available 1384 #else //If Buzzer is not available
1319 act_tone.status = TONE_SILENT; 1385 act_tone.status = TONE_SILENT;
1320 act_tone.type = (UBYTE)AUDIO; 1386 act_tone.type = (UBYTE)AUDIO;
1322 act_tone.descr = (T_DESCR *)TONE_DESCR[in_SoundID]; 1388 act_tone.descr = (T_DESCR *)TONE_DESCR[in_SoundID];
1323 act_tone.style = in_Repeats; 1389 act_tone.style = in_Repeats;
1324 act_tone.descr_index = 0; 1390 act_tone.descr_index = 0;
1325 //Apr 04, 2005 REF: ENH 30063 xdeepadh 1391 //Apr 04, 2005 REF: ENH 30063 xdeepadh
1326 //If Buzzer is available, call the audio_buzzer 1392 //If Buzzer is available, call the audio_buzzer
1327 #ifndef FF_MMI_NO_BUZZER 1393 #if CONFIG_BUZZER
1328 if (act_tone.type EQ BUZZER) 1394 if (act_tone.type EQ BUZZER)
1329 { 1395 {
1330 act_tone.volume = act_buzVolume; 1396 act_tone.volume = act_buzVolume;
1331 audio_buzzer (); 1397 audio_buzzer ();
1332 } 1398 }
1387 */ 1453 */
1388 switch (act_tone.status) 1454 switch (act_tone.status)
1389 { 1455 {
1390 //Apr 04, 2005 REF: ENH 30063 xdeepadh 1456 //Apr 04, 2005 REF: ENH 30063 xdeepadh
1391 //If Buzzer is available, disable it. 1457 //If Buzzer is available, disable it.
1392 #ifndef FF_MMI_NO_BUZZER 1458 #if CONFIG_BUZZER
1393 case BUZZER_ON: 1459 case BUZZER_ON:
1394 BZ_Disable (); 1460 BZ_Disable ();
1395 case BUZZER_SILENT: 1461 case BUZZER_SILENT:
1396 #endif 1462 #endif
1397 /* 1463 /*
1419 * This function seems only to be available on target. (db / 2001-07-16) 1485 * This function seems only to be available on target. (db / 2001-07-16)
1420 */ 1486 */
1421 audio_tones_stop(riv_audio_rp); 1487 audio_tones_stop(riv_audio_rp);
1422 #endif 1488 #endif
1423 #else 1489 #else
1424 #ifndef FF_GTI 1490 #if !defined(FF_GTI) && AUDIO_TASK
1425 PALLOC (audio, MMI_TONE_REQ); 1491 PALLOC (audio, MMI_TONE_REQ);
1426 1492
1427 audio->d_k_x1_t0 = 0; 1493 audio->d_k_x1_t0 = 0;
1428 audio->d_k_x1_t1 = 0; 1494 audio->d_k_x1_t1 = 0;
1429 audio->d_k_x1_t2 = 0; 1495 audio->d_k_x1_t2 = 0;
1440 1506
1441 PSENDX (L1, audio); 1507 PSENDX (L1, audio);
1442 #endif /* FF_GTI */ 1508 #endif /* FF_GTI */
1443 #endif 1509 #endif
1444 } 1510 }
1445 act_tone.status = NO_TONE; 1511 act_tone.status = NO_TONE_STATE;
1446 1512
1447 break; 1513 break;
1448 default: 1514 default:
1449 break; 1515 break;
1450 } 1516 }
1543 /*ccc 1609 /*ccc
1544 * only if it is the audio timer 1610 * only if it is the audio timer
1545 */ 1611 */
1546 //Apr 04, 2005 REF: ENH 30063 xdeepadh 1612 //Apr 04, 2005 REF: ENH 30063 xdeepadh
1547 //For Buzzer 1613 //For Buzzer
1548 #ifndef FF_MMI_NO_BUZZER 1614 #if CONFIG_BUZZER
1549 if (act_tone.type EQ BUZZER) 1615 if (act_tone.type EQ BUZZER)
1550 audio_buzzer (); 1616 audio_buzzer ();
1551 else 1617 else
1552 #endif 1618 #endif
1553 audio_audio (); 1619 audio_audio ();
1563 1629
1564 PURPOSE : Process a buzzer tone. 1630 PURPOSE : Process a buzzer tone.
1565 1631
1566 */ 1632 */
1567 //Apr 04, 2005 REF: ENH 30063 xdeepadh 1633 //Apr 04, 2005 REF: ENH 30063 xdeepadh
1568 #ifndef FF_MMI_NO_BUZZER //If buzzer is available 1634 #if CONFIG_BUZZER
1569 LOCAL void audio_buzzer (void) 1635 LOCAL void audio_buzzer (void)
1570 { 1636 {
1571 if (act_tone.status EQ NO_TONE) 1637 if (act_tone.status EQ NO_TONE_STATE)
1572 return; 1638 return;
1573 1639
1574 switch (act_tone.descr 1640 switch (act_tone.descr
1575 [act_tone.descr_index].command_1) 1641 [act_tone.descr_index].command_1)
1576 { 1642 {
1611 { 1677 {
1612 act_tone.descr_index = 0; 1678 act_tone.descr_index = 0;
1613 audio_buzzer (); 1679 audio_buzzer ();
1614 } 1680 }
1615 else 1681 else
1616 act_tone.status = NO_TONE; 1682 act_tone.status = NO_TONE_STATE;
1617 break; 1683 break;
1618 1684
1619 default: 1685 default:
1620 /* 1686 /*
1621 * switch buzzer on 1687 * switch buzzer on
1637 #endif 1703 #endif
1638 act_tone.status = BUZZER_ON; 1704 act_tone.status = BUZZER_ON;
1639 break; 1705 break;
1640 } 1706 }
1641 } 1707 }
1642 1708 #endif
1643 #endif 1709
1644 /* 1710 /*
1645 +--------------------------------------------------------------------+ 1711 +--------------------------------------------------------------------+
1646 | PROJECT : GSM-PS (6103) MODULE : DRV_AUDIO | 1712 | PROJECT : GSM-PS (6103) MODULE : DRV_AUDIO |
1647 | STATE : code ROUTINE : audio_audio | 1713 | STATE : code ROUTINE : audio_audio |
1648 +--------------------------------------------------------------------+ 1714 +--------------------------------------------------------------------+
1653 1719
1654 LOCAL void audio_audio (void) 1720 LOCAL void audio_audio (void)
1655 { 1721 {
1656 1722
1657 TRACE_EVENT("audio_audio"); 1723 TRACE_EVENT("audio_audio");
1658 if (act_tone.status EQ NO_TONE) 1724 if (act_tone.status EQ NO_TONE_STATE)
1659 return; 1725 return;
1660 1726
1661 switch (act_tone.descr 1727 switch (act_tone.descr
1662 [act_tone.descr_index].command_1) 1728 [act_tone.descr_index].command_1)
1663 { 1729 {
1685 { 1751 {
1686 act_tone.descr_index = 0; 1752 act_tone.descr_index = 0;
1687 audio_audio (); 1753 audio_audio ();
1688 } 1754 }
1689 else 1755 else
1690 act_tone.status = NO_TONE; 1756 act_tone.status = NO_TONE_STATE;
1691 break; 1757 break;
1692 1758
1693 default: 1759 default:
1694 /* 1760 /*
1695 * switch audio tone on 1761 * switch audio tone on
1708 t.tones[1].frequency_tone = (fa2 >> 5) & 0x07ff; 1774 t.tones[1].frequency_tone = (fa2 >> 5) & 0x07ff;
1709 t.tones[1].amplitude_tone = -((char) (fa2 & 0x001f)); 1775 t.tones[1].amplitude_tone = -((char) (fa2 & 0x001f));
1710 t.tones[2].start_tone = 0; 1776 t.tones[2].start_tone = 0;
1711 // t.tones[2].stop_tone = 1; - NDH : Removed as this does not comply with the i/f spec 1777 // t.tones[2].stop_tone = 1; - NDH : Removed as this does not comply with the i/f spec
1712 t.tones[2].stop_tone = (USHORT) ((60 * len) / 13); 1778 t.tones[2].stop_tone = (USHORT) ((60 * len) / 13);
1713 t.tones[2].frequency_tone = NO_TONE; 1779 t.tones[2].frequency_tone = 0;
1714 t.tones[2].amplitude_tone = 0; 1780 t.tones[2].amplitude_tone = 0;
1715 t.frame_duration = (USHORT) ((60 * len) / 13); 1781 t.frame_duration = (USHORT) ((60 * len) / 13);
1716 t.sequence_duration = (USHORT) ((60 * len) / 13); /* why 120 ??? -> changed to 60 */ 1782 t.sequence_duration = (USHORT) ((60 * len) / 13); /* why 120 ??? -> changed to 60 */
1717 t.period_duration = (USHORT) ((60 * len) / 13); /* -"- */ 1783 t.period_duration = (USHORT) ((60 * len) / 13); /* -"- */
1718 t.repetition = 1; 1784 t.repetition = 1;
1721 * This function seems only to be available on target. (db / 2001-07-16) 1787 * This function seems only to be available on target. (db / 2001-07-16)
1722 */ 1788 */
1723 audio_tones_start(&t,riv_audio_rp); 1789 audio_tones_start(&t,riv_audio_rp);
1724 #endif 1790 #endif
1725 #else 1791 #else
1726 #ifndef FF_GTI 1792 #if !defined(FF_GTI) && AUDIO_TASK
1727 PALLOC (audio, MMI_TONE_REQ); 1793 PALLOC (audio, MMI_TONE_REQ);
1728 /* 1794 /*
1729 * Convert TDMA frames to 20 ms -> 3/13 1795 * Convert TDMA frames to 20 ms -> 3/13
1730 */ 1796 */
1731 1797