STMicroelectronics / STM32CubeF0

STM32Cube MCU Full Package for the STM32F0 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
147 stars 63 forks source link

fix HAL_GPIO_TogglePin() #6

Closed nxrtos closed 4 years ago

nxrtos commented 4 years ago

fix HAL_GPIO_TogglePin() to allow parameter of GPIO_Pin to be a combination of pins.

This fix will flip the pins given in GPIO_Pin and each individual pin in GPIO_Pin doesn't has to be in a same state.

to verify the work,

  HAL_GPIO_WritePin(GPIOC, LD3_Pin, GPIO_PIN_SET);
  HAL_GPIO_WritePin(GPIOC, LD4_Pin, GPIO_PIN_RESET);
  /* Infinite loop */
  for(;;)
  {
    osDelay(300);
    HAL_GPIO_TogglePin(GPIOC, LD4_Pin|LD3_Pin);
  }

IMPORTANT INFORMATION

Contributor License Agreement (CLA)

ALABSTM commented 4 years ago

Hi @nxrtos,

Thank you for this contribution. You solution has been tested successfully and allows to toggle simultaneously multiple pins in different logic states.

Although the current implementation of the HAL_GPIO_TogglePin() function allows to toggle multiple pins at once, it does not allow to toggle pins in different logic states. It rather forces all pins provided as argument to the same logic state each time.

Thank you once more for your contribution. It will be forwarded to our development teams to confirm whether it will be adopted. I will be back to you as soon as I get their feedback.

With regards,

ALABSTM commented 4 years ago

ST Internal Reference: 85542

nxrtos commented 4 years ago

Sounds good. BTW, off the topic, I was working on STSW-BLUENRG1-DK and have bunch of fixes like to share with ST, but I can't find any public repo mapping to the package. Is there any reason to make it non-public? Regards, -Andy

ALABSTM commented 4 years ago

Hi @nxrtos,

Our development teams reported that this issue is already known. It has been internally fixed. The fix will be published in the frame of a future publication. Thank you once more for having reported.

Regarding your question about STSW-BLUENRG1-DK, you can report to the ST Community here.

Cube Expansion packages have not been published on GitHub yet. This is planned. Unfortunately, we cannot share a date for the moment. Once done, you will be able to file issues and pull-requests to share your fixes and proposals.

With regards,

ALABSTM commented 4 years ago

Hi @nxrtos,

I hope you are doing well. Just to let you know the issue you reported has been fixed and that the fix is already available in the frame of v1.11.1 of the STM32CubeF0 package published a couple of weeks ago.

Below is the code snippet showing the fix. https://github.com/STMicroelectronics/STM32CubeF0/blob/7b44872c87d4ef209386bb6bebe821f4b526b576/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_gpio.c#L447-L451

Thank you again for your contribution. Allow me to close this pull-request now.

With regards,