Browse Source

Don't leak setup_struct into Arduino sketch namespace

main
PaulStoffregen 7 years ago
parent
commit
8b833f02d9
2 changed files with 25 additions and 26 deletions
  1. +25
    -0
      teensy3/usb_audio.cpp
  2. +0
    -26
      teensy3/usb_audio.h

+ 25
- 0
teensy3/usb_audio.cpp View File

@@ -350,6 +350,31 @@ unsigned int usb_audio_transmit_callback(void)
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)
{
struct setup_struct setup = *((struct setup_struct *)stp);

+ 0
- 26
teensy3/usb_audio.h View File

@@ -22,32 +22,6 @@ extern uint8_t usb_audio_transmit_setting;
#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
struct usb_audio_features_struct {
int change; // set to 1 when any value is changed

Loading…
Cancel
Save