mirror of
				https://github.com/halleysfifthinc/Toyota-AVC-LAN
				synced 2025-10-28 00:47:29 +00:00 
			
		
		
		
	Move incBCD to sniffer; only used there
This commit is contained in:
		
							parent
							
								
									cedad9df9f
								
							
						
					
					
						commit
						82ab967b7c
					
				| @ -833,15 +833,6 @@ void AVCLan_Register() { | ||||
|   AVCLan_SendAnswer(); | ||||
| } | ||||
| 
 | ||||
| /* Increment packed 2-digit BCD number.
 | ||||
|    WARNING: Overflow behavior is incorrect (e.g. `incBCD(0x99) != 0x00`) */ | ||||
| uint8_t incBCD(uint8_t data) { | ||||
|   if ((data & 0x9) == 0x9) | ||||
|     return (data + 7); | ||||
| 
 | ||||
|   return (data + 1); | ||||
| } | ||||
| 
 | ||||
| void AVCLAN_printframe(const AVCLAN_frame_t *frame) { | ||||
|   if (frame->peripheral_addr == CD_ID || | ||||
|       (frame->broadcast && frame->peripheral_addr == 0x1FF)) | ||||
|  | ||||
| @ -104,8 +104,6 @@ void AVCLan_Send_Status(); | ||||
| void AVCLan_Register(); | ||||
| uint8_t AVCLan_SendAnswer(); | ||||
| 
 | ||||
| uint8_t incBCD(uint8_t data); | ||||
| 
 | ||||
| extern uint8_t cd_Track; | ||||
| extern uint8_t cd_Time_Min; | ||||
| extern uint8_t cd_Time_Sec; | ||||
|  | ||||
| @ -263,6 +263,15 @@ void general_GPIO_init() { | ||||
|   PORTC.PIN1CTRL = PORT_ISC_INPUT_DISABLE_gc; // WOD
 | ||||
| } | ||||
| 
 | ||||
| /* Increment packed 2-digit BCD number.
 | ||||
|    WARNING: Overflow behavior is incorrect (e.g. `incBCD(0x99) != 0x00`) */ | ||||
| uint8_t incBCD(uint8_t data) { | ||||
|   if ((data & 0x9) == 0x9) | ||||
|     return (data + 7); | ||||
| 
 | ||||
|   return (data + 1); | ||||
| } | ||||
| 
 | ||||
| // Periodic interrupt with a 1 sec period
 | ||||
| ISR(RTC_PIT_vect) { | ||||
|   if (CD_Mode == stPlay) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user