We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In this code:
#ifdef CONFIG_PLAT_IMX7 /* eanble the 24MHz source and select the oscillator as CLKSRC */ gptcr |= (BIT(EN_24M) | (5u << CLKSRC)); #else gptcr |= BIT(CLKSRC); #endif
(from libplatsupport/src/mach/imx/gpt.c) the use of the BIT macro is very confusing.
libplatsupport/src/mach/imx/gpt.c
BIT
The value of CLKSRC is 6, but that field is not a single bit, rather it is a 3-bit field (bits 6, 7, 8).
CLKSRC
6
Although it is the same after expansion, I think:
gpctr |= (1u << CLKSRC)
would make the intent clearer. Or even:
#define NO_CLOCK 0 #define PERIPHERAL_CLOCK 1 #define HIGH_FREQUENCY_REFERENCE_CLOCK 2 #define EXTERNAL_CLOCK 3 .... ... qpctr |= (PERIPHERAL_CLOCK << CLKSRC)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In this code:
(from
libplatsupport/src/mach/imx/gpt.c
) the use of theBIT
macro is very confusing.The value of
CLKSRC
is6
, but that field is not a single bit, rather it is a 3-bit field (bits 6, 7, 8).Although it is the same after expansion, I think:
would make the intent clearer. Or even:
The text was updated successfully, but these errors were encountered: