Forum Discussion
Altera_Forum
Honored Contributor
14 years ago//========open file to write bitmap=====
name1[4] = h/10 +48; name1[5] = h%10 +48; file_handle1 = alt_up_sd_card_fopen(name1, create); if (file_handle1 == -1) printf("file could not be open.\n"); else if ((file_handle1 == -2)) printf("file be already.\n"); else printf("file be open.\n"); if (create == true) printf("file be create .\n"); //=========write header============= for (j=0; j<54; i++) { alt_up_sd_card_write( file_handle1, BITMAP_HEADER[j]); printf("write header.\n"); } //============write data================= for (y = 0; y < IMG_Y_SIZE1; y += 1) { printf("."); for(x = 0; x < IMG_X_SIZE1; ++x) { for (c = 2; c >= 0; c--) { alt_up_sd_card_write( file_handle1, saved_images[i][c][y][x]); //printf("file be write .\n"); } } } printf("\nDone!\n"); hum = alt_up_sd_card_fclose(file_handle1); if (hum == true) printf("file be close.\n"); if (h <100) h++; return 0; }