diff -r b74b0e4902c3 -r ad2c8b13eb88 main/task_sdcard.c --- a/main/task_sdcard.c Sat Oct 20 13:23:15 2018 +0200 +++ b/main/task_sdcard.c Sat Oct 20 17:09:48 2018 +0200 @@ -20,8 +20,8 @@ -SDCARD_State * sdcard_state; -JSON_log * json_log; +SDCARD_State *sdcard_state; ///< SD card status +JSON_log *json_log; ///< JSON log array EventGroupHandle_t xEventGroupSDcard; ///< SD card events. static const char *TAG = "task_sdcard"; @@ -33,10 +33,10 @@ #define SDCARD_HOST_SLOT VSPI_HOST ///< HSPI_HOST is used by the TFT -#define SDCARD_PIN_NUM_MISO 2 -#define SDCARD_PIN_NUM_MOSI 15 -#define SDCARD_PIN_NUM_CLK 14 -#define SDCARD_PIN_NUM_CS 13 +#define SDCARD_PIN_NUM_MISO 2 ///< MISO pin +#define SDCARD_PIN_NUM_MOSI 15 ///< MOSI pin +#define SDCARD_PIN_NUM_CLK 14 ///< CLOCK +#define SDCARD_PIN_NUM_CS 13 ///< Chip select pin #define SDCARD_DMA_CHANNEL 2 ///< Channel 1 is used by the TFT @@ -191,10 +191,14 @@ -/* - * This is a local modified version of the esp_vfs_fat_sdmmc_mount() function in - * the FreeRTOS components library. It is here so we can better handle errors - * for our application. +/** + * @brief This is a local modified version of the esp_vfs_fat_sdmmc_mount() function in + * the FreeRTOS components library. It is here so we can better handle errors + * for our application. + * @param base_path The mount path + * @param host_config SPI host configuration + * @param slot_config Slot configuration + * @return Error condition. */ esp_err_t my_vfs_fat_sdmmc_init(const char* base_path, const sdmmc_host_t* host_config, const void* slot_config) { @@ -248,6 +252,15 @@ +/** + * @brief Mount SD card. + * @param base_path The mountpoint + * @param host_config SPI host configuration + * @param slot_config Slot configuration + * @param mount_config Mount configuration + * @param[out] out_card Card information + * @return Error condition + */ esp_err_t my_esp_vfs_fat_sdmmc_mount(const char* base_path, const sdmmc_host_t* host_config, const void* slot_config, @@ -307,7 +320,11 @@ -esp_err_t my_esp_vfs_fat_sdmmc_unmount() +/** + * @brief Unmount a mounted SD card, + * @return Error condition + */ +esp_err_t my_esp_vfs_fat_sdmmc_unmount(void) { if (s_card == NULL) { return ESP_ERR_INVALID_STATE; @@ -351,6 +368,11 @@ +/** + * @brief Sync directories. + * @param fromdir Source directory + * @param todir Destination directory + */ void SyncDirs(char *fromdir, char *todir) { char ff[64], tf[64];