Browse Source

Set variables at declaration

Clara Hobbs 5 years ago
parent
commit
7d97ceb134
1 changed files with 2 additions and 4 deletions
  1. 2
    4
      src/fusb302b.c

+ 2
- 4
src/fusb302b.c View File

@@ -156,14 +156,12 @@ void fusb_setup(void)
156 156
     /* Measure CC1 */
157 157
     fusb_write_byte(FUSB_SWITCHES0, 0x07);
158 158
     chThdSleepMicroseconds(250);
159
-    uint8_t cc1;
160
-    cc1 = fusb_read_byte(FUSB_STATUS0) & FUSB_STATUS0_BC_LVL;
159
+    uint8_t cc1 = fusb_read_byte(FUSB_STATUS0) & FUSB_STATUS0_BC_LVL;
161 160
 
162 161
     /* Measure CC2 */
163 162
     fusb_write_byte(FUSB_SWITCHES0, 0x0B);
164 163
     chThdSleepMicroseconds(250);
165
-    uint8_t cc2;
166
-    cc2 = fusb_read_byte(FUSB_STATUS0) & FUSB_STATUS0_BC_LVL;
164
+    uint8_t cc2 = fusb_read_byte(FUSB_STATUS0) & FUSB_STATUS0_BC_LVL;
167 165
 
168 166
     /* Select the correct CC line for BMC signaling; also enable AUTO_CRC */
169 167
     if (cc1 > cc2) {

Loading…
Cancel
Save