Преглед изворни кода

Don't leak setup_struct into Arduino sketch namespace

main
PaulStoffregen пре 7 година
родитељ
комит
8b833f02d9
2 измењених фајлова са 25 додато и 26 уклоњено
  1. +25
    -0
      teensy3/usb_audio.cpp
  2. +0
    -26
      teensy3/usb_audio.h

+ 25
- 0
teensy3/usb_audio.cpp Прегледај датотеку

return target * 4; return target * 4;
} }



struct setup_struct {
union {
struct {
uint8_t bmRequestType;
uint8_t bRequest;
union {
struct {
uint8_t bChannel; // 0=main, 1=left, 2=right
uint8_t bCS; // Control Selector
};
uint16_t wValue;
};
union {
struct {
uint8_t bIfEp; // type of entity
uint8_t bEntityId; // UnitID, TerminalID, etc.
};
uint16_t wIndex;
};
uint16_t wLength;
};
};
};

int usb_audio_get_feature(void *stp, uint8_t *data, uint32_t *datalen) int usb_audio_get_feature(void *stp, uint8_t *data, uint32_t *datalen)
{ {
struct setup_struct setup = *((struct setup_struct *)stp); struct setup_struct setup = *((struct setup_struct *)stp);

+ 0
- 26
teensy3/usb_audio.h Прегледај датотеку

#ifdef __cplusplus #ifdef __cplusplus
} }


// setup struct definition could be moved from usb_dev.c to usb_dev.h so we can reuse
// it instead of redefining it here
struct setup_struct {
union {
struct {
uint8_t bmRequestType;
uint8_t bRequest;
union {
struct {
uint8_t bChannel; // 0=main, 1=left, 2=right
uint8_t bCS; // Control Selector
};
uint16_t wValue;
};
union {
struct {
uint8_t bIfEp; // type of entity
uint8_t bEntityId; // UnitID, TerminalID, etc.
};
uint16_t wIndex;
};
uint16_t wLength;
};
};
};

// audio features supported // audio features supported
struct usb_audio_features_struct { struct usb_audio_features_struct {
int change; // set to 1 when any value is changed int change; // set to 1 when any value is changed

Loading…
Откажи
Сачувај