Compare commits
	
		
			1 Commits
		
	
	
		
			eb74553f89
			...
			b2929ad664
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| b2929ad664 | 
							
								
								
									
										12
									
								
								can-halal.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								can-halal.c
									
									
									
									
									
								
							@ -32,14 +32,14 @@ HAL_StatusTypeDef ftcan_add_filter(uint16_t id, uint16_t mask) {
 | 
			
		||||
  static uint32_t next_filter_no = 0;
 | 
			
		||||
  static CAN_FilterTypeDef filter;
 | 
			
		||||
  if (next_filter_no % 2 == 0) {
 | 
			
		||||
    filter.FilterIdHigh = id;
 | 
			
		||||
    filter.FilterMaskIdHigh = mask;
 | 
			
		||||
    filter.FilterIdLow = 0;
 | 
			
		||||
    filter.FilterMaskIdLow = 0xFFFF;
 | 
			
		||||
    filter.FilterIdHigh = id << 5;
 | 
			
		||||
    filter.FilterMaskIdHigh = mask << 5;
 | 
			
		||||
    filter.FilterIdLow = id << 5;
 | 
			
		||||
    filter.FilterMaskIdLow = mask << 5;
 | 
			
		||||
  } else {
 | 
			
		||||
    // Leave high filter untouched from the last configuration
 | 
			
		||||
    filter.FilterIdLow = id;
 | 
			
		||||
    filter.FilterMaskIdLow = mask;
 | 
			
		||||
    filter.FilterIdLow = id << 5;
 | 
			
		||||
    filter.FilterMaskIdLow = mask << 5;
 | 
			
		||||
  }
 | 
			
		||||
  filter.FilterFIFOAssignment = CAN_FILTER_FIFO0;
 | 
			
		||||
  filter.FilterBank = next_filter_no / 2;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user