This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Keep SD card opened

Other Parts Discussed in Thread: TM4C1294NCPDT

Hello, can I keep SD card opened all the time?
I'm using TI-RTOS 2.14.04.31, on a TIVA TM4C1294NCPDT.
I need write to SD every time.

Like this:

//Global

SDSPI_Handle sdspiHandle;

/*Prototipo das funcoes*/
bool abreCartao();

/*
 * Abre o cartao de memoria
 * Retorna um manipulador ou NULL
 */
bool abreCartao() {
	if (sdspiHandle != NULL) {
		return true;
	} else {
#if defined(DEBUG_SD)
		log("Abre cartao", false);
#endif
		SDSPI_Params sdspiParams;
		SDSPI_Params_init(&sdspiParams);
		sdspiHandle = SDSPI_open(Board_SDSPI0, SD_DRIVE_NUM, &sdspiParams);
		if (sdspiHandle == NULL) {
#if defined(DEBUG_SD)
			log("Erro ao iniciar o SD card!", false);
#endif
			return false;
		}
		return true;
	}
}