I met strange errors in ARM compiler 5, which are as follows:
..\CM7\Src\usart_funtions.c(109): error: #65: expected a ";" USART3->CR1 |= 0b1;
..\CM7\Src\usart_funtions.c(121): error: #18: expected a ")" while(((USART3->ISR) & (0b1 << 7)) == 0) ;
(However, ARM compiler 6 compiles without errors.)
Unfortunately, I have to use ARM compiler 5.
It doesn't support binary constants, replace 0b1 with 1
Westonsupermare Pier said:It doesn't support binary constants
That's "it" as in "The 'C' Programming Language" - until very recently
https://stackoverflow.com/questions/18244726/why-doesnt-c-have-binary-literals
EDIT
Hmmm ... can't find a reference to when they were introduced in 'C' (have they, even?) but it seems C++ introduced them in C++ 14:
https://en.cppreference.com/w/cpp/language/integer_literal
ARMCC will support this if GNU extensions are enabled.
Andy Neil said:Westonsupermare Pier said:It doesn't support binary constants That's "it" as in "The 'C' Programming Language" - until very recently
The supported 'C' language standards are listed here:
https://developer.arm.com/docs/dui0472/l/overview-of-the-compiler/source-language-modes-of-the-compiler
None of those supports binary literals.