|
@@ -545,8 +545,9 @@ void optek_link_end_cb(u8 id) |
|
@@ -545,8 +545,9 @@ void optek_link_end_cb(u8 id) |
|
545
|
*/
|
545
|
*/
|
|
546
|
}
|
546
|
}
|
|
547
|
|
547
|
|
|
548
|
-#define OPTEK_LINK_HOPPING_CH 37
|
|
|
|
549
|
|
548
|
|
|
|
|
549
|
+/*
|
|
|
|
550
|
+#define OPTEK_LINK_HOPPING_CH 37
|
|
550
|
#define OPTEK_LINK_MAX_CH 37
|
551
|
#define OPTEK_LINK_MAX_CH 37
|
|
551
|
const u8 optek_link_scan_chan[OPTEK_LINK_MAX_CH] =
|
552
|
const u8 optek_link_scan_chan[OPTEK_LINK_MAX_CH] =
|
|
552
|
{
|
553
|
{
|
|
@@ -556,10 +557,20 @@ const u8 optek_link_scan_chan[OPTEK_LINK_MAX_CH] = |
|
@@ -556,10 +557,20 @@ const u8 optek_link_scan_chan[OPTEK_LINK_MAX_CH] = |
|
556
|
24, 25, 26, 27, 28, 29, 30, 31,
|
557
|
24, 25, 26, 27, 28, 29, 30, 31,
|
|
557
|
32, 33, 34, 35, 36
|
558
|
32, 33, 34, 35, 36
|
|
558
|
};
|
559
|
};
|
|
559
|
-
|
560
|
+*/
|
|
560
|
|
561
|
|
|
561
|
// for philips
|
562
|
// for philips
|
|
|
|
563
|
+
|
|
|
|
564
|
+#define OPTEK_LINK_HOPPING_CH 8
|
|
|
|
565
|
+#define OPTEK_LINK_MAX_CH 8
|
|
|
|
566
|
+const u8 optek_link_scan_chan[OPTEK_LINK_MAX_CH] =
|
|
|
|
567
|
+{
|
|
|
|
568
|
+ 0, 1, 31, 32, 33, 34, 35, 36,
|
|
|
|
569
|
+};
|
|
|
|
570
|
+
|
|
|
|
571
|
+
|
|
562
|
/*
|
572
|
/*
|
|
|
|
573
|
+#define OPTEK_LINK_HOPPING_CH 8
|
|
563
|
#define OPTEK_LINK_MAX_CH 8
|
574
|
#define OPTEK_LINK_MAX_CH 8
|
|
564
|
const u8 optek_link_scan_chan[OPTEK_LINK_MAX_CH] =
|
575
|
const u8 optek_link_scan_chan[OPTEK_LINK_MAX_CH] =
|
|
565
|
{
|
576
|
{
|
|
@@ -589,6 +600,8 @@ U32 frame_count; |
|
@@ -589,6 +600,8 @@ U32 frame_count; |
|
589
|
static U32 first_dma_count;
|
600
|
static U32 first_dma_count;
|
|
590
|
i32 diff_sample;
|
601
|
i32 diff_sample;
|
|
591
|
volatile U8 master_rev_flag;
|
602
|
volatile U8 master_rev_flag;
|
|
|
|
603
|
+
|
|
|
|
604
|
+//U8 key_value;
|
|
592
|
//void?optek_link_rx_cb(u8?*buf,?u16?len,?u8?bc_index,?u16?pt_end_time,?u8?role,?u8?frame_index,?u8?id)?__attribute__?((section?(".internal_ram_1_text")));
|
605
|
//void?optek_link_rx_cb(u8?*buf,?u16?len,?u8?bc_index,?u16?pt_end_time,?u8?role,?u8?frame_index,?u8?id)?__attribute__?((section?(".internal_ram_1_text")));
|
|
593
|
//void?optek_link_rx_cb(u8?*buf,?u16?len,?u8?bc_index,?u16?pt_end_time,?u8?role,?u8?frame_index,?u8?id)
|
606
|
//void?optek_link_rx_cb(u8?*buf,?u16?len,?u8?bc_index,?u16?pt_end_time,?u8?role,?u8?frame_index,?u8?id)
|
|
594
|
void optek_link_rx_cb(u8 *buf, u16 len, u8 bc_index, u16 pt_end_time, u8 role, u8 frame_index, u8 id) __attribute__ ((section (".internal_ram_1_text")));
|
607
|
void optek_link_rx_cb(u8 *buf, u16 len, u8 bc_index, u16 pt_end_time, u8 role, u8 frame_index, u8 id) __attribute__ ((section (".internal_ram_1_text")));
|
|
@@ -609,6 +622,8 @@ void optek_link_rx_cb(u8 *buf, u16 len, u8 bc_index, u16 pt_end_time, u8 role, u |
|
@@ -609,6 +622,8 @@ void optek_link_rx_cb(u8 *buf, u16 len, u8 bc_index, u16 pt_end_time, u8 role, u |
|
609
|
//fifo_put_data(&master_rx_fifo,buf,len);
|
622
|
//fifo_put_data(&master_rx_fifo,buf,len);
|
|
610
|
|
623
|
|
|
611
|
//DBG_Printf("%d-%d-%d,",bc_index,frame_index,pt_end_time);
|
624
|
//DBG_Printf("%d-%d-%d,",bc_index,frame_index,pt_end_time);
|
|
|
|
625
|
+ //if (len)
|
|
|
|
626
|
+ // key_value = buf[len-1];
|
|
612
|
|
627
|
|
|
613
|
memcpy(rx_data_buf,buf,len);
|
628
|
memcpy(rx_data_buf,buf,len);
|
|
614
|
master_rev_flag = 2;
|
629
|
master_rev_flag = 2;
|
|
@@ -847,7 +862,7 @@ u8 optek_link_tx_data_len(u8 role, u8 id) |
|
@@ -847,7 +862,7 @@ u8 optek_link_tx_data_len(u8 role, u8 id) |
|
847
|
{
|
862
|
{
|
|
848
|
if (optek_link_mode == GAME_HEADPHONE_PT_5MS_LP)
|
863
|
if (optek_link_mode == GAME_HEADPHONE_PT_5MS_LP)
|
|
849
|
{
|
864
|
{
|
|
850
|
- len = SLAVE_MAX_TX_LEN;
|
865
|
+ len = bc_tx_data.last_tx_len;
|
|
851
|
}
|
866
|
}
|
|
852
|
else
|
867
|
else
|
|
853
|
{
|
868
|
{
|
|
@@ -902,14 +917,22 @@ u8 optek_link_tx_data_cb(u8 cpy, u8 *buf, u8 role, u8 ext_frame, u8 id) |
|
@@ -902,14 +917,22 @@ u8 optek_link_tx_data_cb(u8 cpy, u8 *buf, u8 role, u8 ext_frame, u8 id) |
|
902
|
bc_tx_data.last_tx_len = 0;
|
917
|
bc_tx_data.last_tx_len = 0;
|
|
903
|
}
|
918
|
}
|
|
904
|
#else
|
919
|
#else
|
|
905
|
- len = bc_tx_data.tx_len;
|
920
|
+ if (role == OPTEK_LINK_MASTER)
|
|
|
|
921
|
+ len = bc_tx_data.tx_len;
|
|
|
|
922
|
+ else
|
|
|
|
923
|
+ {
|
|
|
|
924
|
+ len = bc_tx_data.tx_len;
|
|
|
|
925
|
+/* len = bc_tx_data.tx_len + 1;
|
|
|
|
926
|
+ bc_tx_data.tx_data[bc_tx_data.tx_len] = 0x55;
|
|
|
|
927
|
+*/
|
|
|
|
928
|
+ }
|
|
|
|
929
|
+
|
|
906
|
|
930
|
|
|
907
|
if (len)
|
931
|
if (len)
|
|
908
|
{
|
932
|
{
|
|
909
|
bc_tx_data.tx_len = 0;
|
933
|
bc_tx_data.tx_len = 0;
|
|
910
|
|
934
|
|
|
911
|
CFasm_memcpy((void *)buf, (void *)bc_tx_data.tx_data,len);
|
935
|
CFasm_memcpy((void *)buf, (void *)bc_tx_data.tx_data,len);
|
|
912
|
-
|
|
|
|
913
|
bc_tx_data.last_tx_len = len;
|
936
|
bc_tx_data.last_tx_len = len;
|
|
914
|
}
|
937
|
}
|
|
915
|
else if (bc_tx_data.last_tx_len)
|
938
|
else if (bc_tx_data.last_tx_len)
|
|
@@ -1027,7 +1050,7 @@ u8 optek_link_slave_conn_cb (u8 mode, u8 *slave_max_tx_len, u8 *slave_max_rx_len |
|
@@ -1027,7 +1050,7 @@ u8 optek_link_slave_conn_cb (u8 mode, u8 *slave_max_tx_len, u8 *slave_max_rx_len |
|
1027
|
#if (defined OPL_MODE_TWO_WAY)
|
1050
|
#if (defined OPL_MODE_TWO_WAY)
|
|
1028
|
else if (mode == GAME_HEADPHONE_PT_5MS_LP)
|
1051
|
else if (mode == GAME_HEADPHONE_PT_5MS_LP)
|
|
1029
|
{
|
1052
|
{
|
|
1030
|
- *slave_max_tx_len = 50;
|
1053
|
+ *slave_max_tx_len = 51;
|
|
1031
|
*slave_max_rx_len = 100;
|
1054
|
*slave_max_rx_len = 100;
|
|
1032
|
}
|
1055
|
}
|
|
1033
|
else if (mode == GAME_HEADPHONE_PT7P5MS_T7R3E)
|
1056
|
else if (mode == GAME_HEADPHONE_PT7P5MS_T7R3E)
|