##// END OF EJS Templates
wraped printf for simulator.
Jeandet Alexis -
r89:68078fc5f465 dev_alexis
parent child
Show More
@@ -71,6 +71,8 FAT32fs sdcard2FAT32part3;
71 71 dikpartition sdcard2Part4;
72 72 FAT32fs sdcard2FAT32part4;
73 73
74
75
74 76 int bsp_init()
75 77 {
76 78 int i=0;
@@ -329,4 +331,3 Uint32 getpixel(SDL_Surface *surface, in
329 331
330 332
331 333
332
@@ -2,6 +2,10
2 2 #include <stdio.h>
3 3 #include <fat32.h>
4 4 #include <ucdirent.h>
5 #include <stdarg.h>
6 #include <streamdevices.h>
7
8
5 9
6 10 void printRootClustersChain(FAT32fs* sdcard2FAT32part)
7 11 {
@@ -24,8 +24,6
24 24 * the project file. The value BSP contains the board name, and UCMODEL contain
25 25 * the target architecture.
26 26 */
27 #include <stdio.h>
28
29 27
30 28 int libuc_main()
31 29 {
@@ -27,7 +27,7 QMAKE_LINK = gcc
27 27 QMAKE_LINK_SHLIB = gcc
28 28 QMAKE_LINK_C = gcc
29 29 QMAKE_LINK_C_SHLIB = gcc
30 QMAKE_LFLAGS += -g -O0
30 QMAKE_LFLAGS += -g -O0 -Wl,-wrap,printf -Wl,-wrap,puts
31 31 QMAKE_LFLAGS_RELEASE +=
32 32 QMAKE_LFLAGS_DEBUG +=
33 33 QMAKE_LFLAGS_APP +=
@@ -1,4 +1,32
1 #include <stdio.h>
2 #include <stdarg.h>
3 #include <streamdevices.h>
1 4
5 extern streamdevice* __opnfiles__[];
6
7 extern int __real_printf(const char *format,...);
8
9 int __wrap_printf(const char *format,...)
10 {
11 char* str_buffer;
12 // for(int i =0;i<512;i++)str_buffer[i]='\0';
13 int i;
14 va_list ap;
15 va_start(ap,format);
16 vasprintf(&str_buffer,format,ap);
17 va_end(ap);
18 i=strlen(str_buffer);
19 __opnfiles__[1]->ops->write(__opnfiles__[1],(void*)str_buffer,1,i);
20 }
21
22 extern int __real_puts(const char *s);
23
24 int __wrap_puts(const char *s)
25 {
26 int i;
27 i=strlen(s);
28 __opnfiles__[1]->ops->write(__opnfiles__[1],(void*)s,1,i);
29 }
2 30
3 31 int main(void)
4 32 {
@@ -1,4 +1,32
1 #include <stdio.h>
2 #include <stdarg.h>
3 #include <streamdevices.h>
1 4
5 extern streamdevice* __opnfiles__[];
6
7 extern int __real_printf(const char *format,...);
8
9 int __wrap_printf(const char *format,...)
10 {
11 char* str_buffer;
12 // for(int i =0;i<512;i++)str_buffer[i]='\0';
13 int i;
14 va_list ap;
15 va_start(ap,format);
16 vasprintf(&str_buffer,format,ap);
17 va_end(ap);
18 i=strlen(str_buffer);
19 __opnfiles__[1]->ops->write(__opnfiles__[1],(void*)str_buffer,1,i);
20 }
21
22 extern int __real_puts(const char *s);
23
24 int __wrap_puts(const char *s)
25 {
26 int i;
27 i=strlen(s);
28 __opnfiles__[1]->ops->write(__opnfiles__[1],(void*)s,1,i);
29 }
2 30
3 31 int main(void)
4 32 {
General Comments 0
You need to be logged in to leave comments. Login now