#include "storage.h" #include "app_state.h" /* fgoto */ #include "File_Handling.h" /* Mount_SD, Update_File_byte, Seek_Read_File, Remove_File, Create_File, FR_OK */ /* --- SD_SAVE / SD_READ / SD_REMOVE из main.c (дословно) --- */ int SD_SAVE(uint16_t *pbuff) { int test=0; if (HAL_GPIO_ReadPin(SDMMC1_EN_GPIO_Port, SDMMC1_EN_Pin)==GPIO_PIN_RESET) { test = Mount_SD("/"); if (test == 0) //0 - suc { //Format_SD(); test = Update_File_byte("FILE1.TXT", (uint8_t *)pbuff, DL_8); test = Unmount_SD("/"); // 0 - succ return test; } else { return 1; } } else { return 1; } } //uint32_t Get_Length(void) //{ // return SD_matr[0][0] + ((uint32_t) (SD_matr[0][1])<<16); //} int SD_READ(uint16_t *pbuff) { int test=0; if (HAL_GPIO_ReadPin(SDMMC1_EN_GPIO_Port, SDMMC1_EN_Pin)==GPIO_PIN_RESET) { test = Mount_SD("/"); if (test == 0) //0 - suc { //Format_SD(); test = Seek_Read_File ("FILE1.TXT", (uint8_t *)pbuff, DL_8, fgoto);//Read next 246 bytes fgoto+=DL_8; test = Unmount_SD("/"); // 0 - succ return test; } else { return 1; } } else { return 1; } /* for (uint16_t j = 0; j < DL_16; j++) { *(pbuff+j) = SD_matr[SD_SLIDE][j]; } if (SD_SLIDE