-
Notifications
You must be signed in to change notification settings - Fork 66
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
Power saving mode #306
Power saving mode #306
Conversation
Firmware for this pull request: |
Firmware for this pull request: |
Firmware for this pull request: |
src/MF_CustomDevice/CustomDevice.cpp
Outdated
for (uint8_t i = 0; i < customDeviceRegistered; ++i) { | ||
if (state) | ||
customDevice[i].set(-2, "1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to have const defines or variables with readable labels for the built-in message ids -1
and -2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to MESSAGEID_POWERSAVINGMODE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool! let's do the same for -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmhm, there is no -1
(Stop of connector)
This message is coming from the connector and directly passed to the custom device.
I see no need to do it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought it would make it more obvious that it's an internal event. Ideally stop would also come from the firmware as we discussed recently. Stop as message on Board level. On the other hand it's also good to have some flexibility on the App side
Since this is a special event I would still give it a speaking name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmhm, I already changed the -1
to MESSAGEID_POWERSAVINGMODE
.
Or do you mean something different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my review comment
Firmware for this pull request: |
Firmware for this pull request: |
Firmware for this pull request: |
Description of changes
Adding a function to enable custom devices to enter or leave power saving mode.
If the PowerSavingMode should be entered, a message is sent to the custom device with MessageID =
-2
and Message ="1"
If the PowerSavingMode should be leaved, a message is sent to the custom device with MessageID =
-2
and Message ="0"
Changes in all custom devices are required to differ between entering and leaving.
This will be done in a separate PR within the CustomDevice Repo.
Fixes #299