diff --git a/.travis.yml b/.travis.yml index 531bce18..2fdc962e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,17 @@ # adapted from https://github.com/andysworkshop/stm32plus/blob/master/.travis.yml +branches: + only: + - master + - devel + language: c sudo: false -addons: - apt: - packages: - libc6-i386 +addons: + apt: + packages: + libc6-i386 cache: directories: diff --git a/Firmware/Board/v3.3/Inc/main.h b/Firmware/Board/v3.3/Inc/main.h index a9650093..75bd2260 100644 --- a/Firmware/Board/v3.3/Inc/main.h +++ b/Firmware/Board/v3.3/Inc/main.h @@ -69,6 +69,8 @@ #define TIM_APB1_CLOCK_HZ 84000000 #define TIM_APB1_PERIOD_CLOCKS 4096 #define TIM_APB1_DEADTIME_CLOCKS 40 +#define TIM_TIME_BASE TIM14 + #define M0_nCS_Pin GPIO_PIN_13 #define M0_nCS_GPIO_Port GPIOC diff --git a/Firmware/CHANGELOG.md b/Firmware/CHANGELOG.md index 9d3e620e..0c581bc3 100644 --- a/Firmware/CHANGELOG.md +++ b/Firmware/CHANGELOG.md @@ -1,17 +1,21 @@ -## UNRELEASED -Please add a note of your changes below this heading if you make a PR +# Unreleased Features +Please add a note of your changes below this heading if you make a Pull Request. + +# Releases + +## [0.3.5] - 2018-03-04 ### Added * **Storing of configuration parameters to Non Volatile Memory** * Reporting error if your encoder CPR is incorrect +* Ability to start anticogging calibration over USB protocol * Reporting of DRV status/control registers and fault codes * DRV status read script * Microsecond delay function -* Ability to start anticogging calibration over USB protocol * Travis-CI ### Changed -* Build system is now tup instead of make +* Build system is now tup instead of make. Please check the [Readme](README.md#installing-prerequisites) for installation instructions. ## [0.3.4] - 2018-02-13 diff --git a/Firmware/MotorControl/utils.c b/Firmware/MotorControl/utils.c index 032a996a..a6a02a5a 100644 --- a/Firmware/MotorControl/utils.c +++ b/Firmware/MotorControl/utils.c @@ -187,13 +187,13 @@ uint32_t timeout_to_deadline(uint32_t timeout_ms) { // @brief: Returns number of microseconds since system startup uint32_t micros(void) { - uint32_t usTicks = HAL_RCC_GetSysClockFreq() / 1000000; register uint32_t ms, cycle_cnt; do { ms = HAL_GetTick(); - cycle_cnt = SysTick->VAL; - } while (ms != HAL_GetTick()); - return (ms * 1000) + (usTicks * 1000 - cycle_cnt) / usTicks; + cycle_cnt = TIM_TIME_BASE->CNT; + } while (ms != HAL_GetTick()); + + return (ms * 1000) + cycle_cnt; } // @brief: Busy wait delay for given amount of microseconds (us) @@ -203,4 +203,4 @@ void delay_us(uint32_t us) while (micros() - start < (uint32_t) us) { __ASM("nop"); } -} \ No newline at end of file +}