Skip to content

Commit

Permalink
AP_Scripting: Add filesystem format
Browse files Browse the repository at this point in the history
Added the ability to format the SD card from LUA
  • Loading branch information
haydendonald authored and tridge committed Feb 7, 2024
1 parent 9919af6 commit 85a8b6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libraries/AP_Scripting/docs/docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,6 @@ compass = {}
---@return boolean
function compass:healthy(instance) end


-- desc
---@class camera
camera = {}
Expand Down Expand Up @@ -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 = {}
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_Scripting/generator/description/bindings.desc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85a8b6c

Please sign in to comment.