Are the following functions work on ESP32 yet?
- time() and clock() functions
- functions which read from standard input: scanf, getc, gets, and so on.
- functions which operate on FILEs, such as fopen, fread, fwrite, fflush, an so on, are not mapped to any filesystem.
filesystem availability
Re: filesystem availability
For the current master branch:
1) yes, time and clock function work (provided you don't disable both FRC1 and RTC timer in menuconfig)
2) yes, although note that these functions currently operate as if the file descriptor has been opened as O_NONBLOCK. So using scanf/fscanf may give unexpected results, as these functions will not block until all input is received (they will just use whatever is there in UART FIFO). One possible way around this is to read up to a newline (or some other delimiter) using `fgetc`, and then pass the string to sscanf for parsing. This limitation will be removed once we add fcntl function to VFS interface.
3) stdio function can work with FAT filesystem on SD card. Some community projects have also ported SPIFFS to the ESP32, which can be plugged into the VFS interface.
1) yes, time and clock function work (provided you don't disable both FRC1 and RTC timer in menuconfig)
2) yes, although note that these functions currently operate as if the file descriptor has been opened as O_NONBLOCK. So using scanf/fscanf may give unexpected results, as these functions will not block until all input is received (they will just use whatever is there in UART FIFO). One possible way around this is to read up to a newline (or some other delimiter) using `fgetc`, and then pass the string to sscanf for parsing. This limitation will be removed once we add fcntl function to VFS interface.
3) stdio function can work with FAT filesystem on SD card. Some community projects have also ported SPIFFS to the ESP32, which can be plugged into the VFS interface.
Who is online
Users browsing this forum: Baidu [Spider] and 126 guests