-
- Notifications
You must be signed in to change notification settings - Fork 155
Pit mode switch #17
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
Pit mode switch #17
Conversation
@punkkills Hi! Ronan. |
Usage: - Apply pm_amr and pm_d-arm as custom functions (bind them to a swich or logical variable) - The VTX telemetry screen must be open - If the quad is in pit mode, activate pm_arm . You must have previously activated pm_d-arm to prevent disabling pit mode by accident (such as leaving the stick in the armed position) - The VTX screen will be saved with pit mode disabled Fixing arm and disarm scripts Added support for background processing Background processing allows the pit mode switch to be used even when the telemetry page is not open Updated x7 and horus with background scripts Don't wait for timeout when changing vtx channels Before this change, the 3 second timeout would be hit before vtx changes were read
cb28ee2
to 860ba29
Compare @punkkills Thx a lot! That opens quite some use-cases! However, as I wrote you, I see that more as a work-around for now, as BF is going to have support for switches for these kind of changes rather soon. So I'd prefer leave this one as a PR for now. Please tell me your thoughts. |
@raphaelcoeffic: I think support for switches might be some way out yet, since there is some work needed on the code that handles switches, because we're just about to max out on the number of switches that the current code can handle. |
@raphaelcoeffic I'll leave it up to you. As @mikeller mentioned, I was interested in the prospect of not needing another channel in BF (depending on if it was implemented as a mode or an adjustment). In my opinion (biased :D) it adds a lot of value right now and maybe into the future if the BF feature is a ways off. If you aren't interested in pulling it, I would probably put it out there for people to use but wouldn't be excited about diverging from what you have put together. |
@mikeller so what you're saying is that it will take longer that I think, and at the end, it might not be as useful as I think it could? |
@raphaelcoeffic At the moment there is only space for one more switch in the 32 bit set that is used for switches, so adding the pit mode switch will be possible quickly, but that's it. As to usefulness, I think seen on its own it will be very useful, but since the number of switches that can be reasonably used is limited by the number of RX channels, using it through MSP is going to be more useful for users that do not have any more unused RX channels available. |
@punkkills just a quick question: are you using a SmartAudio VTX? I'm just wondering because there is no way to power up the Tramp in pit-mode for now. If this is the case, do you set your TBS unify into race-mode by pressing the button while powering up? (at least the first time) |
Yes, I'm using a Unify Race. I didn't realize the tramp couldn't be powered up in pit mode. On the Unify, you put it into pit mode by pressing the button on power up like you say. When you disable pit mode with the switch, it is temporary and will boot in pit mode on next power cycle. You have to power up with the button again to make it transmit on startup. |
Creating enumerations and intuitive naming conventions to self-document the code
This repository has been rebased on the more advanced https://github.com/codecae/betaflight-tx-lua-revised. Please update your pull request if it is still relevant, or close it otherwise. |
Hey, first off, forgive me if I am not doing this correctly. While I'm a software engineer, I don't have any experience with git or it's workflow :D.
This code lets you disable pit mode with a switch through telemetry. It has some safety features built in. It also does not require that the telemetry screen is visible.
You need to assign the pm_arm and pm_d-arm functions to different positions of a switch. In order for pit mode to be deactivated, (armed) the function pm_d-arm first has to run, followed by pm_arm. This allows some safety such that you can't just power up your quad with the video arming switch enabled and start transmitting, you must first first hit the disarmed state.
Next, I added a background task and refactored the telemetry communication stuff to that so the switch can be used with the telemetry screen closed.