Commit Graph

134 Commits

Author SHA1 Message Date
Thomas Watson 380d8ca6fc AP_Filesystem: remove dependency on tmpnam
tmpnam is never linked and not necessary, and naming it/redefining it
introduces problems on platforms that do have a definition.
2024-09-24 22:49:18 +10:00
Peter Barker a8cc071d62 AP_Filesystem: rearrange to put mission filesystem last
We're developing loops in our config files, move include to after base FILESYSTEM_READING/FILESYSTEM_WRITING defines
2024-09-24 11:59:13 +10:00
ARg 8204ff4d7c AP_Filesystem: fix esp32 function datatypes
Make them match the superclass and the header file.
2024-09-24 09:00:29 +10:00
muramura e86d5e113f AP_Filesystem: BOOL for binary types 2024-07-26 20:12:05 +10:00
Andrew Tridgell f8ce4183b8 AP_Filesystem: support QURT with posix filesystem
some features disabled
2024-07-12 15:56:48 +10:00
Andrew Tridgell 75ebf96adb AP_Filesystem: allow for filesystem with no dtype 2024-07-11 09:25:05 +10:00
Andrew Tridgell c2e52af1e2 AP_Filesystem: make fgets() much more efficient
normally fgets is on a buffered FILE handle. For AP_Filesystem we use
an unbuffered file descriptor. This means we were reading one byte at
a time from the file

this uses lseek to make fgets() much more efficient by reading the max
buffer size at a time in the file
2024-07-11 09:24:38 +10:00
Andrew Tridgell a241b13f45 AP_Filesystem: use NEW_NOTHROW for new(std::nothrow) 2024-06-04 09:20:21 +10:00
Thomas Watson 0ca37387be AP_Filesystem: guarantee load_file() data is null-terminated
Improves safety of use and clarity of users. Termination is not
included in the reported size to avoid changing user behavior or
misrepresenting the file contents.
2024-05-04 10:15:44 +10:00
Andrew Tridgell 8763084a9e AP_Filesystem: avoid decompressing in directory listing
this makes ROMFS much more efficient
2024-03-19 19:49:47 +11:00
Iampete1 8d7052887c AP_Filesystem: fixup AP_FILESYSTEM_FILE_WRITING_ENABLED comment 2024-03-12 08:52:38 +11:00
Peter Barker 2cb5f434fd AP_Filesystem: don't show directory entries for empty @ filesystems 2024-02-28 18:47:22 +11:00
Peter Barker ac769014c4 AP_Filesystem: list virtual @SYS, @MISSION etc directories in /
Adds virtual directory entries for these virtual filesystems in /

RTL> ftp list
RTL> Listing /
 D @MISSION
 D @PARAM
 D @ROMFS
 D @SYS
 D APM
 D log
   V5_BT.dfu	10541
   bootlog.txt	297
   dataman	350216
   message-intervals-chan0.txt	7
Total size 352.60 kByte
ftp list @MISSION
RTL> Listing @MISSION
LIST: OP seq:7 sess:2 opcode:129 req_opcode:3 size:2 bc:0 ofs:0 plen=2 [2]
ftp list @ROMFS
RTL> Listing @ROMFS
   bootloader.bin	16448
   hwdef.dat	5743
   io_firmware.bin	40880
Total size 61.59 kByte

This PR also makes us *much* more lenient in what we accept for looking at virtual filesystems, so

ftp list @SYS
ftp list /@SYS
ftp list @SYS/
ftp list /@SYS/

should all work
2024-02-27 10:07:01 +11:00
Andy Piper 61dbc7a665 AP_Filesystem: remove unused variables 2024-02-22 14:40:55 +11:00
Iampete1 93d8de2834 AP_Filesystem: support full direcotry listing in ROMFS 2024-02-22 07:43:16 +11:00
Andrew Tridgell 3cb3e6feda AP_Filesystem: use gmtime_r() instead of gmtime()
using gmtime_r makes gmtime thread safe
2024-02-21 12:09:48 +11:00
Iampete1 c48759f4ba AP_Filesystem: crc32: Ensure checksum value is initialized 2024-02-15 07:36:39 +11:00
Peter Barker 3ef2139f4b AP_FileSystem: permit upload of fence/rally via ftp 2024-01-24 19:14:41 +11:00
Andrew Tridgell c5f295e852 AP_Filesystem: allow for large file IOs
this allows for larger IOs on FATFS if the memoory is OK for DMA
2024-01-05 06:52:11 -08:00
Andrew Tridgell 867e9c6799 AP_RTC: fixed build on arm 2023-12-11 18:00:38 +11:00
Andrew Tridgell 9beea49c3c AP_Filesystem: implement stat() call for lua 2023-12-11 18:00:38 +11:00
Andrew Tridgell c9c38300bd AP_Filesystem: expose APFS_FILE structure
allows scripting to set the fd for sendfile()
2023-12-11 18:00:38 +11:00
Andrew Tridgell 11ea2cf5c1 AP_Filesystem: added option @SYS/flash.bin
useful for speed tests
2023-12-11 18:00:38 +11:00
Andrew Tridgell 0f0aed66b7 AP_Filesystem: fixed fseek and open of directories 2023-12-11 18:00:38 +11:00
Iampete1 2c7e06dc5e AP_Filesystem: add crc 32 method 2023-12-05 11:03:58 +11:00
Mykhailo Kuznietsov 804d4446d1 AP_Filesystem: Fix some typos
Fixed some typos found in the code.
2023-10-12 18:30:42 +11:00
Peter Barker ac2fea9766 AP_Filesystem: move AP_RTC::mktime to be ap_mktime
in preparation for AP_RTC_ENABLED
2023-06-27 11:25:11 +10:00
Peter Barker 6faa77993a AP_Filesystem: correct include problem
transitive include may fail depending on build options
2023-06-18 10:35:27 +10:00
Peter Barker 294b975335 AP_Filesystem: correct detection of feature AP_FILESYSTEM_FORMAT_ENABLED 2023-06-08 08:55:26 +10:00
Andrew Tridgell 2703928fb2 AP_Filesystem: enable filesystem format on all boards
this works in ChibiOS 21.xx
2023-06-06 15:19:00 +10:00
Andrew Tridgell 4946ce5431 HAL_ChibiOS: revert recent USB changes
these are causing some boards to crash on startup. Tested with a
QiotekZealotH743 which doesn't get out of setup_usb_strings()

