Batch appercase hex values
This commit is contained in:
@@ -78,16 +78,16 @@ typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega
|
||||
#define USB_CLASS_PRINTER 0x07 // Printer
|
||||
#define USB_CLASS_MASS_STORAGE 0x08 // Mass Storage
|
||||
#define USB_CLASS_HUB 0x09 // Hub
|
||||
#define USB_CLASS_CDC_DATA 0x0a // CDC-Data
|
||||
#define USB_CLASS_SMART_CARD 0x0b // Smart-Card
|
||||
#define USB_CLASS_CONTENT_SECURITY 0x0d // Content Security
|
||||
#define USB_CLASS_VIDEO 0x0e // Video
|
||||
#define USB_CLASS_PERSONAL_HEALTH 0x0f // Personal Healthcare
|
||||
#define USB_CLASS_DIAGNOSTIC_DEVICE 0xdc // Diagnostic Device
|
||||
#define USB_CLASS_WIRELESS_CTRL 0xe0 // Wireless Controller
|
||||
#define USB_CLASS_MISC 0xef // Miscellaneous
|
||||
#define USB_CLASS_APP_SPECIFIC 0xfe // Application Specific
|
||||
#define USB_CLASS_VENDOR_SPECIFIC 0xff // Vendor Specific
|
||||
#define USB_CLASS_CDC_DATA 0x0A // CDC-Data
|
||||
#define USB_CLASS_SMART_CARD 0x0B // Smart-Card
|
||||
#define USB_CLASS_CONTENT_SECURITY 0x0D // Content Security
|
||||
#define USB_CLASS_VIDEO 0x0E // Video
|
||||
#define USB_CLASS_PERSONAL_HEALTH 0x0F // Personal Healthcare
|
||||
#define USB_CLASS_DIAGNOSTIC_DEVICE 0xDC // Diagnostic Device
|
||||
#define USB_CLASS_WIRELESS_CTRL 0xE0 // Wireless Controller
|
||||
#define USB_CLASS_MISC 0xEF // Miscellaneous
|
||||
#define USB_CLASS_APP_SPECIFIC 0xFE // Application Specific
|
||||
#define USB_CLASS_VENDOR_SPECIFIC 0xFF // Vendor Specific
|
||||
|
||||
// Additional Error Codes
|
||||
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED 0xD1
|
||||
@@ -117,7 +117,7 @@ typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega
|
||||
#define HUB_PORT_RESET_DELAY 20 // hub port reset delay 10 ms recomended, can be up to 20 ms
|
||||
|
||||
/* USB state machine states */
|
||||
#define USB_STATE_MASK 0xf0
|
||||
#define USB_STATE_MASK 0xF0
|
||||
|
||||
#define USB_STATE_DETACHED 0x10
|
||||
#define USB_DETACHED_SUBSTATE_INITIALIZE 0x11
|
||||
@@ -132,7 +132,7 @@ typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega
|
||||
#define USB_STATE_ADDRESSING 0x70
|
||||
#define USB_STATE_CONFIGURING 0x80
|
||||
#define USB_STATE_RUNNING 0x90
|
||||
#define USB_STATE_ERROR 0xa0
|
||||
#define USB_STATE_ERROR 0xA0
|
||||
|
||||
class USBDeviceConfig {
|
||||
public:
|
||||
|
||||
@@ -52,16 +52,16 @@
|
||||
#define BGRAB7(__usi__) (((uint8_t *)&(__usi__))[7])
|
||||
#else
|
||||
// Note: The cast alone to uint8_t is actually enough.
|
||||
// GCC throws out the "& 0xff", and the size is no different.
|
||||
// GCC throws out the "& 0xFF", and the size is no different.
|
||||
// Some compilers need it.
|
||||
#define BGRAB0(__usi__) ((uint8_t)((__usi__) & 0xff ))
|
||||
#define BGRAB1(__usi__) ((uint8_t)(((__usi__) >> 8) & 0xff))
|
||||
#define BGRAB2(__usi__) ((uint8_t)(((__usi__) >> 16) & 0xff))
|
||||
#define BGRAB3(__usi__) ((uint8_t)(((__usi__) >> 24) & 0xff))
|
||||
#define BGRAB4(__usi__) ((uint8_t)(((__usi__) >> 32) & 0xff))
|
||||
#define BGRAB5(__usi__) ((uint8_t)(((__usi__) >> 40) & 0xff))
|
||||
#define BGRAB6(__usi__) ((uint8_t)(((__usi__) >> 48) & 0xff))
|
||||
#define BGRAB7(__usi__) ((uint8_t)(((__usi__) >> 56) & 0xff))
|
||||
#define BGRAB0(__usi__) ((uint8_t)((__usi__) & 0xFF ))
|
||||
#define BGRAB1(__usi__) ((uint8_t)(((__usi__) >> 8) & 0xFF))
|
||||
#define BGRAB2(__usi__) ((uint8_t)(((__usi__) >> 16) & 0xFF))
|
||||
#define BGRAB3(__usi__) ((uint8_t)(((__usi__) >> 24) & 0xFF))
|
||||
#define BGRAB4(__usi__) ((uint8_t)(((__usi__) >> 32) & 0xFF))
|
||||
#define BGRAB5(__usi__) ((uint8_t)(((__usi__) >> 40) & 0xFF))
|
||||
#define BGRAB6(__usi__) ((uint8_t)(((__usi__) >> 48) & 0xFF))
|
||||
#define BGRAB7(__usi__) ((uint8_t)(((__usi__) >> 56) & 0xFF))
|
||||
#endif
|
||||
#define BOVER1(__usi__) ((uint16_t)(__usi__) << 8)
|
||||
#define BOVER2(__usi__) ((uint32_t)(__usi__) << 16)
|
||||
|
||||
@@ -439,7 +439,7 @@ uint8_t BulkOnly::Init(uint8_t parent __attribute__((unused)), uint8_t port __at
|
||||
printf(" standards.\r\n");
|
||||
#endif
|
||||
|
||||
uint8_t tries = 0xf0;
|
||||
uint8_t tries = 0xF0;
|
||||
while ((rcode = TestUnitReady(lun))) {
|
||||
if (rcode == 0x08) break; // break on no media, this is OK to do.
|
||||
// try to lock media and spin up
|
||||
@@ -765,7 +765,7 @@ uint8_t BulkOnly::Page3F(uint8_t lun) {
|
||||
#ifdef SKIP_WRITE_PROTECT
|
||||
return 0;
|
||||
#endif
|
||||
uint8_t rc = ModeSense6(lun, 0, 0x3f, 0, 192, buf);
|
||||
uint8_t rc = ModeSense6(lun, 0, 0x3F, 0, 192, buf);
|
||||
if (!rc) {
|
||||
WriteOk[lun] = ((buf[2] & 0x80) == 0);
|
||||
Notify(PSTR("Mode Sense: "), 0x80);
|
||||
@@ -1203,10 +1203,10 @@ uint8_t BulkOnly::Read(uint8_t lun __attribute__((unused)), uint32_t addr __attr
|
||||
|
||||
cbw.CBWCB[0] = SCSI_CMD_READ_10;
|
||||
cbw.CBWCB[8] = blocks;
|
||||
cbw.CBWCB[2] = ((addr >> 24) & 0xff);
|
||||
cbw.CBWCB[3] = ((addr >> 16) & 0xff);
|
||||
cbw.CBWCB[4] = ((addr >> 8) & 0xff);
|
||||
cbw.CBWCB[5] = (addr & 0xff);
|
||||
cbw.CBWCB[2] = ((addr >> 24) & 0xFF);
|
||||
cbw.CBWCB[3] = ((addr >> 16) & 0xFF);
|
||||
cbw.CBWCB[4] = ((addr >> 8) & 0xFF);
|
||||
cbw.CBWCB[5] = (addr & 0xFF);
|
||||
|
||||
return HandleSCSIError(Transaction(&cbw, bsize, prs, 1));
|
||||
#else
|
||||
|
||||
@@ -214,7 +214,7 @@ struct CDB6 {
|
||||
public:
|
||||
|
||||
CDB6(uint8_t _Opcode, uint8_t _LUN, uint32_t LBA, uint8_t _AllocationLength, uint8_t _Control) :
|
||||
Opcode(_Opcode), LBAMSB(BGRAB2(LBA) & 0x1f), LUN(_LUN), LBAHB(BGRAB1(LBA)), LBALB(BGRAB0(LBA)),
|
||||
Opcode(_Opcode), LBAMSB(BGRAB2(LBA) & 0x1F), LUN(_LUN), LBAHB(BGRAB1(LBA)), LBALB(BGRAB0(LBA)),
|
||||
AllocationLength(_AllocationLength), Control(_Control) {
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
#define rREVISION 0x90 //18<<3
|
||||
|
||||
#define rIOPINS1 0xa0 //20<<3
|
||||
#define rIOPINS1 0xA0 //20<<3
|
||||
|
||||
/* IOPINS1 Bits */
|
||||
#define bmGPOUT0 0x01
|
||||
@@ -98,7 +98,7 @@
|
||||
#define bmGPIN2 0x40
|
||||
#define bmGPIN3 0x80
|
||||
|
||||
#define rIOPINS2 0xa8 //21<<3
|
||||
#define rIOPINS2 0xA8 //21<<3
|
||||
/* IOPINS2 Bits */
|
||||
#define bmGPOUT4 0x01
|
||||
#define bmGPOUT5 0x02
|
||||
@@ -109,7 +109,7 @@
|
||||
#define bmGPIN6 0x40
|
||||
#define bmGPIN7 0x80
|
||||
|
||||
#define rGPINIRQ 0xb0 //22<<3
|
||||
#define rGPINIRQ 0xB0 //22<<3
|
||||
/* GPINIRQ Bits */
|
||||
#define bmGPINIRQ0 0x01
|
||||
#define bmGPINIRQ1 0x02
|
||||
@@ -120,7 +120,7 @@
|
||||
#define bmGPINIRQ6 0x40
|
||||
#define bmGPINIRQ7 0x80
|
||||
|
||||
#define rGPINIEN 0xb8 //23<<3
|
||||
#define rGPINIEN 0xB8 //23<<3
|
||||
/* GPINIEN Bits */
|
||||
#define bmGPINIEN0 0x01
|
||||
#define bmGPINIEN1 0x02
|
||||
@@ -131,7 +131,7 @@
|
||||
#define bmGPINIEN6 0x40
|
||||
#define bmGPINIEN7 0x80
|
||||
|
||||
#define rGPINPOL 0xc0 //24<<3
|
||||
#define rGPINPOL 0xC0 //24<<3
|
||||
/* GPINPOL Bits */
|
||||
#define bmGPINPOL0 0x01
|
||||
#define bmGPINPOL1 0x02
|
||||
@@ -142,7 +142,7 @@
|
||||
#define bmGPINPOL6 0x40
|
||||
#define bmGPINPOL7 0x80
|
||||
|
||||
#define rHIRQ 0xc8 //25<<3
|
||||
#define rHIRQ 0xC8 //25<<3
|
||||
/* HIRQ Bits */
|
||||
#define bmBUSEVENTIRQ 0x01 // indicates BUS Reset Done or BUS Resume
|
||||
#define bmRWUIRQ 0x02
|
||||
@@ -153,7 +153,7 @@
|
||||
#define bmFRAMEIRQ 0x40
|
||||
#define bmHXFRDNIRQ 0x80
|
||||
|
||||
#define rHIEN 0xd0 //26<<3
|
||||
#define rHIEN 0xD0 //26<<3
|
||||
|
||||
/* HIEN Bits */
|
||||
#define bmBUSEVENTIE 0x01
|
||||
@@ -165,7 +165,7 @@
|
||||
#define bmFRAMEIE 0x40
|
||||
#define bmHXFRDNIE 0x80
|
||||
|
||||
#define rMODE 0xd8 //27<<3
|
||||
#define rMODE 0xD8 //27<<3
|
||||
|
||||
/* MODE Bits */
|
||||
#define bmHOST 0x01
|
||||
@@ -177,9 +177,9 @@
|
||||
#define bmDMPULLDN 0x40
|
||||
#define bmDPPULLDN 0x80
|
||||
|
||||
#define rPERADDR 0xe0 //28<<3
|
||||
#define rPERADDR 0xE0 //28<<3
|
||||
|
||||
#define rHCTL 0xe8 //29<<3
|
||||
#define rHCTL 0xE8 //29<<3
|
||||
/* HCTL Bits */
|
||||
#define bmBUSRST 0x01
|
||||
#define bmFRMRST 0x02
|
||||
@@ -190,7 +190,7 @@
|
||||
#define bmSNDTOG0 0x40
|
||||
#define bmSNDTOG1 0x80
|
||||
|
||||
#define rHXFR 0xf0 //30<<3
|
||||
#define rHXFR 0xF0 //30<<3
|
||||
|
||||
#undef tokSETUP
|
||||
#undef tokIN
|
||||
@@ -210,7 +210,7 @@
|
||||
#define tokISOIN 0x40 // HS=0, ISO=1, OUTNIN=0, SETUP=0
|
||||
#define tokISOOUT 0x60 // HS=0, ISO=1, OUTNIN=1, SETUP=0
|
||||
|
||||
#define rHRSL 0xf8 //31<<3
|
||||
#define rHRSL 0xF8 //31<<3
|
||||
|
||||
/* HRSL Bits */
|
||||
#define bmRCVTOGRD 0x10
|
||||
@@ -218,7 +218,7 @@
|
||||
#define bmKSTATUS 0x40
|
||||
#define bmJSTATUS 0x80
|
||||
#define bmSE0 0x00 //SE0 - disconnect state
|
||||
#define bmSE1 0xc0 //SE1 - illegal state
|
||||
#define bmSE1 0xC0 //SE1 - illegal state
|
||||
|
||||
/* Host error result codes, the 4 LSB's in the HRSL register */
|
||||
#define hrSUCCESS 0x00
|
||||
|
||||
@@ -34,7 +34,7 @@ template <class T>
|
||||
void PrintHex(T val, int lvl) {
|
||||
int num_nibbles = sizeof (T) * 2;
|
||||
do {
|
||||
char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0f);
|
||||
char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0F);
|
||||
if (v > 57) v += 7;
|
||||
E_Notifyc(v, lvl);
|
||||
} while (--num_nibbles);
|
||||
@@ -50,7 +50,7 @@ template <class T>
|
||||
void SerialPrintHex(T val) {
|
||||
int num_nibbles = sizeof (T) * 2;
|
||||
do {
|
||||
char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0f);
|
||||
char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0F);
|
||||
if (v > 57) v += 7;
|
||||
USB_HOST_SERIAL.print(v);
|
||||
} while (--num_nibbles);
|
||||
|
||||
@@ -90,7 +90,7 @@ uint8_t* MAX3421e::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p) {
|
||||
|
||||
// GPIN pins are in high nybbles of IOPINS1, IOPINS2
|
||||
uint8_t MAX3421e::gpioRd() {
|
||||
return (regRd(rIOPINS2) & 0xf0) | // pins 4-7, clean lower nybble
|
||||
return (regRd(rIOPINS2) & 0xF0) | // pins 4-7, clean lower nybble
|
||||
(regRd(rIOPINS1) >> 4); // shift low bits and OR with upper from previous operation.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user