AnsweredAssumed Answered

uint16_t sometimes overflow in 255

Question asked by Sajjad Azadfalah on Sep 25, 2017
Latest reply on Sep 25, 2017 by Clive One

Hello friends


I defined a variable uint16_t x;


in my code I will compare x >= 500 Most of the time works fine

But sometimes variable is Overflow in 256 i see in debug variable is 0 after 255+1


i using IAR , STM32F103ZET6 , HAL


How can I fix this?