Hi friends,
I have a question that maybe is silly, but I could not solve it.
I try to understand where "persist.Userdata" is generated, I understand that it must be from an array, but that in between it has a point (persist (.) Userdata) already seems strange to me because according to my knowledge no points are used, which I can read to understand where those functions are ??
regards
Doubt
Moderators: TomKerekes, dynomotion
Re: Doubt
It is part of Dymotion's proprietary code, so the only information publicly available is the header file with the declarations, not the code behind. The header file is KMotionDef.h, which can be found in the DSP_KFLOP directory.
The relevant extract from the header file is-
The relevant extract from the header file is-
Code: Select all
// This structure is set to default every time the program runs UNTIL
// the program image has been FLASHED using the FLASH command
// from then on it will not be cleared, so data that was present at the
// time it was flashed will persist
#define N_USER_DATA_VARS 100
typedef struct
{
int RunOnStartUp; // word Bits 1-7 selects which threads to execute on startup
unsigned int EntryPoints[N_USER_THREADS]; // each downloaded program's entry point
int UserData[N_USER_DATA_VARS]; // General purpose way to share and or save user program data
} PERSIST;
extern PERSIST persist;
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Doubt
Hi aaperezd,
C allows the use of data structures which are basically a grouping of variables. The "dot" operator is used to select a sub member of a data structure. The array int UserData[N_USER_DATA_VARS] is a member of the data structure PERSIST. The variable persist is one instance of the structure type PERSIST and is declared internally withing KFLOP.
Here is a reference.
HTH
C allows the use of data structures which are basically a grouping of variables. The "dot" operator is used to select a sub member of a data structure. The array int UserData[N_USER_DATA_VARS] is a member of the data structure PERSIST. The variable persist is one instance of the structure type PERSIST and is declared internally withing KFLOP.
Here is a reference.
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.