415 views
in GUI Development by
Hi Team,

In the DeviceDriver_ProcessData() Function which is defined in DeviceDriver.c file, i modified the code to read an external value

and update the GUI.

For Android Platform, when i run the gradlew command to generate the apk, this change is not getting reflected.

Question:

1. How to Make Changes in DeviceDriver.c (particuarly DeviceDriver_ProcessData() ) and compile it to generate the apk?

2. It was also mentioned that DeviceDriver_ProcessData() is called periodically. What is the period? Can we control the period?

Thanks,
Saravana

1 Answer

+1 vote
by

Hello Saravana,

the file DeviceDriver.c within the Android Build Environment is just a template - it does not contain any hardware access (e.g. to LED or hardbutton as it is the case in all the different Build Environments for MCUs).

The file DeviceDriver.c is prepared to be used to access your own drivers or some communication with other (external) software. Within the file ewmain.c you see that DeviceDriver_Initialize(), DeviceDriver_Deinitialize() and DeviceDriver_ProcessData() is called. This means, when you change the implmentation within DeviceDriver_ProcessData() it will be compiled and it will be part of your APK file. 

Maybe you have not removed the current implementation of DeviceDriver_ProcessData()? There are some #ifdef sections to demonstrate how the communication with the device class could be done - you can remove that and implement your own code.

Generally, I recommend you our documentation Implementing a Device Interface as well as all subordinated chapters. For example, the chapter System Events describes how you feed the GUI application with events. In this chapter you can find the section Trigger System Events in ANSI C and C++ compatible systems. It explains you what code you have to implement in the process containing the GUI application to feed an event to it. As next please see the section Multi-threading and interrupt service routines. It goes into more detail what to do when the event is triggered from a foreign thread.

Concerning your second question: The function DeviceDriver_ProcessData() is called periodically. This means, it is called every cycle of the main loop. Due to the fact that Embedded Wizard is running in a cooperative manner and that the necessary time for one screen update depends on the content, the cycle time is not fixed. DeviceDriver_ProcessData() is intended to be used to transfer the GUI relevant data to the GUI so that it can be considered for the next update. It is not intended for real-time operations.

I hope this helps.

Best regards,

Manfred.

Embedded Wizard Website | Privacy Policy | Imprint

...