##// END OF EJS Templates
Removed error on fat32 library, seems now to be able navigate among sectors in...
Removed error on fat32 library, seems now to be able navigate among sectors in both directions. Improved SDLCD drawing performances by almost 1000x.

File last commit:

r68:104125d87b89 dev_alexis
r68:104125d87b89 dev_alexis
Show More
main.c
138 lines | 3.2 KiB | text/x-c | CLexer
Added Simulator target to run code on x86 and debug functions....
r63 #include <stdio.h>
#include <fat32.h>
#include <gpio.h>
#include <uart.h>
#include <bsp.h>
#include <core.h>
#include <bsp.h>
#include <spi.h>
#include <fat32.h>
#include <ucdirent.h>
#include <string.h>
#include <unistd.h>
#include <terminal.h>
#include <stdarg.h>
#include <malloc.h>
extern streamdevice* __opnfiles__[];
extern void test_Block_Move(LCD_t* LCD,int x,int y,int w,int h,int color);
Removed error on fat32 library, seems now to be able navigate among sectors in...
r68 extern void test_address(LCD_t* LCD);
extern void printRootClustersChain(FAT32fs* sdcard2FAT32part);
Added Simulator target to run code on x86 and debug functions....
r63 char buffer[512];
Jeandet Alexis
Some bug fixed on ILI9328 driver, 16 bit mode working well, 8 bit mode still...
r66
Removed error on fat32 library, seems now to be able navigate among sectors in...
r68 //void streamdevicePrint(streamdevice* dev, const char* format,...)
Jeandet Alexis
Some bug fixed on ILI9328 driver, 16 bit mode working well, 8 bit mode still...
r66 //{
Removed error on fat32 library, seems now to be able navigate among sectors in...
r68 // char str_buffer[512]="";
Jeandet Alexis
Some bug fixed on ILI9328 driver, 16 bit mode working well, 8 bit mode still...
r66 // int i;
// va_list ap;
// va_start(ap,format);
// vasprintf(str_buffer,format,ap);
// va_end(ap);
Removed error on fat32 library, seems now to be able navigate among sectors in...
r68 // i=strlen(str_buffer);
// dev->ops->write(dev,(void*)str_buffer,1,i);
//}
int _write(int file, char *ptr, int len)
{
if(file<__MAX_OPENED_FILES__ && __opnfiles__[file]!=NULL)
{
if(__opnfiles__[file]->ops->write(__opnfiles__[file],ptr,1,len)) return len;
}
return len;
}
Jeandet Alexis
Some bug fixed on ILI9328 driver, 16 bit mode working well, 8 bit mode still...
r66
Removed error on fat32 library, seems now to be able navigate among sectors in...
r68 int _write_r (struct _reent *r, int file, char * ptr, int len)
{
return _write(file, ptr, len);
}
//int printf(const char *format,...)
//{
// char str_buffer[512]="";
// for(int i =0;i<512;i++)str_buffer[i]='\0';
// int i;
// va_list ap;
// va_start(ap,format);
// vasprintf(str_buffer,format,ap);
// va_end(ap);
// i=strlen(str_buffer);
// __opnfiles__[1]->ops->write(__opnfiles__[1],(void*)str_buffer,1,i);
Jeandet Alexis
Some bug fixed on ILI9328 driver, 16 bit mode working well, 8 bit mode still...
r66 //}
Added Simulator target to run code on x86 and debug functions....
r63 void lcd_print()
{
lcd0.paintFilRect(&lcd0,10,10,100,100,0,0,0x0F0F);
// __opnfiles__[1]->ops->write(__opnfiles__[1],(void*)"hello",1,5);
}
Removed error on fat32 library, seems now to be able navigate among sectors in...
r68
void playFile(ucdirent* file,FAT32fs* part)
{
extern volatile vs10XXDev audioCodec0;
char direntName[]=" \n";
uint32_t fileLba,nextLba;
int i=0;
fat32getdirentname(file,direntName);
//gpioset(LCD_BACKL);
printf("%s\n",direntName);
nextLba=fat32getdirentlba(file);
//printf("Streaming File\n");
//gpioclr(LCD_BACKL);
}
void listFiles()
{
extern FAT32fs sdcard2FAT32part1,sdcard2FAT32part2,sdcard2FAT32part3,sdcard2FAT32part4;
ucdirent root;
if(DIRENT_noErr==fat32mkdirent(&sdcard2FAT32part1,&root))
{
printf("Reading on SDCARD2 part1\n");
if(DIRENT_noErr==fat32getrootfirstent(&root))
{
do{
playFile(&root,&sdcard2FAT32part1);
}while (DIRENT_noErr==fat32nextdirent(&root));
}
}
gpioset(LED2);
if(DIRENT_noErr==fat32mkdirent(&sdcard2FAT32part2,&root))
{
printf("Reading on SDCARD2 part2\n");
if(DIRENT_noErr==fat32getrootfirstent(&root))
{
do{
playFile(&root,&sdcard2FAT32part2);
}while (DIRENT_noErr==fat32nextdirent(&root));
}
}
}
int libuc_main2()
{
printRootClustersChain(&sdcard2FAT32part1);
}
More buid system cleaning....
r65 int libuc_main()
Added Simulator target to run code on x86 and debug functions....
r63 {
char in[255];
Removed error on fat32 library, seems now to be able navigate among sectors in...
r68 //lcd_print();
Added Simulator target to run code on x86 and debug functions....
r63 printf("hello world\n");
Removed error on fat32 library, seems now to be able navigate among sectors in...
r68 delay_100us(10000);
// streamdevicePrint(__opnfiles__[1],"test Hello %d %f \n",1234567,8.96);
Jeandet Alexis
sync
r64 lcd0.paintText(&lcd0,"A",10,100,&ComicSansMS_18,0x0);
Removed error on fat32 library, seems now to be able navigate among sectors in...
r68 //while(1)test_address(&lcd0);
listFiles();
Added Simulator target to run code on x86 and debug functions....
r63 // while (scanf("%c",in))
// {
Jeandet Alexis
sync
r64 sleep(5);
Added Simulator target to run code on x86 and debug functions....
r63 // }
Removed error on fat32 library, seems now to be able navigate among sectors in...
r68
Added Simulator target to run code on x86 and debug functions....
r63 }