Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added paramNotifyChanged() to let apps notify the core when they modify the value of a parameter programmatically #1193

Merged
merged 2 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/modules/interface/param_logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ void paramLogicInit();
*/
void paramLogicStorageInit();

/**
* @brief Notify the param subsystem that we changed the value of a param
* programmatically.
*/
void paramNotifyChanged(paramVarId_t varid);

// The following functions SHALL NOT be called outside paramTask!
void paramWriteProcess(CRTPPacket *p);
void paramReadProcess(CRTPPacket *p);
Expand Down
6 changes: 6 additions & 0 deletions src/modules/src/param_logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ void paramWriteProcess(CRTPPacket *p)
}
}

void paramNotifyChanged(paramVarId_t varid) {
if (params[varid.index].callback) {
params[varid.index].callback();
}
}

static char paramWriteByNameProcess(char* group, char* name, int type, void *valptr) {
int index;
char *pgroup = "";
Expand Down