Hi,
Just to report something I think is a little bug. When Wdog1 component is created by PE (KDS 3.0) the WDog1_DeviceData define is not created so I have to add it in order to use the component Methods as shown
#define WDog1_DeviceData ((LDD_TDeviceData *)PE_LDD_GetDeviceStructure(PE_LDD_COMPONENT_WDog1_ID))
Could someone confirm this PE issue?
regards,
gaston
已解决! 转到解答。
Hi gaston,
yes, you can do this at runtime. the return value of the Init() function returns you that device handle otherwise.
Erich
Hello gaston,
Please see the file of "WDog1.h" , it have define the "WDog1_DeviceData" .
If still have any question , please contact me !
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Gaston,
It seems that you have not enabled the Auto Initialization in the WatchDog_LDD component.
In the WatchDog_LDD component, set the Initialization/Auto Initialization property to the "yes" value and generate Processor Expert Code. The following definition will be generated in the WDog1.h header file:
Best Regards,
Marek Neuzil
Yes Marek, I have to set the Initialization/Auto Initialization property to the "yes" to generate the definition. Anyway I think that it has to be created if the property is set or not. Don't you think so?
regards,
gaston
Hi Gaston,
that WDog1_DeviceData is only created and present if you enable that 'auto initialization' option. What happens is that during PE_Low_Level_Init() it calls the Init function of the component to create that handle for you.
Otherwise: You can call the Init() function yourself to create that handle.
So if you really have that option set in the component, and it does not create that define and initialization for you, then this is clearly a bug for me.
Erich
Hello Erich,
Imagine I don't want to auto-initialize the component because I like to do it during runtime for disabling , enabling or re-configuring the component. In this escenario WDog1_DeviceData is not created and I cannot use the WDog1 methods.
Are you saying that after calling the Init() function the WDog1_DeviceData is created and hence I can use it?
regards,
gaston
Hello gaston,
About this chip , on Wind7 KDS3.0 , it have the definition.
Sorry on my side there is not have the Linux, hope some one else can test it on the Linux.
And can you test on other computer which is also Linux system ? If it also have not this definition, this maybe a bug .
BR
Alice