-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Instead of arduino style declaration of Push button,
I would like to suggest such thing below:
The problem I have is that, I can not use const global variable inside my structures.
stPushButton_t* pushButton_getInstance(void)
{
static stPushButton_t* me = NULL;
static stPushButton_t pushButton;
if(NULL == me) /Singleton creation/
{
me = &pushButton;
me->init = init;
me->loop = loop;
me->register_button = register_button;
me->signal_state_change = signal_state_change;
}
return me;
}
Metadata
Metadata
Assignees
Labels
No labels