Browse Source

Set variables at declaration

Clara Hobbs 7 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
     /* Measure CC1 */
156
     /* Measure CC1 */
157
     fusb_write_byte(FUSB_SWITCHES0, 0x07);
157
     fusb_write_byte(FUSB_SWITCHES0, 0x07);
158
     chThdSleepMicroseconds(250);
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
     /* Measure CC2 */
161
     /* Measure CC2 */
163
     fusb_write_byte(FUSB_SWITCHES0, 0x0B);
162
     fusb_write_byte(FUSB_SWITCHES0, 0x0B);
164
     chThdSleepMicroseconds(250);
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
     /* Select the correct CC line for BMC signaling; also enable AUTO_CRC */
166
     /* Select the correct CC line for BMC signaling; also enable AUTO_CRC */
169
     if (cc1 > cc2) {
167
     if (cc1 > cc2) {

Loading…
Cancel
Save