Skip to content

Commit

Permalink
new handler ID's for inputs to differ from old way
Browse files Browse the repository at this point in the history
  • Loading branch information
elral committed Dec 12, 2022
1 parent 9895bd1 commit fab649d
Showing 1 changed file with 48 additions and 35 deletions.
83 changes: 48 additions & 35 deletions src/commandmessenger.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,55 @@
// In order to receive, attach a callback function to these events

enum {
kInitModule, // 0
kSetModule, // 1
kSetPin, // 2
kSetStepper, // 3
kSetServo, // 4
kStatus, // 5, Command to report status
kEncoderChange, // 6
kButtonChange, // 7
kStepperChange, // 8
kGetInfo, // 9
kInfo, // 10
kSetConfig, // 11
kGetConfig, // 12
kResetConfig, // 13
kSaveConfig, // 14
kConfigSaved, // 15
kActivateConfig, // 16
kConfigActivated, // 17
kSetPowerSavingMode, // 18
kSetName, // 19
kGenNewSerial, // 20
kResetStepper, // 21
kSetZeroStepper, // 22
kTrigger, // 23
kResetBoard, // 24
kSetLcdDisplayI2C, // 25
kSetModuleBrightness, // 26
kSetShiftRegisterPins, // 27
kAnalogChange, // 28
kInputShifterChange, // 29
kDigInMuxChange, // 30
kDebug = 0xFF // 255
kInitModule, // 0
kSetModule, // 1
kSetPin, // 2
kSetStepper, // 3
kSetServo, // 4
kStatus, // 5, Command to report status
kEncoderChangeDeprecated, // 6
kButtonChangeDeprecated, // 7
kStepperChange, // 8
kGetInfo, // 9
kInfo, // 10
kSetConfig, // 11
kGetConfig, // 12
kResetConfig, // 13
kSaveConfig, // 14
kConfigSaved, // 15
kActivateConfig, // 16
kConfigActivated, // 17
kSetPowerSavingMode, // 18
kSetName, // 19
kGenNewSerial, // 20
kResetStepper, // 21
kSetZeroStepper, // 22
kTrigger, // 23
kResetBoard, // 24
kSetLcdDisplayI2C, // 25
kSetModuleBrightness, // 26
kSetShiftRegisterPins, // 27
kAnalogChangeDeprecated, // 28
kInputShifterChangeDeprecated, // 29
kDigInMuxChangeDeprecated, // 30

// functions which get be called from the UI via the command messenger
// must be added before. The command messenger has a fix buffer size
// for the functions which defined by MAXCALLBACKS=30.
// -------------------------------------------------------------------
// new handler ID's for input devices must be added here
// This will save size of the Callback buffer
kButtonChange = 100, // 100
kEncoderChange, // 101
kAnalogChange, // 102
kInputShifterChange, // 103
kInputShifterChange, // 104
kDigInMuxChange, // 105
kDebug = 0xFF // 255
};

void attachCommandCallbacks();
uint32_t getLastCommandMillis();
void setLastCommandMillis();
void attachCommandCallbacks();
uint32_t getLastCommandMillis();
void setLastCommandMillis();

extern CmdMessenger cmdMessenger;

2 comments on commit fab649d

@GioCC
Copy link
Contributor

@GioCC GioCC commented on fab649d Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch out, kInputShifterChange is repeated twice!
Do I get it correctly,
<100 are Connector->FW,
>=100 are FW->Connector?

@elral
Copy link
Collaborator Author

@elral elral commented on fab649d Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch out, kInputShifterChange is repeated twice!

Uuups, thank's for your comment!

Do I get it correctly,
<100 are Connector->FW,
=100 are FW->Connector?

Yes, that's correct.

Please sign in to comment.