Explorar el Código

s/USBTMC488/USB488/ ; fix types in bitfield

Nathan Conrad hace 6 años
padre
commit
d742c3e15c
Se han modificado 2 ficheros con 11 adiciones y 11 borrados
  1. 7 7
      src/class/usbtmc/usbtmc.h
  2. 4 4
      src/class/usbtmc/usbtmc_device.c

+ 7 - 7
src/class/usbtmc/usbtmc.h

@@ -139,9 +139,9 @@ TU_VERIFY_STATIC(sizeof(usbtmc_msg_request_vendor_specific_in) == 12u, "struct w
 /*
 typedef struct TU_ATTR_PACKED {
   struct {
-    uint8_t Recipient  : 5         ; ///< EOM set on last byte
-    uint8_t Type       : 2         ; ///< EOM set on last byte
-    uint8_t DirectionToHost  : 1   ; ///< 0 is OUT, 1 is IN
+    unsigned int Recipient  : 5         ; ///< EOM set on last byte
+    unsigned int Type       : 2         ; ///< EOM set on last byte
+    unsigned int DirectionToHost  : 1   ; ///< 0 is OUT, 1 is IN
   } bmRequestType;
   uint8_t bRequest                 ; ///< If bmRequestType.Type = Class, see usmtmc_request_type_enum
   uint16_t wValue                  ;
@@ -176,10 +176,10 @@ typedef enum {
   USBTMC_bREQUEST_INDICATOR_PULSE               = 64u, // Optional
 
   /****** USBTMC 488 *************/
-  USBTMC488_bREQUEST_READ_STATUS_BYTE  = 128u,
-  USBTMC488_bREQUEST_REN_CONTROL       = 160u,
-  USBTMC488_bREQUEST_GO_TO_LOCAL       = 161u,
-  USBTMC488_bREQUEST_LOCAL_LOCKOUT     = 162u,
+  USB488_bREQUEST_READ_STATUS_BYTE  = 128u,
+  USB488_bREQUEST_REN_CONTROL       = 160u,
+  USB488_bREQUEST_GO_TO_LOCAL       = 161u,
+  USB488_bREQUEST_LOCAL_LOCKOUT     = 162u,
 
 } usmtmc_request_type_enum;
 

+ 4 - 4
src/class/usbtmc/usbtmc_device.c

@@ -727,7 +727,7 @@ bool usbtmcd_control_request(uint8_t rhport, tusb_control_request_t const * requ
 #if (USBTMC_CFG_ENABLE_488)
 
     // USB488 required requests
-  case USBTMC488_bREQUEST_READ_STATUS_BYTE:
+  case USB488_bREQUEST_READ_STATUS_BYTE:
     {
       usbtmc_read_stb_rsp_488_t rsp;
       TU_VERIFY(request->bmRequestType == 0xA1); // in,class,interface
@@ -763,9 +763,9 @@ bool usbtmcd_control_request(uint8_t rhport, tusb_control_request_t const * requ
       return true;
     }
     // USB488 optional requests
-  case USBTMC488_bREQUEST_REN_CONTROL:
-  case USBTMC488_bREQUEST_GO_TO_LOCAL:
-  case USBTMC488_bREQUEST_LOCAL_LOCKOUT:
+  case USB488_bREQUEST_REN_CONTROL:
+  case USB488_bREQUEST_GO_TO_LOCAL:
+  case USB488_bREQUEST_LOCAL_LOCKOUT:
     {
       TU_VERIFY(request->bmRequestType == 0xA1); // in,class,interface
       TU_VERIFY(false);