Skip to content

Commit c167d26

Browse files
committedAug 27, 2021
copy inverter test copy
1 parent 793192d commit c167d26

File tree

430 files changed

+255209
-1786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

430 files changed

+255209
-1786
lines changed
 

‎calibration_inverter/Core/Src/main.c

+27-5
Original file line numberDiff line numberDiff line change
@@ -431,20 +431,39 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
431431
if((cycle%20) == 0){
432432
//CAN transmit
433433

434-
HAL_CAN_AddTxMessage(&hcan1,&TxMessage_right,TxData_R,&TxMailbox);
435-
HAL_CAN_AddTxMessage(&hcan1,&TxMessage_left ,TxData_L,&TxMailbox);
436-
HAL_IWDG_Refresh(&hiwdg);
437-
HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_1);
434+
HAL_CAN_AddTxMessage(&hcan1,&TxMessage_right,TxData_R,&TxMailbox);
435+
HAL_CAN_AddTxMessage(&hcan1,&TxMessage_left ,TxData_L,&TxMailbox);
436+
HAL_IWDG_Refresh(&hiwdg);
437+
HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_1);
438438
}
439439

440440
if(enable) {
441+
/*
441442
TxData_L[3] = 5;
442443
TxData_L[2] = 220;
443444
TxData_L[5] = 5;
445+
*/
446+
TxData_L[0] = 30;
447+
TxData_L[1] = 0;
448+
TxData_L[5] = 1;
449+
450+
TxData_R[0] = 30;
451+
TxData_R[1] = 0;
452+
TxData_R[5] = 1;
453+
HAL_GPIO_WritePin(readyToDrive_LED_GPIO_Port,readyToDrive_LED_Pin,GPIO_PIN_SET);
444454
}else{
455+
TxData_L[0] = 0;
456+
TxData_L[1] = 0;
445457
TxData_L[3] = 0;
446458
TxData_L[2] = 0;
447459
TxData_L[5] = 0;
460+
461+
TxData_R[0] = 0;
462+
TxData_R[1] = 0;
463+
TxData_R[3] = 0;
464+
TxData_R[2] = 0;
465+
TxData_R[5] = 0;
466+
HAL_GPIO_WritePin(readyToDrive_LED_GPIO_Port,readyToDrive_LED_Pin,GPIO_PIN_RESET);
448467
}
449468
++cycle;
450469
}
@@ -472,6 +491,7 @@ void CAN_filterConfig(void){
472491
} //enable interrupt
473492

474493
}
494+
475495
void CAN_Txsetup(){
476496
if(HAL_CAN_Start(&hcan1)!=HAL_OK){
477497
Error_Handler();
@@ -536,12 +556,14 @@ void CAN_Txsetup(){
536556
TxData_clear[7]=0;
537557

538558
}
539-
559+
\
560+
/*
540561
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan){
541562
if(HAL_CAN_GetRxMessage(hcan,CAN_RX_FIFO0,&RxMessage,RxData)!=HAL_OK){
542563
Error_Handler();
543564
}
544565
}
566+
*/
545567

546568

547569
void driving_mode(void){

‎calibration_inverter/MDK-ARM/controlBroad_program.uvguix.bob90

+66-66
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.