2024-02-18 07:47 AM - edited 2024-02-18 07:49 AM
Hi,
I copied below code from internet which works perfect while using HAL_UART_Transmit. However, I want to understand more why there is minus 1 (-1) at timeout parameter ?
P.S.: This question may not be directed at the right section, apologies for that.
Please feel free to direct me on the right section. Thanks.
Solved! Go to Solution.
2024-02-18 08:15 AM - edited 2024-02-18 08:23 AM
Hi,
this is what "real" C programmers like so much: writing some mystery...
-1 as INT32 is 0xFFFFFFFF , what should give a warning here, because timeout is uint32_t ,
the nice-to-read define would be : HAL_MAX_DELAY . ( 0xFFFFFFFFU )
btw
I would set a more useful/realistic timeout, say 100ms ; HAL_MAX_DELAY would wait 49 days...
2024-02-18 08:15 AM - edited 2024-02-18 08:23 AM
Hi,
this is what "real" C programmers like so much: writing some mystery...
-1 as INT32 is 0xFFFFFFFF , what should give a warning here, because timeout is uint32_t ,
the nice-to-read define would be : HAL_MAX_DELAY . ( 0xFFFFFFFFU )
btw
I would set a more useful/realistic timeout, say 100ms ; HAL_MAX_DELAY would wait 49 days...