once we have debugged this we can re-add the functionality
2023-06-03 16:50:30 +10:00
bugobliterator 414606ba31 AP_Filesystem: add support for blocking filesystem access 2023-05-31 18:40:17 +10:00
Peter Barker a5c248d7a4 AP_Filesystem: enable posix compat functions if romfs compiled in
vast numbers of these otherwise:

/home/pbarker/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: lib/libArduCopter_libs.a(liolib.c.0.o): in function `read_all':
liolib.c:(.text.read_all+0x20): undefined reference to `apfs_fread'
/home/pbarker/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: lib/libArduCopter_libs.a(liolib.c.0.o): in function `read_line':
liolib.c:(.text.read_line+0x24): undefined reference to `apfs_getc'
/home/pbarker/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: lib/libArduCopter_libs.a(liolib.c.0.o): in function `io_fclose':
liolib.c:(.text.io_fclose+0xe): undefined reference to `apfs_fclose'
/home/pbarker/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: lib/libArduCopter_libs.a(liolib.c.0.o): in function `io_open':
2023-05-25 07:33:26 +10:00
Peter Barker 1c54d18672 AP_Filesystem: replace HAVE_FILESYSTEM_SUPPORT with backend defines 2023-05-17 09:40:39 +10:00
Peter Barker 26dd210be6 AP_Filesystem: remove unused header 2023-05-15 10:17:47 +10:00
Andrew Tridgell cf79843661 AP_Filesystem: support file rename 2023-03-05 09:42:48 +11:00
Peter Barker bee1f2785a AP_Filesystem: rename HAL_SCHEDULER_ENABLED to AP_SCHEDULER_ENABLED
there's AP_HAL::Scheduler which confuses this
2023-02-28 11:26:04 +11:00
Peter Barker d633bd3f49 AP_Filesystem: add in-progress to formatsdcard process 2023-02-21 17:07:41 +11:00
Andrew Tridgell 0b7353bb89 AP_Filesystem: detect inconsistent parameter count
on incorrect param count invalidate it so a 2nd param ftp will get the
right count
2023-01-04 21:50:24 +11:00
Wiktor Maslowski 02b2b9b807 AP_Filesystem: fixed builds for ESP32 2022-11-28 12:23:07 +11:00
Andrew Tridgell 5fc018fff4 AP_Filesystem: fixed open to return nullptr on failure
this impacts lua io.open()
2022-11-10 10:31:29 +11:00
Peter Barker b1897cd9a4 AP_Filesystem: correct compilation with rally disabled 2022-09-27 10:16:47 +10:00
Peter Barker 22d8d0a0fd AP_FileSystem: correct compilation when fence disabled 2022-09-27 10:16:47 +10:00
Friedrich Beckmann 744a741b99 AP_Filesystem: Better estimation of filesize for parameter file
The actual filesize of the parameter downloadfile is around
15200 bytes. The indicated filesize is used in QGC for the
progressbar. This patch does not try to compute the exact filesize
but I try a better estimate. Only the full download off all
parameters is considered to avoid more complexity.
2022-09-27 09:38:25 +10:00
Peter Barker c6989ed710 AP_Filesystem: fold AP_Filesystem_Available.h into AP_Filesystem_config.h 2022-09-15 10:53:02 +10:00
Peter Barker b5165b6d7f AP_FileSystem: add AP_FILESYSTEM_*_ENABLED 2022-09-15 10:53:02 +10:00
Peter Barker 936fef11e2 AP_Filesystem: rename HAL_MISSION_ENABLED to AP_MISSION_ENABLED 2022-08-18 22:49:10 +10:00
Peter Barker 680d158f59 AP_Filesystem: do not gate AP_CRASHDUMP_ENABLED on bootloader
Also rename from HAL_CRASHDUMP_ENABLE

Removes code based on define rather than creating empty functions.  Makes it clearer what's going on in the callers.
2022-08-17 17:34:00 +10:00
Iampete1 19ccf53fa6 AP_Filesystem: change AC_FENCE to AP_FENCE_ENABLED 2022-07-27 19:04:56 +10:00
Iampete1 cababad66b AP_Filesystem: fix complation without fence 2022-07-27 19:04:56 +10:00