SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV64, _SPI_DATA_SAMPLE_MIDDLE,_SPI_CLK_IDLE_LOW, _SPI_LOW_2_HIGH);
while (Mmc_Init());
Lcd_Out(1,1,"reintialized");
Delay_ms(1000);
Delay_ms(1000);
// use fat16 quick format instead of init routine if a formatting is needed
while(1) {
if (!Mmc_Fat_Init()) {
SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV64, _SPI_DATA_SAMPLE_MIDDLE,_SPI_CLK_IDLE_LOW, _SPI_LOW_2_HIGH);
......
......
......
break; // WHEN YOU CREATE FILE, GET OUT OF INFINITE WHILE LOOP
}
}