diff --git a/CRC_stm32.c b/CRC_stm32.c index 4baa544..147a000 100755 --- a/CRC_stm32.c +++ b/CRC_stm32.c @@ -13,12 +13,12 @@ FctERR NONNULL__ crc_compute(uint32_t * const crc, const eCRCFeedSize feed_size, const uint32_t start_addr, const uint32_t size) { - div_t len; - uint8_t * dat8 = NULL; - uint16_t * dat16 = NULL; - uint32_t * dat32 = NULL; + div_t len; + uint8_t * dat8 = NULL; + uint16_t * dat16 = NULL; + uint32_t * dat32 = NULL; - if (feed_size == CRC_Feed_DWORD) { dat32 = (uint32_t *) start_addr; } + if (feed_size == CRC_Feed_DWORD) { dat32 = (uint32_t *) start_addr; } else if (feed_size == CRC_Feed_WORD) { dat16 = (uint16_t *) start_addr; } else if (feed_size == CRC_Feed_BYTE) { dat8 = (uint8_t *) start_addr; } else { return ERROR_VALUE; } @@ -26,8 +26,7 @@ FctERR NONNULL__ crc_compute(uint32_t * const crc, const eCRCFeedSize feed_size, len = div(size, feed_size); if (len.rem) { return ERROR_COMMON; } - // Enable CRC - __HAL_RCC_CRC_CLK_ENABLE(); + __HAL_RCC_CRC_CLK_ENABLE(); // Enable CRC CRC->CR |= CRC_CR_RESET; @@ -40,8 +39,7 @@ FctERR NONNULL__ crc_compute(uint32_t * const crc, const eCRCFeedSize feed_size, *crc = CRC->DR; - // Disable CRC - __HAL_RCC_CRC_CLK_DISABLE(); + __HAL_RCC_CRC_CLK_DISABLE(); // Disable CRC return ERROR_OK; } diff --git a/GPIO_out.c b/GPIO_out.c index b88240b..967e292 100644 --- a/GPIO_out.c +++ b/GPIO_out.c @@ -86,7 +86,11 @@ static FctERR NONNULL__ GPIO_out_Start( GPIO_out * const out, const eGPIO_out_mo active = (active * GPIO_OUT_IT_PER) / 1000; inactive = (inactive * GPIO_OUT_IT_PER) / 1000; + out->hOut = 0; + diInterrupts(); + #else + out->hOut = HALTicks(); #endif out->mode = mode; @@ -97,12 +101,6 @@ static FctERR NONNULL__ GPIO_out_Start( GPIO_out * const out, const eGPIO_out_mo out->infinite = count ? false : true; out->cnt = count; - #ifdef GPIO_OUT_IT - out->hOut = 0; - #else - out->hOut = HALTicks(); - #endif - out->start = true; out->active = true; out->idle = false; diff --git a/ReleaseNotes.md b/ReleaseNotes.md index da4f014..952b0fa 100755 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -62,7 +62,7 @@ SOFTWARE. * PWM: split between PWM and PWM_GPIO files (PWM_GPIO module function and types names refactored) * PWM: Set preload configuration bit when initializing PWM channel * PWM: changed pre-comp test for consistency -* PWM: set_PWM_Duty_Scaled calulations now only using integers +* PWM: set_PWM_Duty_Scaled calculations now only using integers * PWM: more precision when trying to set TIM frequency (still 16b max) * PMW: logic PWM getters now returns value directly instead of using pointer in function parameters * PWM: added start_polarity parameter in init_PWM_Chan (to ensure there is no glitch with wrong polarity at PWM engine start) @@ -93,7 +93,7 @@ SOFTWARE. ## v1.3 * Adding support for doxygen documentation generation with Travis CI -* added const qualifier to more function paramaters +* added const qualifier to more function parameters * pattern2d: added linearization patterns * UART_term & stdream_rdir: use UART_REDIRECT define to enable UART redirection * uart_term: SERIAL_DBG_Wait_Ready returns ERROR_NOTAVAIL when UART not initialized diff --git a/stack_utils.h b/stack_utils.h index af4419b..db1b880 100755 --- a/stack_utils.h +++ b/stack_utils.h @@ -186,7 +186,6 @@ __INLINE void INLINE__ stack_dump(void) { print_stack_address(); } - /****************************************************************/ #ifdef __cplusplus } diff --git a/stdream_rdir.h b/stdream_rdir.h index 8b5800a..0d7ca1d 100755 --- a/stdream_rdir.h +++ b/stdream_rdir.h @@ -78,7 +78,6 @@ int NONNULL__ vprintf_ITM(char * str, va_list args); #if !STDREAM_RDIR_SND_SYSCALLS -// General printf & vprintf redirection, will flood all enabled ports (at the cost of speed) /*!\brief printf like redirected to DBG_SERIAL UART and/or ITM port 0 ** \param[in] str - pointer to string to send ** \param[in] ... - Variadic string arguments @@ -98,6 +97,7 @@ int NONNULL__ printf_redir(char * str, ...); int NONNULL__ vprintf_redir(char * str, va_list args); #endif + /****************************************************************/ #ifdef __cplusplus }