152 views
in GUI Development by

Hello,

I cant call from main.c this function even i dont get it completly.I tried to send ADC data this function  XInt32 ApplicationDeviceClass_OnGetADCRead( ApplicationDeviceClass _this ) Value is XInt32 bit but not working. 

 if i write on return any value then i can sent data from stm32 to embedded wizard GUI. like-> return 55;

Can u explain to me what does it mean ( ApplicationDeviceClass _this ) is it should be XInt32 bit right.

EW_DEFINE_FIELDS( ApplicationDeviceClass, XObject )
  EW_PROPERTY( HardButtonCounter, XInt32 )
  EW_OBJECT  ( HardButtonEvent, CoreSystemEvent )
  EW_PROPERTY( ADCRead,         XInt32 )
  EW_PROPERTY( LedStatus,       XBool )
EW_END_OF_FIELDS( ApplicationDeviceClass )

XInt32 ApplicationDeviceClass_OnGetADCRead( ApplicationDeviceClass _this )
{
  return _this->ADCRead;
}
 

 

1 Answer

0 votes
by

Hello,

calling the onget method from the device driver is not the proper way! Please note, that an onget method is called automatically when the associated property is read.

If you want to put your ADC value into the GUI application, your Device Driver (C-Code) should call an UpdateProperty() method within the Device Class.

Please have a look into the provided example 'DeviceIntegration' that you will find within our STM32 Build Environments (subdirectory /Examples): Each time you press the hardbutton on the board, the method UpdateHardButtonCounter() within the class Application::DeviceClass is called.

Your ADC integration should look similar - instead of incrementing a counter you can provide your ADC value to the GUI application.

Best regards,

Manfred.

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!

Embedded Wizard Website | Privacy Policy | Imprint

...