Invalid assignment to rmt_encode_state_t for RMT led strip encoder example (IDFGH-9881) (IDFGH-9882) #11200
Closed
3 tasks done
Labels
Resolution: Done
Issue is done internally
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Answers checklist.
IDF version.
v5.1-dev
Operating System used.
macOS
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
What is the expected behavior?
Example should compile.
What is the actual behavior?
Example does not compile.
Steps to reproduce.
Try to compile using strict compiler settings. I embedded it in a c++ project and adapted the example, removing the "extern C". This will not allow the assignment due to strict type checking.
In the examples/peripherals/rmt/led_strip/main/led_strip_encoder.c on line 25 and 26 the following assignment is done:
However, the rmt_encode_state_t is defined in components/driver/rmt/include/driver/rmt_encoder.h as
This means it cannot be assigned 0 and thus the example does not work, as the fields of rmt_encode_state_t are 1 and 2. It might be useful to adapt rmt_encode_state_t to include a field RMT_ENCODING_OK = 0 (which I think would be the right thing to do as this type serves to hold the return code from the rmt encoders) or the example needs to be adapted.
Build or installation Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered: