hdk serial test program for EA4088 mbed. HDK Serial stopped after a while.
Dependencies: EALib USBDevice mbed
Fork of LPC4088test by
main.cpp@1:65017af721b9, 2013-10-07 (annotated)
- Committer:
- mio
- Date:
- Mon Oct 07 21:44:21 2013 +0000
- Revision:
- 1:65017af721b9
- Parent:
- 0:0e8a8d6e4cfd
Simple Test only output message version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mio | 0:0e8a8d6e4cfd | 1 | #include "mbed.h" |
mio | 1:65017af721b9 | 2 | //#include "sdram.h" |
mio | 1:65017af721b9 | 3 | //#include "USBSerial.h" |
mio | 0:0e8a8d6e4cfd | 4 | |
mio | 0:0e8a8d6e4cfd | 5 | DigitalOut led1(LED1); |
mio | 1:65017af721b9 | 6 | //USBSerial cdc; |
mio | 0:0e8a8d6e4cfd | 7 | Serial pc(USBTX,USBRX); |
mio | 0:0e8a8d6e4cfd | 8 | |
mio | 0:0e8a8d6e4cfd | 9 | #define SIZE (1024*1024) |
mio | 0:0e8a8d6e4cfd | 10 | |
mio | 0:0e8a8d6e4cfd | 11 | int alloccount = 0; |
mio | 0:0e8a8d6e4cfd | 12 | unsigned char *ptr[100] ; |
mio | 0:0e8a8d6e4cfd | 13 | |
mio | 0:0e8a8d6e4cfd | 14 | int main() { |
mio | 1:65017af721b9 | 15 | //sdram_init(); |
mio | 0:0e8a8d6e4cfd | 16 | while(1) { |
mio | 1:65017af721b9 | 17 | //ptr[alloccount] = (unsigned char *)malloc(SIZE) ; |
mio | 1:65017af721b9 | 18 | //cdc.printf ("Allocated Address = %08X\r\n",ptr[alloccount]); |
mio | 0:0e8a8d6e4cfd | 19 | pc.printf ("Allocated Address = %08X\r\n",ptr[alloccount]); |
mio | 1:65017af721b9 | 20 | //if (ptr[alloccount] == NULL) { |
mio | 1:65017af721b9 | 21 | // cdc.printf("MAX ALLOC MEMORY %d MB\r\n",alloccount); |
mio | 1:65017af721b9 | 22 | // pc.printf("MAX ALLOC MEMORY %d MB\r\n",alloccount); |
mio | 1:65017af721b9 | 23 | // for (int i=0;i<alloccount;i++) { |
mio | 1:65017af721b9 | 24 | // free(ptr[i]); |
mio | 1:65017af721b9 | 25 | // } |
mio | 1:65017af721b9 | 26 | // alloccount = 0; |
mio | 1:65017af721b9 | 27 | //} else { |
mio | 1:65017af721b9 | 28 | // alloccount++ ; |
mio | 1:65017af721b9 | 29 | //} |
mio | 0:0e8a8d6e4cfd | 30 | led1 = 1; |
mio | 0:0e8a8d6e4cfd | 31 | wait(0.1); |
mio | 0:0e8a8d6e4cfd | 32 | led1 = 0; |
mio | 0:0e8a8d6e4cfd | 33 | wait(0.1); |
mio | 0:0e8a8d6e4cfd | 34 | } |
mio | 0:0e8a8d6e4cfd | 35 | } |