Hello, Massimo.
It is not a bug; the objective here is to cast the resulting value of sorting the three uint8_t values into a uint32_t variable so that they don’t overlap. Only to clarify, the shifting is not made in the uint8_t variable, the processor carries out this shifting and OR process of the three variables and stores the final ORed and shifted values in a memory location to finally be cast to the size of the sak_atqa variable.
The solution you suggested will use more processing resources to obtain the same result.
I hope this helps you to understand in a better way.
Have a great day!
Best regards,
Ivan.
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------