Changes between Version 53 and Version 54 of WANMAC


Ignore:
Timestamp:
Jul 24, 2006, 12:27:50 PM (18 years ago)
Author:
varunnayyar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WANMAC

    v53 v54  
    326326
    327327
    328 
    329 
    330 
     328'''Allocating Memory'''
     329
     330Create a buffer of Desired WIDTH and HEIGHT.
     331Use Bufmalloc from that buffer.
     332Also free into that buffer.
     333
     334''Tips ''
     335
     3361) Ensure that for every allocation, there
     337is a corresponding free.
     338
     3392) If the WIDTH and HEIGHT values are too
     340high, their will be a compilation error !!
     341
     3423) Every time we do a malloc, capture
     343the Status Message returned and print
     344it out.
     345
     346Some useful ''code snippet'' for the above:
     347
     348#define BUFWIDTH 45
     349#define BUFHEIGHT 2096
     350static  membuf_t mbuft;
     351char    membuf[BUFWIDTH][BUFHEIGHT] __attribute__ ((aligned(4)));
    331352 
    332 
     353''Creating the Buffer''
     354 
     355  int var; 
     356  var = bufcreate (&mbuft, membuf, BUFWIDTH, BUFHEIGHT);
     357  if (var == -1){
     358    xil_printf ("Error while creating memory pool. Errno: %d.\r\r\n", errno);
     359    ;
     360  }
     361
     362''Destroying the Buffer''
     363
     364 bufdestroy (mbuft);
     365
     366''Allocation Example and Capturing''
     367
     368  data = (unsigned char*)bufmalloc(mbuft,sizeof(char) * (data length));
     369  if (data == 0) {
     370    xil_printf ("Error allocating Errno: %d.\r\n", errno);
     371    ;
     372  }
     373
     374''Deallocation'' : Again using mbuft
     375
     376  buffree(mbuft,data);
     377
     378
     379'''Printing out stuff on the Terminal'''
     380
     381We can use any terminal display for that.
     382
     3831) Ensure it is connected to the the right Serial Port.
     384(COMM1 / COMM2)
     385
     3862) Use the baud rate of 57600, else you will
     387see SYMBOLS instead of alphanumerics
     388
     3893) Making LOGS: When priting out huge stuff,
     390use File->Log of the Terminal. You can pause
     391the logging process in between.
     392
     3934) use xil_printf(), it has the same parameters
     394%d %x %c etc like printf. For NEWLINE, use both
     395\r\n.
     396
     397
     398'''Using Buttons on the Board''' for triggering Interrupt,
     399sp that we can see things ..
     400 
     401            B3
     402         B2 B1 B5
     403            B4
     404
     405see the code of pb_handler()
     406
     407
     408
     409 
     410