Skip to content
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

Add missing retrigger for analog inputs at startup #199

Merged
merged 6 commits into from
Oct 3, 2022

Conversation

GioCC
Copy link
Contributor

@GioCC GioCC commented Oct 2, 2022

Description of changes

Included Analog input polling in the retrigger command.
An initial scan has been added to setup() to fill the value buffer for analog inputs before it is used

Fixes #202
Fixes #898 (MobiFlight/MobiFlight-Connector#898)

@GioCC GioCC requested a review from DocMoebiuz as a code owner October 2, 2022 08:38
@github-actions
Copy link

github-actions bot commented Oct 2, 2022

Firmware for this pull request:
Firmware.zip

@elral
Copy link
Collaborator

elral commented Oct 2, 2022

I think initialisation of the average buffer should be part of the constructor MFAnalog::MFAnalog so that separate function is not required.
For my understanding all steps to get a class working should be part of the constructor if possible, if not it should be part of a init() function. As we have only the constructor and nothing else is required to get it working (e.g. SPI, serial, ...)
I think it is the correct place to do it. And no changes would be required in the main part (mobiflight.cpp) to get the device working.

@GioCC
Copy link
Contributor Author

GioCC commented Oct 2, 2022

@elral you're absolutely right, thanks for noticing! I changed it the way you suggest,

@github-actions
Copy link

github-actions bot commented Oct 2, 2022

Firmware for this pull request:
Firmware.zip

@elral
Copy link
Collaborator

elral commented Oct 3, 2022

@GioCC looks perfect now!

Copy link
Collaborator

@DocMoebiuz DocMoebiuz left a comment

Choose a reason for hiding this comment

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

please see my comment.

Compare expression promoted to own function
Compare expression promoted to own function
@github-actions
Copy link

github-actions bot commented Oct 3, 2022

Firmware for this pull request:
Firmware.zip

@GioCC GioCC requested a review from DocMoebiuz October 3, 2022 08:24
Copy link
Collaborator

@DocMoebiuz DocMoebiuz left a comment

Choose a reason for hiding this comment

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

Thanks @GioCC

@DocMoebiuz DocMoebiuz merged commit 40b5694 into MobiFlight:main Oct 3, 2022
@GioCC GioCC deleted the Analog_retrigger_fix branch October 3, 2022 16:19
@DocMoebiuz DocMoebiuz changed the title (#898)(Connector) Fix missing retrigger for ANALOG inputs at startup Add missing retrigger for ANALOG inputs at startup Oct 8, 2022
@DocMoebiuz DocMoebiuz changed the title Add missing retrigger for ANALOG inputs at startup Add missing retrigger for analog inputs at startup Oct 8, 2022
@DocMoebiuz DocMoebiuz added the bug Something isn't working label Oct 8, 2022
@GioCC GioCC restored the Analog_retrigger_fix branch October 12, 2022 13:46
GioCC added a commit to GioCC/MobiFlight-FirmwareSource that referenced this pull request Oct 12, 2022
@GioCC GioCC deleted the Analog_retrigger_fix branch October 15, 2022 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Retrigger function does not initialize current value of analog potentiometers
3 participants