OpenCores
URL https://opencores.org/ocsvn/usb_fpga_2_14/usb_fpga_2_14/trunk

Subversion Repositories usb_fpga_2_14

[/] [usb_fpga_2_14/] [trunk/] [examples/] [fx2demo/] [Readme.debug] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ZTEX
debug
2
-----
3
 
4
The debug helper provides a simple interface to store status
5
informations or other data which can be read out from host PC using the
6
API.
7
 
8
The debug helper is stack orientated and initialized using the
9
"ENABLE_DEBUG(,);" macro, where 
10
denotes the maximum number of messages in stack and 
11
denotes the message size in bytes.
12
 
13
Two variables and one function are used for the message control:
14
 
15
/*
16
   This buffer is used to buffer the message. The user should
17
   write the data to this buffer.
18
*/
19
__xdata BYTE debug_msg_buf[DEBUG_MSG_SIZE];
20
 
21
/*
22
   Points the the last message on message stack. This can be used to
23
   modify / update the last message
24
*/
25
__xdata BYTE* xdata debug_stack_ptr;
26
 
27
/*
28
   Adds the message stored in debug_msg_buf to the message stack
29
*/
30
void debug_add_msg ();
31
 
32
The messages can be read out from host PC using the following API
33
methods and variables:
34
 
35
/*
36
   Is set by debugReadMessages(boolean,byte[]) and contains the number
37
   of new messages.
38
*/
39
public int debugNewMessages;
40
 
41
/*
42
   Returns the size of message stack in messages.
43
*/
44
public int debugStackSize ( );
45
 
46
/*
47
   Returns the size of messages in bytes.
48
*/
49
public int debugMsgSize ( );
50
 
51
/*
52
   Returns the number of the last message read out by
53
   debugStackSize(boolean,byte[])
54
*/
55
public final int debuglastMsg ( );
56
 
57
/*
58
   Reads debug messages from message stack. The number of messages
59
   stored in buf is returned. The total number of new messages is stored
60
   in debugNewMessages. The number of the latest message is returned by
61
   debuglastMessage().
62
 
63
   If parameter all is true, all messages from stack are written to buf.
64
   If it is false, only the new messages are written to buf.
65
*/
66
public int debugReadMessages ( boolean all, byte[] buf );
67
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.