According to the document, if we implement a variant for a deviceclass and the variant condition is true, the original implementation should no longer be available:
However, I found that the generated code still contains the code for the original class. For example, belowing the "Coffee Machine" project from the "Quick Tour" example.The DeviceClass contains the native code that would call the C function "YourDevice_StartBrewing()". But even if I select the VariantCond on "DeviceClassVariantForPrototypeOnly" to be true, the generated code still contains the code for the original class, although the variant is actived successfully when I run the code on the target hardware.
Is there something wrong here?
Hi Paul,Thanks for replying. I know that the variant on that project is intended to be used during prototyping, I was just trying to run the same code on the hardware.Anyway, I also saw that the variant is working differently on the Bitmap Resouce. I mean if I create a variant for the Bitmap Resource and set the variantcond to be true, I found that the generated code would only contain the bitmap data for the variant. This is good. This is what I expected on the deviceclass variant, the generated code shouldn't contain some piece of code that would never be called.But this is not really a problem now, I know how to avoid it. Thanks!Best Regards,
Ask Embedded Wizard
Welcome to the question and answer site for Embedded Wizard users and UI developers.
Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!