Skip to content

Commit

Permalink
bugfix in PWM off function
Browse files Browse the repository at this point in the history
  • Loading branch information
stancecoke committed May 23, 2024
1 parent 6361af9 commit 3721ed9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Inc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
//---------------------------------------------------------------------
//power settings
#define PH_CURRENT_MAX 1200
#define BATTERYCURRENT_MAX 6000
#define BATTERYCURRENT_MAX 14000
#define REVERSE -1 //1 for normal direction, -1 for reverse
#define PUSHASSIST_CURRENT 300
#define VOLTAGE_MIN 1320 //33V
Expand Down
12 changes: 6 additions & 6 deletions Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,12 +750,12 @@ if(MP.com_mode==Sensorless_openloop||MP.com_mode==Sensorless_startkick)MS.Obs_fl
else uint16_idle_run_counter=0;
if(ui8_KV_detect_flag){ui16_KV_detect_counter++;}
//disable PWM after 1 minute idle run.
if(uint16_idle_run_counter>960){
MS.system_state=Stop;
uint16_idle_run_counter=0;
CLEAR_BIT(TIM1->BDTR, TIM_BDTR_MOE);

}
// if(uint16_idle_run_counter>960){
// MS.system_state=Stop;
// uint16_idle_run_counter=0;
// CLEAR_BIT(TIM1->BDTR, TIM_BDTR_MOE);
//
// }
#if (R_TEMP_PULLUP)
MS.Temperature = T_NTC(adcData[6]); //Thank you Hendrik ;-)
#else
Expand Down

0 comments on commit 3721ed9

Please sign in to comment.