forked from betaflight/betaflight-tx-lua-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OSD warnings to telemetry pages with voice messages
Related to betaflight#345 Add OSD warnings/messages integration into telemetry pages with voice messages for DJI FPV System users. * Modify `src/SCRIPTS/BF/background.lua` to handle OSD warnings/messages by adding a new function `handleOsdWarnings` and calling it in `run_bg`. * Add support for sending OSD warnings/messages via telemetry in `src/SCRIPTS/BF/MSP/crsf.lua`, `src/SCRIPTS/BF/MSP/ghst.lua`, and `src/SCRIPTS/BF/MSP/sp.lua`. * Add logic to trigger voice messages based on OSD warnings/messages in `src/SCRIPTS/BF/MSP/messages.lua`. * Create a new Lua script `src/SCRIPTS/BF/osd_warnings.lua` to handle OSD warnings and convert them into telemetry data. * Update telemetry page scripts in `src/SCRIPTS/BF/PAGES/failsafe.lua` and `src/SCRIPTS/BF/PAGES/pos_osd.lua` to display OSD warnings.
- Loading branch information
1 parent
1a90024
commit fd6ef01
Showing
8 changed files
with
105 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
local osdWarnings = {} | ||
|
||
osdWarnings.warnings = { | ||
{ id = 1, message = "Arming status flag" }, | ||
{ id = 2, message = "Sanity check" }, | ||
{ id = 3, message = "GPS Rescue status" }, | ||
{ id = 4, message = "Battery voltage warning" }, | ||
{ id = 5, message = "RSSI warning" }, | ||
{ id = 6, message = "Failsafe warning" }, | ||
} | ||
|
||
function osdWarnings.process() | ||
for _, warning in ipairs(osdWarnings.warnings) do | ||
playFile(warning.message) | ||
end | ||
end | ||
|
||
return osdWarnings |