Selaa lähdekoodia

Fiexed AT90USB162 compatibility.(different number of endpoint)

tags/v1.9
tmk 12 vuotta sitten
vanhempi
commit
446f87f9e8
2 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 2
    2
      pjrc/usb.c
  2. 7
    1
      pjrc/usb.h

+ 2
- 2
pjrc/usb.c Näytä tiedosto

usb_configuration = wValue; usb_configuration = wValue;
usb_send_in(); usb_send_in();
cfg = endpoint_config_table; cfg = endpoint_config_table;
for (i=1; i<=6; i++) {
for (i=1; i<=MAX_ENDPOINT; i++) {
UENUM = i; UENUM = i;
en = pgm_read_byte(cfg++); en = pgm_read_byte(cfg++);
if (en) { if (en) {
UECONX = 0; UECONX = 0;
} }
} }
UERST = 0x7E;
UERST = UERST_MASK;
UERST = 0; UERST = 0;
return; return;
} }

+ 7
- 1
pjrc/usb.h Näytä tiedosto

((s) == 16 ? 0x10 : \ ((s) == 16 ? 0x10 : \
0x00))) 0x00)))


#define MAX_ENDPOINT 4
#if defined (__AVR_AT90USB162__) || defined (__AVR_AT90USB82__)
# define MAX_ENDPOINT 4
# define UERST_MASK 0x1E
#else
# define MAX_ENDPOINT 6
# define UERST_MASK 0x7E
#endif


#define LSB(n) (n & 255) #define LSB(n) (n & 255)
#define MSB(n) ((n >> 8) & 255) #define MSB(n) ((n >> 8) & 255)

Loading…
Peruuta
Tallenna