Show newer

The Assignment looks odd because "pstmsg->event" has already been set by the calling function "i2c_interrupt_entry" ... And "pstmsg->event" isn't used after "i2c_transferbytes" returns to "i2c_interrupt_entry" 🤔

github.com/bouffalolab/bl_iot_

We have created an issue for this...
github.com/bouffalolab/bl_iot_

Show thread

1,000 views of my I2C Brain Dump ... Why are Intel, Qualcomm, STMicro and GovTech interested in ? 🤔

lupyuen.github.io/articles/i2c

@Pat @lupyuen I stand corrected: Neither gcc nor clang warn about this with -Werror -Wextra -pedantic. The needless parentheses hide the error (in a single statement there'd be a "warning: suggest parentheses around assignment used as truth value"), but nothing complains :-(

@lupyuen @chrysn
Yeah, it probably should be a "==", although I've often seen guys take advantage of the way "AND" conditionals are processed in order to assign variables (if the first condition is in not true, it won't bother to execute the second test and so the variable won't get assigned, but if the first condition is true the variable is assigned. It's bad form but seems to be accepted practice in some scripting languages.

@lupyuen Unless the right side is secretly a variable: because someone has been developing in C in hubris mode (aka "I don't need fatal warnings, I know what I'm doing").

Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.