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.
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.
Changed to MESSAGEID_POWERSAVINGMODE
There was a problem hiding this comment.
cool! let's do the same for -1
There was a problem hiding this comment.
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.
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.
Hmhm, I already changed the -1 to MESSAGEID_POWERSAVINGMODE.
Or do you mean something different?
DocMoebiuz
left a comment
There was a problem hiding this comment.
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 =
-2and Message ="1"If the PowerSavingMode should be leaved, a message is sent to the custom device with MessageID =
-2and 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