meshtastic / firmware

Meshtastic device firmware
https://meshtastic.org
GNU General Public License v3.0
3.58k stars 891 forks source link

Get accelerometerThread running from AdminModule. #4886

Closed gjelsoe closed 1 month ago

gjelsoe commented 1 month ago

The accelerometerThread fails to start do to new values in c.payload_variant.device.double_tap_as_button_press or c.payload_variant.display.wake_on_tap_or_motion are not stored in config.device.double_tap_as_button_press or config.display.wake_on_tap_or_motion before accelerometerThread->start() is called, it will compare to old values. AccelerometerThread is also disabled with disabled() so it needs to be enabled again before accelerometerThread->start().

Download firmware-2.5.4.fa79bf1.zip. This artifact will be available for 90 days from creation

in `c.payload_variant.device.double_tap_as_button_press` or `c.payload_variant.display.wake_on_tap_or_motion` are not stored in `config.device.double_tap_as_button_press` or `config.display.wake_on_tap_or_motion` before `accelerometerThread->start()` is called, it will compare to old values. AccelerometerThread is also disabled with `disabled()` so it needs to be enabled again before `accelerometerThread->start()`.

Download firmware-2.5.4.1a0e7ab.zip. This artifact will be available for 90 days from creation

in `c.payload_variant.device.double_tap_as_button_press` or `c.payload_variant.display.wake_on_tap_or_motion` are not stored in `config.device.double_tap_as_button_press` or `config.display.wake_on_tap_or_motion` before `accelerometerThread->start()` is called, it will compare to old values. AccelerometerThread is also disabled with `disabled()` so it needs to be enabled again before `accelerometerThread->start()`.

Download firmware-2.5.4.fa79bf1.zip. This artifact will be available for 90 days from creation

in `c.payload_variant.device.double_tap_as_button_press` or `c.payload_variant.display.wake_on_tap_or_motion` are not stored in `config.device.double_tap_as_button_press` or `config.display.wake_on_tap_or_motion` before `accelerometerThread->start()` is called, it will compare to old values. AccelerometerThread is also disabled with `disabled()` so it needs to be enabled again before `accelerometerThread->start()`.
caveman99 commented 1 month ago

you could also call setIntervalFromNow(0) to start it again. disable just sets the next execution to MAX_UINT

gjelsoe commented 1 month ago

you could also call setIntervalFromNow(0) to start it again. disable just sets the next execution to MAX_UINT

So accelerometerThread->setIntervalFromNow(0) would have done the same as accelerometerThread->enabled = true ?

caveman99 commented 1 month ago

you could also call setIntervalFromNow(0) to start it again. disable just sets the next execution to MAX_UINT

So accelerometerThread->setIntervalFromNow(0) would have done the same as accelerometerThread->enabled = true ?

Err, nope - the enabled is still neccessary, but the start is not :-) It was more like a remark´than a change request.

gjelsoe commented 1 month ago

you could also call setIntervalFromNow(0) to start it again. disable just sets the next execution to MAX_UINT

So accelerometerThread->setIntervalFromNow(0) would have done the same as accelerometerThread->enabled = true ?

Err, nope - the enabled is still neccessary, but the start is not :-) It was more like a remark´than a change request.

Don't mind removing it if it's not necessarily.

gjelsoe commented 1 month ago

you could also call setIntervalFromNow(0) to start it again. disable just sets the next execution to MAX_UINT

So accelerometerThread->setIntervalFromNow(0) would have done the same as accelerometerThread->enabled = true ?

Err, nope - the enabled is still neccessary, but the start is not :-) It was more like a remark´than a change request.

I've just tested it without accelerometerThread->start() and it doesn't work on the Bandit without. I2Cs doesn't get initialized.