mirror of
				https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
				synced 2025-11-03 22:31:04 +00:00 
			
		
		
		
	Kyosho/Hype: another attempt to fix bind...
This commit is contained in:
		
							parent
							
								
									25ebd55c85
								
							
						
					
					
						commit
						4058f04b39
					
				@ -27,7 +27,7 @@ void A7105_WriteData(uint8_t len, uint8_t channel)
 | 
				
			|||||||
	for (i = 0; i < len; i++)
 | 
						for (i = 0; i < len; i++)
 | 
				
			||||||
		SPI_Write(packet[i]);
 | 
							SPI_Write(packet[i]);
 | 
				
			||||||
	A7105_CSN_on;
 | 
						A7105_CSN_on;
 | 
				
			||||||
	if(protocol!=PROTO_FLYSKY)
 | 
						if(!(protocol==PROTO_FLYSKY || protocol==PROTO_KYOSHO))
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		A7105_Strobe(A7105_STANDBY);	//Force standby mode, ie cancel any TX or RX...
 | 
							A7105_Strobe(A7105_STANDBY);	//Force standby mode, ie cancel any TX or RX...
 | 
				
			||||||
		A7105_SetTxRxMode(TX_EN);		//Switch to PA
 | 
							A7105_SetTxRxMode(TX_EN);		//Switch to PA
 | 
				
			||||||
 | 
				
			|||||||
@ -81,35 +81,47 @@ static void __attribute__((unused)) kyosho_hype_send_packet()
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	if(IS_BIND_IN_PROGRESS)
 | 
						if(IS_BIND_IN_PROGRESS)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
							if(packet_sent==0)
 | 
				
			||||||
 | 
							{//build the packet and send it
 | 
				
			||||||
			packet[0] = rx_tx_addr[1];
 | 
								packet[0] = rx_tx_addr[1];
 | 
				
			||||||
			packet[1] = rx_tx_addr[3];
 | 
								packet[1] = rx_tx_addr[3];
 | 
				
			||||||
			//RF table
 | 
								//RF table
 | 
				
			||||||
			for(uint8_t i=0; i<15;i++)
 | 
								for(uint8_t i=0; i<15;i++)
 | 
				
			||||||
				packet[i+2]=hopping_frequency[i];
 | 
									packet[i+2]=hopping_frequency[i];
 | 
				
			||||||
		rf_ch_num=0x01;
 | 
								A7105_WriteData(17, 0x01);
 | 
				
			||||||
		packet_length=17;
 | 
								packet_sent++;
 | 
				
			||||||
		packet_period=1423;
 | 
								packet_period=1421;
 | 
				
			||||||
 | 
								#if 0
 | 
				
			||||||
 | 
									debug("ch=01 P=");
 | 
				
			||||||
 | 
									for(uint8_t i=0; i<17; i++)
 | 
				
			||||||
 | 
										debug("%02X ", packet[i]);
 | 
				
			||||||
 | 
									debugln("");
 | 
				
			||||||
 | 
								#endif
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								A7105_Strobe(A7105_TX);	//only send
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		//original TX is only refreshing the packet every 20ms and only do retransmit in between
 | 
							//original TX is only refreshing the packet every 20ms and keep repeating the same packet in between (STROBE_TX) 
 | 
				
			||||||
		//6 channels: AETR
 | 
							//build packet=6 channels with order AETR
 | 
				
			||||||
		for(uint8_t i=0; i<6;i++)
 | 
							for(uint8_t i=0;i<6;i++)
 | 
				
			||||||
			packet[i] = convert_channel_8b(i);
 | 
								packet[i] = convert_channel_8b(i);
 | 
				
			||||||
 | 
							//set RF channel
 | 
				
			||||||
		rf_ch_num=hopping_frequency[hopping_frequency_no];
 | 
							rf_ch_num=hopping_frequency[hopping_frequency_no];
 | 
				
			||||||
		hopping_frequency_no++;
 | 
							hopping_frequency_no++;
 | 
				
			||||||
		if(hopping_frequency_no>14)
 | 
							if(hopping_frequency_no>14)
 | 
				
			||||||
			hopping_frequency_no = 0;
 | 
								hopping_frequency_no = 0;
 | 
				
			||||||
		packet_length=6;
 | 
							//send it
 | 
				
			||||||
		packet_period=909;	//packet period fluctuates a lot...
 | 
							A7105_WriteData(6, rf_ch_num);
 | 
				
			||||||
	}
 | 
							packet_period=931;	//packet period fluctuates a lot on the original TX from one packet to the other but stable if looking over a period of 40ms
 | 
				
			||||||
		#if 0
 | 
							#if 0
 | 
				
			||||||
			debug("ch=%02X P=",rf_ch_num);
 | 
								debug("ch=%02X P=",rf_ch_num);
 | 
				
			||||||
		for(uint8_t i=0; i<packet_length; i++)
 | 
								for(uint8_t i=0; i<6; i++)
 | 
				
			||||||
				debug("%02X ", packet[i]);
 | 
									debug("%02X ", packet[i]);
 | 
				
			||||||
			debugln("");
 | 
								debugln("");
 | 
				
			||||||
		#endif
 | 
							#endif
 | 
				
			||||||
	A7105_WriteData(packet_length, rf_ch_num);
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
uint16_t ReadKyosho()
 | 
					uint16_t ReadKyosho()
 | 
				
			||||||
@ -181,6 +193,7 @@ uint16_t initKyosho()
 | 
				
			|||||||
	if(IS_BIND_IN_PROGRESS)
 | 
						if(IS_BIND_IN_PROGRESS)
 | 
				
			||||||
		bind_counter = KYOSHO_BIND_COUNT;
 | 
							bind_counter = KYOSHO_BIND_COUNT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						packet_sent=0;
 | 
				
			||||||
	packet_period=3852;		//FHSS
 | 
						packet_period=3852;		//FHSS
 | 
				
			||||||
	return 2000;
 | 
						return 2000;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -19,7 +19,7 @@
 | 
				
			|||||||
#define VERSION_MAJOR		1
 | 
					#define VERSION_MAJOR		1
 | 
				
			||||||
#define VERSION_MINOR		3
 | 
					#define VERSION_MINOR		3
 | 
				
			||||||
#define VERSION_REVISION	1
 | 
					#define VERSION_REVISION	1
 | 
				
			||||||
#define VERSION_PATCH_LEVEL	71
 | 
					#define VERSION_PATCH_LEVEL	72
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//******************
 | 
					//******************
 | 
				
			||||||
// Protocols
 | 
					// Protocols
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user