How to call c macro with parameters #18307
-
Hi all, I try to use v to read/write data through spidev0.0 device. In c, the write data will called ioctl function.Below is example ioctl(fd, SPI_IOC_MESSAGE(1), &tr); the error: unknown function: C.SPI_IOC_MESSAGE
rc := int(C.ioctl(this.fd, C.SPI_IOC_MESSAGE(1), &transfer)) Does the v not support call c macro with parameter? If so, how can this situation be resolved? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You have to define |
Beta Was this translation helpful? Give feedback.
You have to define
C.SPI_IOC_MESSAGE
in your V code, for V to recognize it. V does not parse.h
files, so it cannot know about it otherwise.