Date:2011-07-06 00:39:25 (8 years 2 months ago)
Author:Werner Almesberger
Commit:ead7ade51e1f553f959770c7902808ebbe48d4e8
Message:Revert "atusb/fw/: added optional debug log with request ATUSB_READ_LOG"

This reverts commit 39e3d4e61acccf40e021bdb7af73492e6c10b4c6.

The log isn't so useful in its present state because we may have to
unplug/replug to get out of a troublesome condition.
Files: atusb/fw/ep0.c (3 diffs)
atusb/fw/include/atusb/ep0.h (2 diffs)

Change Details

atusb/fw/ep0.c
5656#define BUILD_OFFSET 7 /* '#' plus "65535" plus ' ' */
5757
5858
59#ifdef DEBUG_LOG
60
61#define LOG_SIZE 16
62
63static struct {
64    uint16_t n;
65    struct setup_request setup;
66} log_buf[LOG_SIZE];
67
68static int log_pos = 0;
69
70#endif /* DEBUG_LOG */
71
72
7359static int my_setup(const struct setup_request *setup)
7460{
7561    uint16_t req = setup->bmRequestType | setup->bRequest << 8;
...... 
7763    uint8_t i;
7864    uint64_t tmp64;
7965
80#ifdef DEBUG_LOG
81
82    uint8_t pos;
83
84    pos = log_pos & (LOG_SIZE-1);
85    log_buf[pos].n = log_pos;
86    log_buf[pos].setup = *setup;
87    log_pos++;
88
89#endif /* DEBUG_LOG */
90
9166    switch (req) {
9267    case ATUSB_FROM_DEV(ATUSB_ID):
9368        debug("ATUSB_ID\n");
...... 
154129        gpio_cleanup();
155130        return 1;
156131
157#ifdef DEBUG_LOG
158    case ATUSB_FROM_DEV(ATUSB_READ_LOG):
159        usb_send(&eps[0], log_buf, sizeof(log_buf), NULL, NULL);
160        return 1;
161#endif
162
163132    case ATUSB_TO_DEV(ATUSB_SLP_TR):
164133        debug("ATUSB_SLP_TR\n");
165134        slp_tr();
atusb/fw/include/atusb/ep0.h
2828 * ->host ATUSB_GPIO dir+data mask+p# 3
2929 * host-> ATUSB_SLP_TR - - 0
3030 * host-> ATUSB_GPIO_CLEANUP - - 0
31 * ->host ATUSB_READ_LOG - - #bytes
3231 *
3332 * host-> ATUSB_REG_WRITE value addr 0
3433 * ->host ATUSB_REG_READ - addr 1
...... 
8382    ATUSB_GPIO,
8483    ATUSB_SLP_TR,
8584    ATUSB_GPIO_CLEANUP,
86    ATUSB_READ_LOG,
8785    ATUSB_REG_WRITE = 0x20, /* transceiver group */
8886    ATUSB_REG_READ,
8987    ATUSB_BUF_WRITE,

Archive Download the corresponding diff file



interactive