diff --git a/README.md b/README.md index a1936c74..f41217e1 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,10 @@ Therefore this is an attempt to: - See also [@byDagor](https://github.com/byDagor)'s *fully-integrated* ESP32 based board: [Dagor Brushless Controller](https://github.com/byDagor/Dagor-Brushless-Controller) > NEW RELEASE 📢 : SimpleFOClibrary v2.3.2 +> - Improved [space vector modulation code](https://github.com/simplefoc/Arduino-FOC/pull/309) thanks to [@Candas1](https://github.com/Candas1) > - Bugfix for teensy3.2 - [#321](https://github.com/simplefoc/Arduino-FOC/pull/321) > - Added teensy3/4 compile to the github CI using platformio +> - And more bugfixes - see the [complete list of 2.3.2 fixes here](https://github.com/simplefoc/Arduino-FOC/issues?q=is%3Aissue+milestone%3A2.3.2_Release) ## Arduino *SimpleFOClibrary* v2.3.2 diff --git a/library.properties b/library.properties index 69043875..7242d57c 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Simple FOC -version=2.3.1 +version=2.3.2 author=Simplefoc maintainer=Simplefoc sentence=A library demistifying FOC for BLDC motors diff --git a/src/StepperMotor.cpp b/src/StepperMotor.cpp index 2835d355..7831f0bf 100644 --- a/src/StepperMotor.cpp +++ b/src/StepperMotor.cpp @@ -134,7 +134,7 @@ int StepperMotor::alignSensor() { SIMPLEFOC_DEBUG("MOT: Align sensor."); // if unknown natural direction - if(!_isset(sensor_direction)){ + if(sensor_direction == Direction::UNKNOWN){ // check if sensor needs zero search if(sensor->needsSearch()) exit_flag = absoluteZeroSearch(); // stop init if not found index diff --git a/src/drivers/hardware_specific/renesas/renesas.cpp b/src/drivers/hardware_specific/renesas/renesas.cpp index 02299f11..2c9c9b22 100644 --- a/src/drivers/hardware_specific/renesas/renesas.cpp +++ b/src/drivers/hardware_specific/renesas/renesas.cpp @@ -144,7 +144,7 @@ bool configureTimerPin(RenesasHardwareDriverParams* params, uint8_t index, bool uint8_t timer_channel = GET_CHANNEL(pinCfgs[0]); // check its not used if (channel_used[timer_channel]) { - SIMPLEFOC_DEBUG("DRV: channel in use"); + SIMPLEFOC_DEBUG("DRV: channel in use: ", timer_channel); return false; } @@ -262,26 +262,17 @@ bool configureTimerPin(RenesasHardwareDriverParams* params, uint8_t index, bool t->ext_cfg.gtior_setting.gtior_b.gtiob = 0x03 | (active_high ? 0x00 : 0x10); t->ext_cfg.gtior_setting.gtior_b.obdflt = active_high ? 0x00 : 0x01; } - - // lets stop the timer in case its running - if (GPT_OPEN == t->ctrl.open) { - if (R_GPT_Stop(&(t->ctrl)) != FSP_SUCCESS) { - SIMPLEFOC_DEBUG("DRV: timer stop failed"); - return false; - } - } - memset(&(t->ctrl), 0, sizeof(gpt_instance_ctrl_t)); err = R_GPT_Open(&(t->ctrl),&(t->timer_cfg)); if ((err != FSP_ERR_ALREADY_OPEN) && (err != FSP_SUCCESS)) { SIMPLEFOC_DEBUG("DRV: open failed"); return false; } - #if defined(SIMPLEFOC_RESENSAS_DEBUG) if (err == FSP_ERR_ALREADY_OPEN) { SimpleFOCDebug::println("DRV: timer already open"); + return false; } - #endif + err = R_GPT_PeriodSet(&(t->ctrl), t->timer_cfg.period_counts); if (err != FSP_SUCCESS) { SIMPLEFOC_DEBUG("DRV: period set failed");