Tool/software: Code Composer Studio
I plan to use CAN mailbox17 to send data.
For my codes, the complier warning me: shift count is too large for the statement (1 << 17), see the figure below
Will it hurt my project and how to fix it?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
I plan to use CAN mailbox17 to send data.
For my codes, the complier warning me: shift count is too large for the statement (1 << 17), see the figure below
Will it hurt my project and how to fix it?
Yes, it will.
The compiler treats the '1' as a 16-bit integer, so a left shift of 17 will always result in 0. You need to typecast it to a long so the result makes sense:
ECanaShadow.CANTRS.all = ((Uint32) 1 << 17);
Regards,
Richard