Skip to content

Commit

Permalink
Typo fixes and refactoring before tag (v1.4)
Browse files Browse the repository at this point in the history
  • Loading branch information
SMFSW committed Dec 31, 2020
1 parent e80e8da commit 7d43492
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
16 changes: 7 additions & 9 deletions CRC_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,20 @@

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; }

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;

Expand All @@ -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;
}
Expand Down
10 changes: 4 additions & 6 deletions GPIO_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion stack_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ __INLINE void INLINE__ stack_dump(void) {
print_stack_address(); }



/****************************************************************/
#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion stdream_rdir.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -98,6 +97,7 @@ int NONNULL__ printf_redir(char * str, ...);
int NONNULL__ vprintf_redir(char * str, va_list args);
#endif


/****************************************************************/
#ifdef __cplusplus
}
Expand Down

0 comments on commit 7d43492

Please sign in to comment.