Skip to content

HardwareTimer: warnings introduced by #1550 #1557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fpistm opened this issue Nov 23, 2021 · 0 comments · Fixed by #1558
Closed

HardwareTimer: warnings introduced by #1550 #1557

fpistm opened this issue Nov 23, 2021 · 0 comments · Fixed by #1558
Assignees

Comments

@fpistm
Copy link
Member

fpistm commented Nov 23, 2021

Introduced by #1550: https://github.com/stm32duino/Arduino_Core_STM32/pull/1550/files#diff-92fadde44a62db1d865755492bfafe922d6200f5006456bf738ef33692276c79R1177

C:\STM32\arduino\arduino-1.8.16\portable\packages\STMicroelectronics\hardware\stm32\2.1.0\cores\arduino\HardwareTimer.cpp:1177:7: warning: unused variable 'timAssociatedInputChannel' [-Wunused-variable]
 1177 |   int timAssociatedInputChannel;
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~

Edit:
__HAL_TIM_GET_IT_SOURCE usage also bring a warning, the interrupt type should be checked:

C:\STM32\arduino\arduino-1.8.16\portable\packages\STMicroelectronics\hardware\stm32\2.1.0\cores\arduino\HardwareTimer.cpp: In member function 'bool HardwareTimer::isRunningChannel(uint32_t)':
C:\STM32\arduino\arduino-1.8.16\portable\packages\STMicroelectronics\hardware\stm32\2.1.0\system/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h:1234:62: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'int' [-Wsign-compare]
 1233 | #define __HAL_TIM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->DIER & (__INTERRUPT__)) \
      |                                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1234 |                                                              == (__INTERRUPT__)) ? SET : RESET)
      |                                                              ^~~~~~~~~~~~~~~~~~
C:\STM32\arduino\arduino-1.8.16\portable\packages\STMicroelectronics\hardware\stm32\2.1.0\cores\arduino\HardwareTimer.cpp:1193:13: note: in expansion of macro '__HAL_TIM_GET_IT_SOURCE'
 1193 |         || (__HAL_TIM_GET_IT_SOURCE(&(_timerObj.handle), interrupt) == SET);
      |             ^~~~~~~~~~~~~~~~~~~~~~~

Tips: Think to enable all verbose to ensure to see all warnings 😉

@fpistm fpistm added this to the 2.2.0 milestone Nov 23, 2021
@fpistm fpistm changed the title HardwareTimer: unused variable HardwareTimer: warnings introduce by #1550 Nov 23, 2021
@fpistm fpistm changed the title HardwareTimer: warnings introduce by #1550 HardwareTimer: warnings introduced by #1550 Nov 23, 2021
ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this issue Nov 23, 2021
Compilation warning introduced by stm32duino#1550
Fixes stm32duino#1557

Signed-off-by: Alexandre Bourdiol <[email protected]>
ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this issue Nov 23, 2021
fpistm pushed a commit that referenced this issue Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants