How can I call the printf statement under i2c_read?

suppose we have two functions -

  • int i2c_read (struct slave *dev) { printf("\n \n The new data written to the register is %d \n \n", data) // this prints null value instead of the data which is written after calling i2c_write. }

  • int i2c_write (struct slave *dev,int data)

How can I print the statement printf("\n \n The new data written to the register is %d \n \n", data) under the function i2c_read keeping in mind that the parameter data gets called from i2c_Write?



Read more here: https://stackoverflow.com/questions/64889642/how-can-i-call-the-printf-statement-under-i2c-read

Content Attribution

This content was originally published by Pragya Gupta at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: