Added default values and checks for SAMPLE_BIT_RESOLUTION_ and SAMPLE_SUBSLOT_SIZE_ defines

This commit is contained in:
Ross Owen
2013-12-19 12:01:15 +00:00
parent d690ad9dfc
commit 8bf5bc7ea8

View File

@@ -246,15 +246,51 @@
#define PID_AUDIO_2 (0x0002) #define PID_AUDIO_2 (0x0002)
#endif #endif
/* Device release number in BCD: 0xJJMN */
#define BCD_DEVICE_J 6 #define BCD_DEVICE_J 6
#define BCD_DEVICE_M 3 #define BCD_DEVICE_M 3
#define BCD_DEVICE_N 1 #define BCD_DEVICE_N 1
/* Device release number in BCD: 0xJJMN */
#ifndef BCD_DEVICE #ifndef BCD_DEVICE
#define BCD_DEVICE ((BCD_DEVICE_J << 8) | ((BCD_DEVICE_M & 0xF) << 4) | (BCD_DEVICE_N & 0xF)) #define BCD_DEVICE ((BCD_DEVICE_J << 8) | ((BCD_DEVICE_M & 0xF) << 4) | (BCD_DEVICE_N & 0xF))
#endif #endif
/* Sample Sub-slot size (bytes) for High Speed. Default is 4 bytes */
#ifndef SAMPLE_SUBSLOT_SIZE_HS
#define SAMPLE_SUBSLOT_SIZE_HS 4
#endif
#if (SAMPLE_SUBSLOT_SIZE_HS != 2) && (SAMPLE_SUBSLOT_SIZE_HS != 3) && (SAMPLE_SUBSLOT_SIZE_HS != 4)
#error Only SAMPLE_SUBSLOT_SIZE_HS 2, 3 or 4 supported #SAMPLE_SUBSLOT_SIZE_HS
#endif
/* Sample Sub-slot size (bytes) for Full Speed. Default is 3 bytes */
#ifndef SAMPLE_SUBSLOT_SIZE_FS
#define SAMPLE_SUBSLOT_SIZE_FS 3
#endif
#if (SAMPLE_SUBSLOT_SIZE_FS != 2) && (SAMPLE_SUBSLOT_SIZE_FS != 3) && (SAMPLE_SUBSLOT_SIZE_FS != 4)
#error Only SAMPLE_SUBSLOT_SIZE_FS 2, 3 or 4 supported
#endif
/* Sample bit resolution for High Speed. Default 24bit*/
#ifndef SAMPLE_BIT_RESOLUTION_HS
#define SAMPLE_BIT_RESOLUTION_HS 24
#endif
#if (SAMPLE_BIT_RESOLUTION_HS/8) > SAMPLE_SUBSLOT_SIZE_HS
#error SAMPLE_BIT_RESOLUTION_HS is too big for SAMPLE_SUBSLOT_SIZE_HS
#endif
/* Sample bit resolution for Full Speed. Default 24bit*/
#ifndef SAMPLE_BIT_RESOLUTION_FS
#define SAMPLE_BIT_RESOLUTION_FS 24
#endif
#if (SAMPLE_BIT_RESOLUTION_FS/8) > SAMPLE_SUBSLOT_SIZE_FS
#error SAMPLE_BIT_RESOLUTION_FS is too big for SAMPLE_SUBSLOT_SIZE_FS
#endif
/* By default base the iAP version number on USB BCD_DEVICE */ /* By default base the iAP version number on USB BCD_DEVICE */
#if defined(IAP) && !defined(ACCESSORY_FIRMWARE_VERSION) #if defined(IAP) && !defined(ACCESSORY_FIRMWARE_VERSION)
#define ACCESSORY_FIRMWARE_VERSION {BCD_DEVICE_J, BCD_DEVICE_M, BCD_DEVICE_N} #define ACCESSORY_FIRMWARE_VERSION {BCD_DEVICE_J, BCD_DEVICE_M, BCD_DEVICE_N}