RSeries astromech firmware
ProgrammableController.h File Reference
#include "ReelTwo.h"
#include "JoystickController.h"
+ Include dependency graph for ProgrammableController.h:

Go to the source code of this file.

Classes

class  ProgrammableController
 
struct  ProgrammableController::LongPress
 

Macros

#define CHECK_BUTTON_DOWN(b)   evt.button_down.b = (!prev.button.b && state.button.b)
 
#define CHECK_BUTTON_UP(b)   evt.button_up.b = (prev.button.b && !state.button.b)
 
#define CHECK_BUTTON_LONGPRESS(b)
 

Macro Definition Documentation

◆ CHECK_BUTTON_DOWN

#define CHECK_BUTTON_DOWN (   b)    evt.button_down.b = (!prev.button.b && state.button.b)

◆ CHECK_BUTTON_LONGPRESS

#define CHECK_BUTTON_LONGPRESS (   b)
Value:
{ \
evt.long_button_up.b = false; \
if (evt.button_down.b) \
{ \
longpress.b.pressTime = millis(); \
longpress.b.longPress = false; \
} \
else if (evt.button_up.b) \
{ \
longpress.b.pressTime = 0; \
if (longpress.b.longPress) \
evt.button_up.b = false; \
longpress.b.longPress = false; \
} \
else if (longpress.b.pressTime != 0 && state.button.b) \
{ \
if (longpress.b.pressTime + SERIAL_CONSOLE_LONG_PRESS_TIME < millis()) \
{ \
longpress.b.pressTime = 0; \
longpress.b.longPress = true; \
evt.long_button_up.b = true; \
} \
} \
}

◆ CHECK_BUTTON_UP

#define CHECK_BUTTON_UP (   b)    evt.button_up.b = (prev.button.b && !state.button.b)
SERIAL_CONSOLE_LONG_PRESS_TIME
#define SERIAL_CONSOLE_LONG_PRESS_TIME
Definition: SerialConsoleController.h:8