comparison src/ui/mfw/mfw_utils.c @ 188:92abb46dc1ba

src/ui/mfw/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 19 Jan 2021 06:10:27 +0000
parents 67bfe9f274f6
children
comparison
equal deleted inserted replaced
187:a33dd8a5dcc9 188:92abb46dc1ba
13 HISTORY: 13 HISTORY:
14 Oct 04, 2004 REF: CRR 25519 Deepa M.D 14 Oct 04, 2004 REF: CRR 25519 Deepa M.D
15 Bug:Re-align structure members in MFW 15 Bug:Re-align structure members in MFW
16 Fix:Structure elements have been realigned to avoid the structure padding 16 Fix:Structure elements have been realigned to avoid the structure padding
17 17
18 Jun 05, 2004 REF: CRR 18262 NISHIKANT KULKARNI 18 Jun 05, 2004 REF: CRR 18262 NISHIKANT KULKARNI
19 Description: The sample sends a STOP DTMF message without release of the key by the user 19 Description: The sample sends a STOP DTMF message without release of the key by the user
20 Solution: Instead of sending DTMF commands in "VTS_MOD_Auto" mode, on key press DTMF tone is started 20 Solution: Instead of sending DTMF commands in "VTS_MOD_Auto" mode, on key press DTMF tone is started
21 using VTS_MOD_ManStart and on key release DTMF tone is stopped using VTS_MOD_ManStop mode. 21 using VTS_MOD_ManStart and on key release DTMF tone is stopped using VTS_MOD_ManStop mode.
22 22
23 */ 23 */
50 #ifndef PCM_2_FFS 50 #ifndef PCM_2_FFS
51 #include "pcm.h" 51 #include "pcm.h"
52 #endif 52 #endif
53 53
54 54
55 // xnkulkar SPR-18262: This length of array for storing DTMF mode (Start/Stop), is equal to the number 55 // xnkulkar SPR-18262: This length of array for storing DTMF mode (Start/Stop), is equal to the number
56 // of DTMF tone requests that can be stored in queue. 56 // of DTMF tone requests that can be stored in queue.
57 #define MAX_DTMF_Q_ENTRIES 50 57 #define MAX_DTMF_Q_ENTRIES 50
58 /***************************Go-lite Optimization changes start***********************/ 58 /***************************Go-lite Optimization changes start***********************/
59 //Oct 04, 2004 REF: CRR 25519 Deepa M.D 59 //Oct 04, 2004 REF: CRR 25519 Deepa M.D
60 //Structure elements (T_MFW_CBUF_HEADER)are realigned to avoid the structure padding 60 //Structure elements (T_MFW_CBUF_HEADER)are realigned to avoid the structure padding
96 SHORT mfw_cbuf_create (USHORT max_num_items, USHORT item_size, 96 SHORT mfw_cbuf_create (USHORT max_num_items, USHORT item_size,
97 UBYTE overwrite, UBYTE null_char, 97 UBYTE overwrite, UBYTE null_char,
98 UBYTE static_buf, void *buffer_ptr) 98 UBYTE static_buf, void *buffer_ptr)
99 { 99 {
100 SHORT bufId; 100 SHORT bufId;
101 101
102 if (cbf_num_of_buffers < MAX_CBUF_QUEUES) 102 if (cbf_num_of_buffers < MAX_CBUF_QUEUES)
103 { 103 {
104 /* 104 /*
105 ** Get the first available Id for a free buffer 105 ** Get the first available Id for a free buffer
106 */ 106 */
129 if ((static_buf) && (buffer_ptr == (void *)0)) 129 if ((static_buf) && (buffer_ptr == (void *)0))
130 return (MFW_CBUF_INVALID_BUF_PTR); 130 return (MFW_CBUF_INVALID_BUF_PTR);
131 131
132 if ((!static_buf) && (buffer_ptr != (void *)0)) 132 if ((!static_buf) && (buffer_ptr != (void *)0))
133 return (MFW_CBUF_INVALID_BUF_PTR); 133 return (MFW_CBUF_INVALID_BUF_PTR);
134 134
135 /* 135 /*
136 ** Set the selected buffer to active 136 ** Set the selected buffer to active
137 */ 137 */
138 cbf_hdr[bufId].active = TRUE; 138 cbf_hdr[bufId].active = TRUE;
139 139
358 ** Copy the data from the internal buffer into the output buffer, and reset the internal buffer 358 ** Copy the data from the internal buffer into the output buffer, and reset the internal buffer
359 */ 359 */
360 memcpy(buffer_ptr, 360 memcpy(buffer_ptr,
361 &cbf_hdr[bufId].mfw_cb[cbf_hdr[bufId].mfw_cb_read_pos], 361 &cbf_hdr[bufId].mfw_cb[cbf_hdr[bufId].mfw_cb_read_pos],
362 cbf_hdr[bufId].item_size); 362 cbf_hdr[bufId].item_size);
363 363
364 memset(&cbf_hdr[bufId].mfw_cb[cbf_hdr[bufId].mfw_cb_read_pos], 364 memset(&cbf_hdr[bufId].mfw_cb[cbf_hdr[bufId].mfw_cb_read_pos],
365 cbf_hdr[bufId].null_char, 365 cbf_hdr[bufId].null_char,
366 cbf_hdr[bufId].item_size); 366 cbf_hdr[bufId].item_size);
367 367
368 /* 368 /*
369 ** Move the read pointer along to the next required position 369 ** Move the read pointer along to the next required position
370 */ 370 */
371 cbf_hdr[bufId].mfw_cb_read_pos = (cbf_hdr[bufId].mfw_cb_read_pos + cbf_hdr[bufId].item_size) % 371 cbf_hdr[bufId].mfw_cb_read_pos = (cbf_hdr[bufId].mfw_cb_read_pos + cbf_hdr[bufId].item_size) %
372 (cbf_hdr[bufId].item_size * cbf_hdr[bufId].max_num_items); 372 (cbf_hdr[bufId].item_size * cbf_hdr[bufId].max_num_items);
399 */ 399 */
400 400
401 SHORT mfw_cbuf_put_mode (SHORT bufId,UBYTE vts_mode) 401 SHORT mfw_cbuf_put_mode (SHORT bufId,UBYTE vts_mode)
402 { 402 {
403 TRACE_FUNCTION("mfw_cbuf_put_mode()"); 403 TRACE_FUNCTION("mfw_cbuf_put_mode()");
404 404
405 // Check for the validity of buffer ID and "limit" for the number of elements 405 // Check for the validity of buffer ID and "limit" for the number of elements
406 // if ok, put the mode (Start / Stop) for the specified DTMF tone in the queue 406 // if ok, put the mode (Start / Stop) for the specified DTMF tone in the queue
407 if ((bufId < 0) || (bufId >= MAX_CBUF_QUEUES)) 407 if ((bufId < 0) || (bufId >= MAX_CBUF_QUEUES))
408 return MFW_CBUF_INVALID_BUF_ID; 408 return MFW_CBUF_INVALID_BUF_ID;
409 if (cbf_hdr[bufId].num_elements >= cbf_hdr[bufId].max_num_items) 409 if (cbf_hdr[bufId].num_elements >= cbf_hdr[bufId].max_num_items)
416 /* 416 /*
417 +-----------------------------------------------------------------------+ 417 +-----------------------------------------------------------------------+
418 |xnkulkar SPR-18262 | 418 |xnkulkar SPR-18262 |
419 |ROUTINE: SHORT mfw_cbuf_get_mode() | 419 |ROUTINE: SHORT mfw_cbuf_get_mode() |
420 |PURPOSE : Get the mode (Start/Stop) for the DTMF tone in queue | 420 |PURPOSE : Get the mode (Start/Stop) for the DTMF tone in queue |
421 | | 421 | |
422 +-----------------------------------------------------------------------+ 422 +-----------------------------------------------------------------------+
423 */ 423 */
424 SHORT mfw_cbuf_get_mode (SHORT bufId) 424 SHORT mfw_cbuf_get_mode (SHORT bufId)
425 { 425 {
426 TRACE_FUNCTION("mfw_cbuf_get_mode()"); 426 TRACE_FUNCTION("mfw_cbuf_get_mode()");