Skip to content
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

warning: unused variable in stm32u0xx_hal_rtc.h #3

Open
CanastraRF opened this issue Jun 10, 2024 · 4 comments
Open

warning: unused variable in stm32u0xx_hal_rtc.h #3

CanastraRF opened this issue Jun 10, 2024 · 4 comments
Assignees
Labels
bug Something isn't working hal HAL-LL driver-related issue or pull-request. internal bug tracker Issue confirmed and logged into the internal bug tracking system rtc Real-Time Clock

Comments

@CanastraRF
Copy link

Hi
In File stm32u0xx_hal_rtc.h are the following macros:

#define __HAL_RTC_WRITEPROTECTION_DISABLE(HANDLE)
#define __HAL_RTC_WRITEPROTECTION_ENABLE(HANDLE)
#define __HAL_RTC_DAYLIGHT_SAVING_TIME_ADD1H(HANDLE, BKP)
#define __HAL_RTC_DAYLIGHT_SAVING_TIME_SUB1H(HANDLE, BKP)
#define __HAL_RTC_ALARMA_ENABLE(HANDLE)
#define __HAL_RTC_ALARMA_DISABLE(HANDLE)
#define __HAL_RTC_ALARMB_ENABLE(HANDLE)
#define __HAL_RTC_ALARMB_DISABLE(HANDLE)
#define __HAL_RTC_ALARM_ENABLE_IT(HANDLE, INTERRUPT)
#define __HAL_RTC_ALARM_DISABLE_IT(HANDLE, INTERRUPT)
#define __HAL_RTC_ALARM_GET_IT(HANDLE, INTERRUPT)
#define __HAL_RTC_ALARM_GET_IT_SOURCE(HANDLE, INTERRUPT)
#define __HAL_RTC_ALARM_GET_FLAG(HANDLE, FLAG)
#define __HAL_RTC_ALARM_CLEAR_FLAG(HANDLE, FLAG)

that access the RTC directly and not with HANDLE.
So we get lot of warning: unused variable.

Please use (HANDLE)->Instance->... instead of RTC->... as in all other cubes (F0-F4, G0,G4,L0-F4) sources.

@ALABSTM ALABSTM added bug Something isn't working hal HAL-LL driver-related issue or pull-request. rtc Real-Time Clock needs clarification Needs clarification or inputs from the user labels Jun 14, 2024
@ALABSTM
Copy link

ALABSTM commented Jun 14, 2024

Hi @CanastraRF,

Would you please specify the compiler you are using, its version and the enabled flags?

Thanks,

@CanastraRF
Copy link
Author

Hi
We've code like the following:

static RTC_TimeTypeDef * RTC_HandleGet( void );
void RTC_AlarmAEnable(void);

RTC_TimeTypeDef g_hRTC;

static RTC_TimeTypeDef * RTC_HandleGet( void )
{
return &g_hRTC;
}

void RTC_AlarmAEnable(void)
{
RTC_TimeTypeDef * const hRTC = RTC_HandleGet();
__HAL_RTC_ALARMA_ENABLE( hRTC );
}

The warning is with GCC, ARMCLANG, VC++, PCLint, ...
There is no warning with STM32F0, STM32F1, STM32F2, STM32F3, STM32F4, STM32L0, STM32L1, STM32L4, STM32G0, STM32G4 Cube Files

What do you mean with enabled flags?

"-Wunused-variable" is a widely used warning.

@ALABSTM ALABSTM added internal bug tracker Issue confirmed and logged into the internal bug tracking system and removed needs clarification Needs clarification or inputs from the user labels Jun 21, 2024
@ALABSTM
Copy link

ALABSTM commented Jun 21, 2024

Hi @CanastraRF,

You point has been logged into an internal tracker. Let's wait for the feedback of the development teams.

With regards,

@ALABSTM
Copy link

ALABSTM commented Jun 21, 2024

ST Internal Reference: 184768

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hal HAL-LL driver-related issue or pull-request. internal bug tracker Issue confirmed and logged into the internal bug tracking system rtc Real-Time Clock
Projects
Status: In progress
Development

No branches or pull requests

2 participants