33 static uint32_t gButtonSameMaskCounter = 0;
86 uint32_t button_same_mask_counter;
90 if (buttonState == gButtonMask) {
91 if (buttonState == 0) {
96 gButtonSameMaskCounter++;
100 button_mask = gButtonMask | buttonState;
103 button_same_mask_counter = gButtonSameMaskCounter;
105 if (buttonState == 0) {
108 gButtonSameMaskCounter = 0;
114 gButtonMask = button_mask;
118 if (buttonState != gButtonMask) {
119 gButtonSameMaskCounter = 0;
136 if ((topScreen != NULL) && (topScreen->buttonCallback != NULL)) {
139 topScreen->buttonCallback(topScreen, event);
148 gButtonSameMaskCounter = 0;
API to draw all basic graphic objects.
#define CONTINUOUS_MASK
300ms after the first 800ms)
@ BUTTON_BOTH_TOUCHED
Sent when both buttons are touched.
@ BUTTON_LEFT_CONTINUOUS_PRESSED
@ BUTTON_BOTH_PRESSED
Sent when both buttons are released.
@ BUTTON_RIGHT_CONTINUOUS_PRESSED
@ BUTTON_LEFT_PRESSED
Sent when Left button is released.
@ BUTTON_RIGHT_PRESSED
Send when Right button is released.
#define RELEASED_MASK
released (see LSB bits to know what buttons are released)
#define LEFT_BUTTON
The different pressed buttons.
#define RIGHT_BUTTON
Right button event.
nbgl_obj_t * nbgl_screenGetTop(void)
Returns the screen on top layer, as a generic object.
struct PACKED__ nbgl_screen_s nbgl_screen_t
struct to represent a screen (SCREEN type)