Ready for install: Switch to CAN1 and add unused PWM IDs for front
This commit is contained in:
		@ -2,8 +2,8 @@
 | 
				
			|||||||
#define MAPPINGS_H
 | 
					#define MAPPINGS_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// CHOOSE ONE, comment the other or comment both and use -D SN_FRONT
 | 
					// CHOOSE ONE, comment the other or comment both and use -D SN_FRONT
 | 
				
			||||||
//#define SN_FRONT
 | 
					#define SN_FRONT
 | 
				
			||||||
#define SN_REAR
 | 
					//#define SN_REAR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
#include "main.h"
 | 
					#include "main.h"
 | 
				
			||||||
@ -129,6 +129,11 @@ static can_pkt_t CAN_SIGNAL_MAP[NUM_TX_PKT] = {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define CAN_PWM_DC_ID 0x0DA // UNUSED
 | 
				
			||||||
 | 
					#define CAN_PWM_CONF_ID 0x0DB // UNUSED
 | 
				
			||||||
 | 
					#define CAN_PWM_BASE_ID CAN_PWM_DC_ID
 | 
				
			||||||
 | 
					#define CAN_PWM_FILTER_MASK 0x7FE // Match both
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef SN_REAR
 | 
					#ifdef SN_REAR
 | 
				
			||||||
@ -173,6 +178,8 @@ static can_pkt_t CAN_SIGNAL_MAP[NUM_TX_PKT] = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#define CAN_PWM_DC_ID 0x0DC
 | 
					#define CAN_PWM_DC_ID 0x0DC
 | 
				
			||||||
#define CAN_PWM_CONF_ID 0x0DD
 | 
					#define CAN_PWM_CONF_ID 0x0DD
 | 
				
			||||||
 | 
					#define CAN_PWM_BASE_ID CAN_PWM_DC_ID
 | 
				
			||||||
 | 
					#define CAN_PWM_FILTER_MASK 0x7FE // Match both 0x0DC and 0x0DD
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -191,8 +191,8 @@ int main(void)
 | 
				
			|||||||
  MX_NVIC_Init();
 | 
					  MX_NVIC_Init();
 | 
				
			||||||
  /* USER CODE BEGIN 2 */
 | 
					  /* USER CODE BEGIN 2 */
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  hMainCAN = &hfdcan2;
 | 
					  hMainCAN = &hfdcan1;
 | 
				
			||||||
  hPeriCAN = &hfdcan1;
 | 
					  hPeriCAN = &hfdcan2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED) != HAL_OK)
 | 
					  if (HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED) != HAL_OK)
 | 
				
			||||||
    Error_Handler();
 | 
					    Error_Handler();
 | 
				
			||||||
@ -226,8 +226,8 @@ int main(void)
 | 
				
			|||||||
  filter.FilterIndex = 0;
 | 
					  filter.FilterIndex = 0;
 | 
				
			||||||
  filter.FilterType = FDCAN_FILTER_MASK;
 | 
					  filter.FilterType = FDCAN_FILTER_MASK;
 | 
				
			||||||
  filter.FilterConfig = FDCAN_FILTER_TO_RXFIFO0;
 | 
					  filter.FilterConfig = FDCAN_FILTER_TO_RXFIFO0;
 | 
				
			||||||
  filter.FilterID1 = 0x0DD;
 | 
					  filter.FilterID1 = CAN_PWM_BASE_ID;
 | 
				
			||||||
  filter.FilterID2 = 0x7FE; // Match 0x0DC and 0x0DD
 | 
					  filter.FilterID2 = CAN_PWM_FILTER_MASK;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (HAL_FDCAN_ConfigFilter(hMainCAN, &filter) != HAL_OK)
 | 
					  if (HAL_FDCAN_ConfigFilter(hMainCAN, &filter) != HAL_OK)
 | 
				
			||||||
    Error_Handler();
 | 
					    Error_Handler();
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										3
									
								
								pre-commit.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								pre-commit.sh
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[ ! find . -type f -iname "*.lck" ] 
 | 
				
			||||||
		Reference in New Issue
	
	Block a user