瀏覽代碼

Set variables at declaration

Clara Hobbs 7 年之前
父節點
當前提交
7d97ceb134
共有 1 個檔案被更改,包括 2 行新增4 行删除
  1. 2
    4
      src/fusb302b.c

+ 2
- 4
src/fusb302b.c 查看文件

@@ -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…
取消
儲存