AP_Scripting: Add filesystem format

Added the ability to format the SD card from LUA
This commit is contained in:
Hayden Donald 2024-02-07 14:30:44 +11:00 committed by Andrew Tridgell
parent 9919af69bc
commit 85a8b6c414
2 changed files with 10 additions and 1 deletions

View File

@ -1221,7 +1221,6 @@ compass = {}
---@return boolean
function compass:healthy(instance) end
-- desc
---@class camera
camera = {}
@ -3372,6 +3371,14 @@ fs = {}
---@return stat_t_ud|nil
function fs:stat(param1) end
-- Format the SD card. This is a async operation, use get_format_status to get the status of the format
---@return boolean
function fs:format() end
-- Get the current status of a format. 0=NOT_STARTED, 1=PENDING, 2=IN_PROGRESS, 3=SUCCESS, 4=FAILURE
---@return number
function fs:get_format_status() end
-- desc
---@class networking
networking = {}

View File

@ -881,6 +881,8 @@ userdata AP_Filesystem::stat_t method is_directory boolean
singleton AP_Filesystem rename fs
singleton AP_Filesystem method stat boolean string AP_Filesystem::stat_t'Null
singleton AP_Filesystem method format boolean
singleton AP_Filesystem method get_format_status uint8_t'skip_check
include AP_RTC/AP_RTC.h depends AP_RTC_ENABLED
include AP_RTC/AP_RTC_config.h