ensure USB config numbers always start from 1

Depending on which features (and thus USB configurations) are included
in the firmware, we need to re-define the ordering of the configuration
numbers, as the Atmel USBD driver simply assumes that configurations are
numbered 1..N without any gaps in the sequence.
This commit is contained in:
Harald Welte
2016-03-03 11:02:45 +01:00
parent 072daddf98
commit 1605564489
7 changed files with 26 additions and 4 deletions

View File

@@ -6,6 +6,7 @@
#define TRACE_LEVEL 5
#include "board.h"
#include "simtrace.h"
#include "utils.h"
#include "req_ctx.h"

View File

@@ -1,4 +1,6 @@
#include "board.h"
#include "simtrace.h"
#include "ringbuffer.h"
#include "card_emu.h"
#include "iso7816_fidi.h"
#include "utils.h"

View File

@@ -2,6 +2,7 @@
#define SIMTRACE_H
#include "ringbuffer.h"
#include "board.h"
/* Endpoint numbers */
#define DATAOUT 1
@@ -37,7 +38,20 @@ extern volatile uint32_t char_stat;
extern const Pin pinPhoneRST;
enum confNum {
CFG_NUM_SNIFF = 1, CFG_NUM_CCID, CFG_NUM_PHONE, CFG_NUM_MITM, NUM_CONF
CFG_NUM_NONE = 0,
#ifdef HAVE_SNIFFER
CFG_NUM_SNIFF,
#endif
#ifdef HAVE_CCID
CFG_NUM_CCID,
#endif
#ifdef HAVE_CARDEM
CFG_NUM_PHONE,
#endif
#ifdef HAVE_MITM
CFG_NUM_MITM,
#endif
NUM_CONF
};
/// CCIDDriverConfiguration Descriptors

View File

@@ -32,6 +32,8 @@
*------------------------------------------------------------------------------*/
#include "board.h"
#include "simtrace.h"
#include "ringbuffer.h"
#include "iso7816_fidi.h"
#include <string.h>

View File

@@ -32,6 +32,7 @@
*----------------------------------------------------------------------------*/
#include "board.h"
#include "simtrace.h"
#include "utils.h"
#include <cciddriverdescriptors.h>