auxmain.c
37.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* auxmain.c
*
* Project:
* --------
* Maui_Software
*
* Description:
* ------------
* This Module defines the AUX task
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifndef __L1_STANDALONE__
#include "stack_common.h"
#include "stack_msgs.h"
#include "app_ltlcom.h" /* Task message communiction */
#include "syscomp_config.h"
#include "task_config.h"
#include "drv_comm.h"
//#include "adc.h"
#include "drvsignals.h"
#include "eint.h"
#include "l1audio.h"
#include "intrctrl.h"
#include "kal_general_types.h"
#include "stack_config.h"
#include "task_main_func.h"
#include "kal_public_api.h"
#include "stack_ltlcom.h"
#include "hisr_config.h"
#include "init.h"
#include "dcl.h"
/*UART Detection*/
//liming remove for slim
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
#if !defined(__SMART_PHONE_MODEM__)
#include "aux_custom.h"
#include "accessory_sw.h"
#ifdef TV_OUT_SUPPORT
#include "tv_out.h"
#endif
#if (defined(__ACCDET_SUPPORT__)||defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__))
#include "accdet_sw.h"
#endif //#if defined(__ACCDET_SUPPORT__)
const aux_func_struct *aux_custom_ptr;
extern const aux_func_struct* aux_GetFunc(void);
extern void aux_custom_init(void);
extern const kal_uint8 AUX_EINT_NO;
#ifdef __LINE_IN_SUPPORT__
extern const kal_uint8 LINE_IN_EINT_NO;
#endif
#ifdef __BT_NFC_TAG_SUPPORT__
extern const kal_uint8 NFC_TAG_EINT_NO;
#endif
void AUX_EINT_HISR(void);
void AUX_Sendilm(module_type src_mod, module_type dst_mod, msg_type msgid, AUX_ID aux_id_no);
kal_bool aux_create(comptask_handler_struct **handle);
static void aux_task_main(task_entry_struct *task_entry_ptr);
static kal_bool aux_task_reset(task_indx_type task_indx);
static kal_bool aux_task_end(task_indx_type task_indx);
kal_int32 EINT_SW_Debounce_Modify(kal_uint8 eintno, kal_uint8 debounce_time);
/*************************************************************************
* Variable declaration
*************************************************************************/
#if !defined(__ACCDET_SUPPORT__)
stack_timer_struct aux_timer;
static kal_bool aux_state = (kal_bool)AUX_EINT_STATE;
static kal_uint8 aux_timer_open = 0;
static kal_uint8 call_setup_cnt = 0;
static kal_bool poll_timer = KAL_FALSE;
static kal_bool aux_detect_mode = KAL_FALSE;
#endif //#if !defined(__ACCDET_SUPPORT__)
#ifdef __LINE_IN_SUPPORT__ //for line in
static kal_bool line_in_eint_state = (kal_bool)LINE_IN_EINT_STATE;
#endif
#ifdef __BT_NFC_TAG_SUPPORT__ //for nfc tag
static kal_bool nfc_tag_eint_state = (kal_bool)NFC_TAG_EINT_STATE;
#endif
void ACCDET_version_check(void)
{
#if defined(MT6250)
SW_SECVERSION SWSecVer;
SWSecVer = INT_SW_SecVersion();
switch ( SWSecVer)
{
case SW_SEC_0:
#if defined(__ACCDET_EINT_SUPPORT__)
ASSERT(0);
#endif //#if defined(__ACCDET_EINT_SUPPORT__)
break;
default:
break;
}
#endif //if defined(MT6250)
}
void aux_remove_adc_channel(kal_uint32 adc_handle);
DCL_HANDLE adc_handle_aux;
#ifdef TV_OUT_SUPPORT
kal_bool aux_tvout_on = KAL_FALSE;
#endif
#undef AUX_DEBUG
#if defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
static AUX_POLLING_STATUS aux_polling_status = AUX_STATUS_ORG;
kal_bool g_bAudioBufferOpen = KAL_FALSE;
kal_bool g_bPlugIn = KAL_FALSE;
void aux_plugin_handler()
{
aux_polling_status = AUX_STATUS_ORG;
aux_timer_open = 1;
//g_bPlugIn = KAL_TRUE;
aux_detect_mode = (kal_bool)AFE_TurnOnMicBias();
aux_remove_adc_channel(adc_handle_aux);
stack_start_timer(&aux_timer, 0, TURN_ON_BIAS_INTERVAL*2);
}
void aux_plugout_handler()
{
aux_polling_status = AUX_STATUS_ORG;
aux_timer_open = 0;
g_bPlugIn = KAL_FALSE;
AFE_TurnOffMicBias();
stack_stop_timer(&aux_timer);
}
void aux_Audio_Closed_Handler()
{
ilm_struct *aux_ilm;
if (aux_timer.dest_mod_id == MOD_AUX)
{
DRV_BuildPrimitive(aux_ilm, MOD_L1SP, MOD_AUX, MSG_ID_AUX_AUDIO_CLOSED, NULL);
msg_send_ext_queue(aux_ilm);
}
}
void aux_Audio_Open_Handler()
{
ilm_struct *aux_ilm;
if (aux_timer.dest_mod_id == MOD_AUX)
{
g_bAudioBufferOpen = KAL_TRUE;
DRV_BuildPrimitive(aux_ilm, MOD_L1SP, MOD_AUX, MSG_ID_AUX_AUDIO_OPEN, NULL);
msg_send_ext_queue(aux_ilm);
}
}
#endif //defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
/*************************************************************************
* FUNCTION
* aux_create
*
* DESCRIPTION
* This function implements xyz entity's create handler.
*
* PARAMETERS
*
* RETURNS
* None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_bool aux_create(comptask_handler_struct **handle)
{
static const comptask_handler_struct aux_handler_info =
{
aux_task_main, /* task entry function */
NULL, /* task initialization function */
NULL, /* task configuration function */
aux_task_reset, /* task reset handler */
aux_task_end /* task termination handler */
};
*handle = (comptask_handler_struct *)&aux_handler_info;
return KAL_TRUE;
}
/*************************************************************************
* FUNCTION
* AUX_EINT_HISR
*
* DESCRIPTION
* This function implements the response of AUX EINT.
*
* PARAMETERS
*
* RETURNS
* None
*
* GLOBALS AFFECTED
*
*************************************************************************/
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__)) && !defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
void AUX_EINT_HISR(void)
{
if (aux_state == AUX_EINT_STATE)
{
#ifdef AUX_DEBUG
dbg_print(" Interrupt: Plugin \n\r");
#endif
aux_timer_open = 1;
aux_detect_mode = (kal_bool)AFE_TurnOnMicBias();
stack_start_timer(&aux_timer, 0, TURN_ON_BIAS_INTERVAL);
EINT_SW_Debounce_Modify(AUX_EINT_NO,PLUGOUT_DEBOUNCE_TIME);
aux_state = (kal_bool)!aux_state;
EINT_Set_Polarity(AUX_EINT_NO,aux_state);
aux_custom_ptr->aux_plug_in(); //customer can do his own job through this
AUX_Sendilm(MOD_EINT_HISR,MOD_AUX,MSG_ID_AUX_PLUGIN,AUX_ID_PLUGIN);
}
else
{
#ifdef AUX_DEBUG
dbg_print(" Interrupt: Plugout \n\r");
#endif
aux_timer_open = 0;
AFE_TurnOffMicBias();
stack_stop_timer(&aux_timer);
EINT_SW_Debounce_Modify(AUX_EINT_NO,PLUGIN_DEBOUNCE_TIME);
aux_state = (kal_bool)!aux_state;
EINT_Set_Polarity(AUX_EINT_NO,aux_state);
aux_custom_ptr->aux_plug_out(); //customer can do his own job through this
AUX_Sendilm(MOD_EINT_HISR,MOD_AUX,MSG_ID_AUX_PLUGOUT,AUX_ID_PLUGOUT);
}
}
#endif
#ifdef __LINE_IN_SUPPORT__
void LINE_IN_EINT_HISR(void)
{
if (line_in_eint_state == LINE_IN_EINT_STATE)
{
line_in_eint_state = (kal_bool)!line_in_eint_state;
EINT_Set_Polarity(LINE_IN_EINT_NO,line_in_eint_state);
EINT_SW_Debounce_Modify(LINE_IN_EINT_NO,10);
AUX_Sendilm(MOD_AUX,MOD_UEM,MSG_ID_AUX_ID,AUX_ID_LINEIN_PLUGIN);
}
else
{
line_in_eint_state = (kal_bool)!line_in_eint_state;
EINT_Set_Polarity(LINE_IN_EINT_NO,line_in_eint_state);
EINT_SW_Debounce_Modify(LINE_IN_EINT_NO,10);
AUX_Sendilm(MOD_AUX,MOD_UEM,MSG_ID_AUX_ID,AUX_ID_LINEIN_PLUGOUT);
}
}
#endif
#ifdef __BT_NFC_TAG_SUPPORT__
void NFC_TAG_EINT_HISR(void)
{
if (nfc_tag_eint_state == NFC_TAG_EINT_STATE)
{
nfc_tag_eint_state = (kal_bool)!nfc_tag_eint_state;
EINT_Set_Polarity(NFC_TAG_EINT_NO,nfc_tag_eint_state);
EINT_SW_Debounce_Modify(NFC_TAG_EINT_NO,10);
AUX_Sendilm(MOD_AUX,MOD_UEM,MSG_ID_AUX_ID,NFC_TAG_PAIRING);
}
else
{
nfc_tag_eint_state = (kal_bool)!nfc_tag_eint_state;
EINT_Set_Polarity(NFC_TAG_EINT_NO,nfc_tag_eint_state);
EINT_SW_Debounce_Modify(NFC_TAG_EINT_NO,10);
AUX_Sendilm(MOD_AUX,MOD_UEM,MSG_ID_AUX_ID,NFC_TAG_LEAVING);
}
}
#endif
/*************************************************************************
* FUNCTION
* aux_read_adc_channel
*
* DESCRIPTION
* This function read the adc channel.
*
* PARAMETERS
*
* RETURNS
* None
*
* GLOBALS AFFECTED
*
*************************************************************************/
void aux_read_adc_channel(kal_uint32 adc_handle)
{
ilm_struct *aux_ilm;
bmt_adc_add_item_req_struct *aux_adc_item;
aux_adc_item = (bmt_adc_add_item_req_struct*)
construct_local_para(sizeof(bmt_adc_add_item_req_struct), TD_CTRL);
//aux_adc_item->adc_sche_id = logic_id;
aux_adc_item->adc_handle = adc_handle;
DRV_BuildPrimitive(aux_ilm,
MOD_AUX,
MOD_BMT,
MSG_ID_BMT_ADC_ADD_ITEM_REQ,
aux_adc_item);
msg_send_ext_queue(aux_ilm);
}
/*************************************************************************
* FUNCTION
* aux_remove_adc_channel
*
* DESCRIPTION
* This function remove the adc channel.
*
* PARAMETERS
*
* RETURNS
* None
*
* GLOBALS AFFECTED
*
*************************************************************************/
void aux_remove_adc_channel(kal_uint32 adc_handle)
{
ilm_struct *aux_ilm;
bmt_adc_remove_item_req_struct *aux_adc_remove_item;
aux_adc_remove_item = (bmt_adc_remove_item_req_struct*)
construct_local_para(sizeof(bmt_adc_remove_item_req_struct), TD_CTRL);
// aux_adc_remove_item->adc_sche_id = logic_id;
aux_adc_remove_item->adc_handle = adc_handle;
DRV_BuildPrimitive(aux_ilm,
MOD_AUX,
MOD_BMT,
MSG_ID_BMT_ADC_REMOVE_ITEM_REQ,
aux_adc_remove_item);
msg_send_ext_queue(aux_ilm);
}
/*************************************************************************
* FUNCTION
* aux_read_result
*
* DESCRIPTION
* This function is to read adc result and send msg to UEM and TST_READER accoding
* different adc value
*
* PARAMETERS
* pre_id :
* logic_id : adc logic channel
* buf : local parameter of ilm
* RETURNS
* None
*
* GLOBALS AFFECTED
*
*************************************************************************/
//void aux_read_result(AUX_ID *pre_id,kal_uint8 aux_adc_logic_id,local_para_struct *buf)
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
void aux_read_result(AUX_ID *pre_id,local_para_struct *buf)
{
bmt_adc_measure_done_conf_struct *ptr=(bmt_adc_measure_done_conf_struct *)buf;
kal_int32 aux_volt_result;
AUX_ID aux_id_no=AUX_ID_PLUGOUT;
if (0 == aux_timer_open)
{
return;
}
aux_volt_result = (kal_int32) ptr->volt;
//UART or TV_out part
if ((*pre_id != AUX_ID_EARPHONE) && (*pre_id != AUX_ID_KEY_PRESS) && (*pre_id != AUX_ID_KEY_RELEASE))
{
if(aux_volt_result > UART_ADC)
{
#ifdef AUX_DEBUG
dbg_print("UART \n\r");
dbg_print("AUX voltage = %d\n\r",aux_volt_result);
#endif
aux_custom_ptr->aux_uart_func(KAL_TRUE); //if uart switch pin not defined, this line will do nothing
aux_id_no = AUX_ID_UART;
}
#ifdef TV_OUT_SUPPORT
else if (aux_volt_result < TV_OUT_ADC_HIGH1 && aux_volt_result > TV_OUT_ADC_LOW1)
{
//call the TVOUT function to check
aux_custom_ptr->aux_HSTV_func(KAL_FALSE); //if HSTV enable switch pin not defined, this line will do nothing
aux_id_no = AUX_ID_TVOUT;
}
else
{
if (aux_tvout_on == KAL_FALSE)
{
if (aux_volt_result < TV_OUT_ADC_LOW2)
{
//enable TVOUT
aux_custom_ptr->aux_HSTV_func(KAL_FALSE); //if HSTV enable switch pin not defined, this line will do nothing
init_tv(0);
enable_tv_encoder(KAL_TRUE);
aux_tvout_on = KAL_TRUE;
}
}
else
{
if ((aux_volt_result > TV_OUT_EARPHONE_LOW_LIMIT) && (aux_volt_result < TV_OUT_EARPHONE_HIGH_LIMIT))
{
aux_id_no = AUX_ID_TVOUT;
}
//disable TVOUT
enable_tv_encoder(KAL_FALSE);
deinit_tv();
aux_tvout_on=KAL_FALSE;
}
}
#endif
}
//earphone part
#ifdef TV_OUT_SUPPORT
if(aux_id_no!=AUX_ID_UART&&aux_id_no!=AUX_ID_TVOUT&&aux_tvout_on!=KAL_TRUE)
#else
if(aux_id_no!=AUX_ID_UART)
#endif
{
if(aux_detect_mode==KAL_FALSE)//normal mode
{
#ifdef AUX_DEBUG
dbg_print("Normal mode 2.2V \n\r");
#endif
if(((NORMAL_EARPHONE_ADC_LOW <aux_volt_result)&& (aux_volt_result< NORMAL_EARPHONE_ADC_HIGH) )||(aux_volt_result< SENDKEY_ADC))
{
#ifdef AUX_DEBUG
dbg_print("Earphone \n\r");
dbg_print("AUX voltage = %d\n\r",aux_volt_result);
#endif
if(*pre_id==AUX_ID_EARPHONE||*pre_id==AUX_ID_KEY_PRESS||*pre_id==AUX_ID_KEY_RELEASE)
{
if(aux_volt_result< SENDKEY_ADC)
{
aux_id_no = AUX_ID_KEY_PRESS;
}
else
{
aux_id_no = AUX_ID_KEY_RELEASE;
}
}
else
{
aux_custom_ptr->aux_uart_func(KAL_FALSE); //if uart switch pin not defined, this line will do nothing
aux_id_no =AUX_ID_EARPHONE;
}
}
else if((aux_volt_result> NORMAL_EARPHONE_ADC_HIGH))
{
aux_id_no= AUX_ID_PLUGOUT;
}
else
{
aux_id_no = *pre_id;
}
}
else if(aux_detect_mode==KAL_TRUE) //Single mode
{
#ifdef AUX_DEBUG
dbg_print("Single mode 1.9V \n\r");
#endif
if(((SINGLE_EARPHONE_ADC_LOW <aux_volt_result)&& (aux_volt_result< SINGLE_EARPHONE_ADC_HIGH) )||(aux_volt_result< SENDKEY_ADC))
{
#ifdef AUX_DEBUG
dbg_print("Earphone \n\r");
dbg_print("AUX voltage = %d\n\r",aux_volt_result);
#endif
if(*pre_id==AUX_ID_EARPHONE||*pre_id==AUX_ID_KEY_PRESS||*pre_id==AUX_ID_KEY_RELEASE)
{
if(aux_volt_result< SENDKEY_ADC)
{
aux_id_no = AUX_ID_KEY_PRESS;
}
else
{
aux_id_no = AUX_ID_KEY_RELEASE;
}
}
else
{
aux_custom_ptr->aux_uart_func(KAL_FALSE); //if uart switch pin not defined, this line will do nothing
aux_id_no =AUX_ID_EARPHONE;
}
}
else
{
#ifdef AUX_DEBUG
dbg_print("Abnormal mode \n\r");
dbg_print("AUX voltage = %d\n\r",aux_volt_result);
#endif
aux_id_no= AUX_ID_PLUGOUT;
}
}
}
#if defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
if (*pre_id != aux_id_no)
{
if(aux_id_no!=AUX_ID_KEY_RELEASE)
{
#ifdef TV_OUT_SUPPORT
if((*pre_id == AUX_ID_TVOUT)&&(aux_id_no == AUX_ID_PLUGOUT))
{
AUX_Sendilm(MOD_AUX,MOD_UEM,MSG_ID_AUX_ID,AUX_ID_TVOUT_OUT);
}
#endif
AUX_Sendilm(MOD_AUX,MOD_UEM,MSG_ID_AUX_ID,aux_id_no);
}
*pre_id = aux_id_no;
g_bPlugIn = KAL_TRUE;
if(aux_id_no==AUX_ID_PLUGOUT)
g_bPlugIn = KAL_FALSE;
}
if((g_bPlugIn == KAL_TRUE)&& (aux_id_no==AUX_ID_PLUGOUT))
stack_start_timer(&aux_timer, 1, POLLING_INTERVAL);/*start polling timer*/
else if(poll_timer==KAL_TRUE)
stack_start_timer(&aux_timer, 1, POLLING_INTERVAL);/*start polling timer*/
aux_polling_status = AUX_STATUS_ORG;
#else //defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
if (*pre_id != aux_id_no)
{
if((aux_id_no!=AUX_ID_KEY_RELEASE)&&(aux_id_no!=AUX_ID_PLUGOUT))
{
#ifdef AUX_DEBUG
dbg_print("Send EARPHONE msg to MMI \n\r");
dbg_print("AUX ID = %d\n\r",aux_id_no);
#endif
AUX_Sendilm(MOD_AUX,MOD_UEM,MSG_ID_AUX_ID,aux_id_no);
}
if(aux_id_no!=AUX_ID_PLUGOUT)
*pre_id = aux_id_no;
}
//error state or poll timer on
if(aux_id_no==AUX_ID_PLUGOUT)
stack_start_timer(&aux_timer, 1, POLLING_INTERVAL);//start polling timer
else if(poll_timer==KAL_TRUE&&aux_id_no!=AUX_ID_UART&&aux_id_no!=AUX_ID_TVOUT)
stack_start_timer(&aux_timer, 1, POLLING_INTERVAL);//start polling timer
#endif //defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
}
#endif
DCL_HANDLE aux_open_and_create(DCL_UINT16 DCL_ADC_CHANNEL)
{
DCL_HANDLE adc_handle;
DCL_STATUS st;
ADC_CTRL_GET_PHYSICAL_CHANNEL_T adc_get_physical_channel;
ADC_CTRL_CREATE_OBJECT_T adc_create_object;
adc_handle = DclSADC_Open(DCL_ADC, FLAGS_NONE);
adc_get_physical_channel.u2AdcName = DCL_ADC_CHANNEL;
st = DclSADC_Control(adc_handle, ADC_CMD_GET_CHANNEL, (DCL_CTRL_DATA_T *)&adc_get_physical_channel);
if(st != STATUS_OK)
ASSERT(0);
adc_create_object.u1OwnerId = MOD_AUX;
adc_create_object.u1AdcChannel = adc_get_physical_channel.u1AdcPhyCh;
adc_create_object.u4Period = 15;
adc_create_object.u1EvaluateCount = 2;
adc_create_object.fgSendPrimitive = KAL_TRUE;
st = DclSADC_Control(adc_handle, ADC_CMD_CREATE_OBJECT, (DCL_CTRL_DATA_T *)&adc_create_object);
if(st != STATUS_OK)
ASSERT(0);
return adc_handle;
}
/*************************************************************************
* FUNCTION
* aux_task_main
*
* DESCRIPTION
* This function implements xyz task's entry function
*
* PARAMETERS
*
* RETURNS
* None
*
* GLOBALS AFFECTED
*
*************************************************************************/
void aux_task_main( task_entry_struct * task_entry_ptr )
{
ilm_struct current_ilm;
ilm_struct *aux_ilm ;
#if !defined(__ACCDET_SUPPORT__)
AUX_ID aux_id_nbr;
AUX_ID pre_id = AUX_ID_PLUGOUT;
#endif //#if !defined(__ACCDET_SUPPORT__)
//kal_bool started_by_timer1 = KAL_FALSE;
//Engineering mode result
kal_int32 vbat_value=0;
kal_int32 visense_value=0;
kal_int32 vcharger_value=0;
kal_int32 vbattemp_value=0;
kal_int32 vaux_value=0;
bmt_adc_measure_done_conf_struct *mea_done_ptr;
adc_all_channel_struct *adc_all_channel_result;
kal_uint16 adc_measure_count=0;
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
stack_timer_struct *check_timer_index;
#endif
/* DCL ADC */
#if defined(__BMT_2_0_ARCHITECTURE__)
DCL_HANDLE bmt_handle;
#endif
DCL_HANDLE adc_handle_vbat;
DCL_HANDLE adc_handle_visense;
DCL_HANDLE adc_handle_vcharger;
DCL_HANDLE adc_handle_vbattemp;
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
DCL_HANDLE adc_handle_vaux;
#endif //#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
#if !defined(__BMT_2_0_ARCHITECTURE__)
ADC_CTRL_TRANSFORM_INTO_TEMP_T adc_battemp;
ADC_CTRL_TRANSFORM_INTO_CURR_T adc_batcurr;
#endif //#if !defined(__BMT_2_0_ARCHITECTURE__)
//Engineering mode
#if defined(__BMT_2_0_ARCHITECTURE__)
bmt_handle = DclBMT_Open(DCL_BMT, FLAGS_NONE);
#endif
adc_handle_vbat = aux_open_and_create(DCL_VBAT_ADC_CHANNEL);
adc_handle_visense = aux_open_and_create(DCL_VISENSE_ADC_CHANNEL);
adc_handle_vcharger = aux_open_and_create(DCL_VCHARGER_ADC_CHANNEL);
adc_handle_vbattemp = aux_open_and_create(DCL_VBATTMP_ADC_CHANNEL);
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
stack_init_timer(&aux_timer, "AUX_TIMER", MOD_AUX);
adc_handle_aux = aux_open_and_create(DCL_AUX_ADC_CHANNEL);
adc_handle_vaux = aux_open_and_create(DCL_AUX_ADC_CHANNEL);
#if !defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
EINT_Registration(AUX_EINT_NO,KAL_TRUE,aux_state,AUX_EINT_HISR, KAL_TRUE);
#endif
#endif
ACCDET_version_check();
#if (defined(__ACCDET_SUPPORT__)||defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__))
IRQUnmask(IRQ_ACCDET_CODE);
#endif
#ifdef __LINE_IN_SUPPORT__//for line in
EINT_Registration(LINE_IN_EINT_NO,KAL_TRUE,line_in_eint_state,LINE_IN_EINT_HISR, KAL_TRUE);
EINT_SW_Debounce_Modify(LINE_IN_EINT_NO,10);
#endif
#ifdef __BT_NFC_TAG_SUPPORT__//for nfc tag
EINT_Registration(NFC_TAG_EINT_NO,KAL_TRUE,nfc_tag_eint_state,NFC_TAG_EINT_HISR, KAL_TRUE);
EINT_SW_Debounce_Modify(NFC_TAG_EINT_NO,10);
#endif
aux_custom_ptr = (aux_func_struct*)aux_GetFunc();
aux_custom_init();
while(1)
{
receive_msg_ext_q_for_stack(task_info_g[task_entry_ptr->task_indx].task_ext_qid, ¤t_ilm);
switch(current_ilm.msg_id)
{
#if !defined(__ACCDET_SUPPORT__)
case MSG_ID_AUX_CALL_SETUP_REQ_IND:
poll_timer=KAL_TRUE;
#ifdef TV_OUT_SUPPORT
if((aux_timer_open==1&&pre_id!=AUX_ID_UART&&pre_id!=AUX_ID_TVOUT) && (call_setup_cnt == 0))
#else
if((aux_timer_open==1&&pre_id!=AUX_ID_UART) && (call_setup_cnt == 0))
#endif
{
aux_detect_mode=(kal_bool)AFE_TurnOnMicBias();//voltage source
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
aux_remove_adc_channel(adc_handle_aux);
stack_start_timer(&aux_timer, 0, TURN_ON_BIAS_INTERVAL);
#endif //#if defined(__ACCDET_SUPPORT__)
}
call_setup_cnt++;
break;
case MSG_ID_AUX_CALL_DISCONNECT_REQ_IND:
if (call_setup_cnt>0)
call_setup_cnt--;
if (call_setup_cnt==0)
{
//poll_timer=KAL_FALSE;
#if defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
if (KAL_FALSE == g_bAudioBufferOpen)
#endif //defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
{
poll_timer=KAL_FALSE;
AFE_TurnOffMicBias();//voltage source
stack_stop_timer(&aux_timer);
}
}
break;
case MSG_ID_AUX_PLUGIN:
break;
case MSG_ID_AUX_PLUGOUT:
//Notify MMI the aux is plugout
#ifdef TV_OUT_SUPPORT
if(pre_id!=AUX_ID_TVOUT)
aux_id_nbr = AUX_ID_PLUGOUT;
else
aux_id_nbr = AUX_ID_TVOUT_OUT;
#else
aux_id_nbr = AUX_ID_PLUGOUT;
#endif
pre_id = AUX_ID_PLUGOUT;
AUX_Sendilm(MOD_AUX,MOD_UEM,MSG_ID_AUX_ID,aux_id_nbr);
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
//aux_remove_adc_channel(aux_adc_logic_id);
aux_remove_adc_channel(adc_handle_aux);
#endif //#if defined(__ACCDET_SUPPORT__)
break;
#endif //#if defined(__ACCDET_SUPPORT__)
case MSG_ID_READ_ALL_ADC_CHANNEL_REQ:
adc_measure_count=0;
vbat_value = 0;
//aux_read_adc_channel(vbat_adc_logic_id);
aux_read_adc_channel(adc_handle_vbat);
visense_value = 0;
//aux_read_adc_channel(visense_adc_logic_id);
aux_read_adc_channel(adc_handle_visense);
vcharger_value = 0;
//aux_read_adc_channel(vcharger_adc_logic_id);
aux_read_adc_channel(adc_handle_vcharger);
vbattemp_value = 0;
//aux_read_adc_channel(vbattemp_adc_logic_id);
aux_read_adc_channel(adc_handle_vbattemp);
vaux_value = 0;
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
//aux_read_adc_channel(vaux_adc_logic_id);
aux_read_adc_channel(adc_handle_vaux);
#endif //#if defined(__ACCDET_SUPPORT__)
break;
case MSG_ID_BMT_ADC_MEASURE_DONE_CONF:
mea_done_ptr = (bmt_adc_measure_done_conf_struct *)current_ilm.local_para_ptr;
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
//if (mea_done_ptr->adc_sche_id == aux_adc_logic_id) /*normal mode*/
if (mea_done_ptr->adc_handle == adc_handle_aux) /*normal mode*/
{
//aux_remove_adc_channel(aux_adc_logic_id);
aux_remove_adc_channel(adc_handle_aux);
#if defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
if((KAL_TRUE != poll_timer)&&(KAL_FALSE == g_bAudioBufferOpen))
#else
if(KAL_TRUE != poll_timer) //not turn off microbias when talking
#endif //defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
AFE_TurnOffMicBias();
#if defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
//Note: //In hybrid mode, if need calculate average value of ADC read by BMT, need to increase TURN_ON_BIAS_INTERVAL
if ((aux_timer_open==1)&&(aux_polling_status == AUX_STATUS_TIMER0_TIMEOUT))
{
aux_read_result(&pre_id,current_ilm.local_para_ptr);
}
#else
aux_read_result(&pre_id,current_ilm.local_para_ptr);
#endif
}
#endif
//if (mea_done_ptr->adc_sche_id == vbat_adc_logic_id)
if (mea_done_ptr->adc_handle == adc_handle_vbat)
{
adc_measure_count++;
vbat_value = (kal_int32)mea_done_ptr->volt;
//aux_remove_adc_channel(vbat_adc_logic_id);
aux_remove_adc_channel(adc_handle_vbat);
}
//else if (mea_done_ptr->adc_sche_id == visense_adc_logic_id)
else if (mea_done_ptr->adc_handle == adc_handle_visense)
{
adc_measure_count++;
visense_value = (kal_int32)mea_done_ptr->volt;
//aux_remove_adc_channel(visense_adc_logic_id);
aux_remove_adc_channel(adc_handle_visense);
}
//else if (mea_done_ptr->adc_sche_id == vcharger_adc_logic_id)
else if (mea_done_ptr->adc_handle == adc_handle_vcharger)
{
adc_measure_count++;
vcharger_value = (kal_int32)mea_done_ptr->volt;
//aux_remove_adc_channel(vcharger_adc_logic_id);
aux_remove_adc_channel(adc_handle_vcharger);
}
//else if (mea_done_ptr->adc_sche_id == vbattemp_adc_logic_id)
else if (mea_done_ptr->adc_handle == adc_handle_vbattemp)
{
adc_measure_count++;
vbattemp_value = (kal_int32)mea_done_ptr->volt;
//aux_remove_adc_channel(vbattemp_adc_logic_id);
aux_remove_adc_channel(adc_handle_vbattemp);
}
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
//else if (mea_done_ptr->adc_sche_id == vaux_adc_logic_id)
else if (mea_done_ptr->adc_handle == adc_handle_vaux)
{
adc_measure_count++;
vaux_value = (kal_int32)mea_done_ptr->volt;
//aux_remove_adc_channel(vaux_adc_logic_id);
aux_remove_adc_channel(adc_handle_vaux);
}
if(adc_measure_count==5)
#else
if(adc_measure_count==4) //only create 4 objects.
#endif
{
adc_measure_count=0;
adc_all_channel_result = (adc_all_channel_struct*)construct_local_para(sizeof(adc_all_channel_struct), TD_CTRL);
adc_all_channel_result->vbat = vbat_value;
adc_all_channel_result->vcharger = vcharger_value;
adc_all_channel_result->vaux = vaux_value;
#if defined(__BMT_2_0_ARCHITECTURE__)
{
BMT_CTRL_GET_CHARGING_CURRENT em_get_charging_current;
BMT_CTRL_GET_BAT_TEMP em_get_vbat_temp;
em_get_vbat_temp.VBatTmp = vbattemp_value;
adc_all_channel_result->bat_temp = DclBMT_Control(bmt_handle, BMT_CMD_GET_VBATTMP, (DCL_CTRL_DATA_T *)&em_get_vbat_temp);
em_get_charging_current.VBat = vbat_value;
em_get_charging_current.VSense = visense_value;
adc_all_channel_result->charge_current= DclBMT_Control(bmt_handle, BMT_CMD_GET_CHARGING_CURRENT, (DCL_CTRL_DATA_T *)&em_get_charging_current);
}
#else
adc_battemp.u4Volt = vbattemp_value;
DclSADC_Control(adc_handle_vbattemp,ADC_CMD_TRANSFORM_INTO_TEMP,(DCL_CTRL_DATA_T *)&adc_battemp);
adc_all_channel_result->bat_temp = adc_battemp.u4Temp;
adc_batcurr.u4Volt = visense_value - vbat_value;
DclSADC_Control(adc_handle_visense, ADC_CMD_TRANSFORM_INTO_CURR, (DCL_CTRL_DATA_T *)&adc_batcurr);
adc_all_channel_result->charge_current = adc_batcurr.u4Curr;
#endif
DRV_BuildPrimitive(aux_ilm,
MOD_AUX,
MOD_UEM,
MSG_ID_ADC_ALL_CHANNEL_CONF,
adc_all_channel_result);
msg_send_ext_queue(aux_ilm);
}
break;
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
case MSG_ID_TIMER_EXPIRY: //Timer time out
check_timer_index = (stack_timer_struct *) current_ilm.local_para_ptr;
switch(check_timer_index->timer_indx)
{
case 0://20ms timer
#if defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
aux_polling_status = AUX_STATUS_TIMER0_TIMEOUT;
#endif
#if (!defined(__ACCDET_SUPPORT__)&& !defined(__DRV_EXT_ACCESSORY_DETECTION__))
if((aux_timer_open==1))
{
aux_read_adc_channel(adc_handle_aux);
}
else
{
//aux_remove_adc_channel(aux_adc_logic_id);
aux_remove_adc_channel(adc_handle_aux);
}
#endif
break;
case 1://500ms timer
#if defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
aux_polling_status = AUX_STATUS_TIMER1_TIMEOUT;
#endif
#ifdef TV_OUT_SUPPORT
if(aux_tvout_on==KAL_FALSE)
#endif
if(aux_timer_open==1)
{
aux_detect_mode=(kal_bool)AFE_TurnOnMicBias();//voltage source
aux_remove_adc_channel(adc_handle_aux);
stack_start_timer(&aux_timer, 0, TURN_ON_BIAS_INTERVAL);
}
break;
default:
break;
}
break;
case MSG_ID_AUX_AUDIO_OPEN:/*audio open handler*/
{
#if defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
aux_polling_status = AUX_STATUS_ORG;
aux_detect_mode = (kal_bool)AFE_TurnOnMicBias();/*voltage source*/
if (aux_timer.dest_mod_id == MOD_AUX)
{
poll_timer = KAL_TRUE;
aux_timer_open = 1;
aux_remove_adc_channel(adc_handle_aux);
stack_start_timer(&aux_timer, 0, TURN_ON_BIAS_INTERVAL);
}
kal_prompt_trace(MOD_AUX, "Audio: aux_Audio_Open_Handler()");
#endif
}
break;
case MSG_ID_AUX_AUDIO_CLOSED:/*audio closed handler*/
{
#if defined(__ACCDET_HYBRID_SOLUTION_SUPPORT__)
if (aux_timer.dest_mod_id == MOD_AUX)
{
stack_stop_timer(&aux_timer);
}
g_bAudioBufferOpen = KAL_FALSE;
aux_polling_status = AUX_STATUS_ORG;
aux_remove_adc_channel(adc_handle_aux);
//reset ACCDET
if (pre_id == AUX_ID_PLUGOUT)//avoid this situation: AB default value is 01.
{
ACCDET_reset();
}
if (call_setup_cnt == 0)
{
poll_timer = KAL_FALSE;
AFE_TurnOffMicBias();
}
if (g_bPlugIn == KAL_FALSE) // earphone has been plugged out.
{
aux_timer_open = 0;
}
kal_prompt_trace(MOD_AUX, "Audio: aux_Audio_Closed_Hander()");
#endif
}
break;
#endif
default:
break;
}
free_ilm(¤t_ilm);
}
}
/*************************************************************************
* FUNCTION
* aux_task_reset
*
* DESCRIPTION
* This function implements xyz's reset handler
*
* PARAMETERS
* task_index - task's index
*
* RETURNS
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_bool aux_task_reset(task_indx_type task_indx)
{
/* Do task's reset here.
* Notice that: shouldn't execute modules reset handler since
* stack_task_reset() will do. */
return KAL_TRUE;
}
/*************************************************************************
* FUNCTION
* aux_task_end
*
* DESCRIPTION
* This function implements xyz's termination handler
*
* PARAMETERS
* task_index - task's index
*
* RETURNS
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_bool aux_task_end(task_indx_type task_indx)
{
/* Do task's termination here.
* Notice that: shouldn't execute modules reset handler since
* stack_task_end() will do. */
return KAL_TRUE;
}
/*************************************************************************
* FUNCTION
* AUX_Sendilm
*
* DESCRIPTION
* This function implements AUX massage sending.
*
* PARAMETERS
*
*
* RETURNS
*
* GLOBALS AFFECTED
*
*************************************************************************/
void AUX_Sendilm(module_type src_mod, module_type dst_mod, msg_type msgid, AUX_ID aux_id_no)
{
aux_id_struct *aux_id_data;
ilm_struct *aux_ilm;
aux_id_data = (aux_id_struct*)
construct_local_para(sizeof(aux_id_struct), TD_CTRL);
aux_id_data->aux_id = aux_id_no;
DRV_BuildPrimitive(aux_ilm,
src_mod,
dst_mod,
msgid,
aux_id_data);
msg_send_ext_queue(aux_ilm);
}
#endif //#if !defined(__SMART_PHONE_MODEM__)
//liming remove for slim
//UART Detection
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
#endif /*__L1_STANDALONE__*/