Beispiel #1
0
/**
*
* This function initializes the controller for the SD FLASH interface.
*
* @param	filename of the file that is to be used
*
* @return
*		- XST_SUCCESS if the controller initializes correctly
*		- XST_FAILURE if the controller fails to initializes correctly
*
* @note		None.
*
****************************************************************************/
u32 InitSD(const char *filename)
{

	FRESULT rc;
	TCHAR *path = "0:/"; /* Logical drive number is 0 */

	/* Register volume work area, initialize device */
	rc = f_mount(&fatfs, path, 0);
	fsbl_printf(DEBUG_INFO,"SD: rc= %.8x\n\r", rc);

	if (rc != FR_OK) {
		return XST_FAILURE;
	}

	strcpy_rom(buffer, filename);
	boot_file = (char *)buffer;
	FlashReadBaseAddress = XPAR_PS7_SD_0_S_AXI_BASEADDR;

	rc = f_open(&fil, boot_file, FA_READ);
	if (rc) {
		fsbl_printf(DEBUG_GENERAL,"SD: Unable to open file %s: %d\n", boot_file, rc);
		return XST_FAILURE;
	}

	return XST_SUCCESS;

}
Beispiel #2
0
void task1(void* params)
{
    uint8* var = (uint8*) params;
    const char text_rom[] = "TechRTOS:";
    const char website_rom[] = "-codeforfun.it-";

    static char* website;
    static char* text;

    text = tech_malloc((strlen_rom(text_rom)+1)*sizeof(char));
    strcpy_rom(text, text_rom);

    website = tech_malloc((strlen_rom(website_rom)+1)*sizeof(char));
    strcpy_rom(website, website_rom);

    for (;; yield()) {
        Lcd_OutText(*var, website);
        Lcd_Out(1, 1, text);
    }
}