瀏覽代碼

Rename v_min and v_max to have no underscores

Clara Hobbs 7 年之前
父節點
當前提交
36f43f9b8a
共有 3 個文件被更改,包括 11 次插入11 次删除
  1. 6
    6
      src/config.c
  2. 3
    3
      src/config.h
  3. 2
    2
      src/shell.c

+ 6
- 6
src/config.c 查看文件

70
     chprintf(chp, "v: %d.%02d V\r\n", PD_PDV_V(cfg->v), PD_PDV_CV(cfg->v));
70
     chprintf(chp, "v: %d.%02d V\r\n", PD_PDV_V(cfg->v), PD_PDV_CV(cfg->v));
71
     chprintf(chp, "i: %d.%02d A\r\n", PD_PDI_A(cfg->i), PD_PDI_CA(cfg->i));
71
     chprintf(chp, "i: %d.%02d A\r\n", PD_PDI_A(cfg->i), PD_PDI_CA(cfg->i));
72
     if (cfg->flags & PDBS_CONFIG_FLAGS_VAR_BAT) {
72
     if (cfg->flags & PDBS_CONFIG_FLAGS_VAR_BAT) {
73
-        chprintf(chp, "v_min: %d.%02d V\r\n", PD_PDV_V(cfg->v_min),
74
-                 PD_PDV_CV(cfg->v_min));
75
-        chprintf(chp, "v_max: %d.%02d V\r\n", PD_PDV_V(cfg->v_max),
76
-                 PD_PDV_CV(cfg->v_max));
73
+        chprintf(chp, "vmin: %d.%02d V\r\n", PD_PDV_V(cfg->vmin),
74
+                 PD_PDV_CV(cfg->vmin));
75
+        chprintf(chp, "vmax: %d.%02d V\r\n", PD_PDV_V(cfg->vmax),
76
+                 PD_PDV_CV(cfg->vmax));
77
     }
77
     }
78
 }
78
 }
79
 
79
 
215
     flash_write_halfword(&(empty->flags), cfg->flags);
215
     flash_write_halfword(&(empty->flags), cfg->flags);
216
     flash_write_halfword(&(empty->v), cfg->v);
216
     flash_write_halfword(&(empty->v), cfg->v);
217
     flash_write_halfword(&(empty->i), cfg->i);
217
     flash_write_halfword(&(empty->i), cfg->i);
218
-    flash_write_halfword(&(empty->v_min), cfg->v_min);
219
-    flash_write_halfword(&(empty->v_max), cfg->v_max);
218
+    flash_write_halfword(&(empty->vmin), cfg->vmin);
219
+    flash_write_halfword(&(empty->vmax), cfg->vmax);
220
 
220
 
221
     flash_lock();
221
     flash_lock();
222
 
222
 

+ 3
- 3
src/config.h 查看文件

32
     uint16_t flags;
32
     uint16_t flags;
33
     uint16_t v;
33
     uint16_t v;
34
     uint16_t i;
34
     uint16_t i;
35
-    uint16_t v_min;
36
-    uint16_t v_max;
35
+    uint16_t vmin;
36
+    uint16_t vmax;
37
     uint16_t _reserved[2];
37
     uint16_t _reserved[2];
38
 } __attribute__((packed));
38
 } __attribute__((packed));
39
 
39
 
48
 /* Flags for configuration structures. */
48
 /* Flags for configuration structures. */
49
 /* GiveBack supported */
49
 /* GiveBack supported */
50
 #define PDBS_CONFIG_FLAGS_GIVEBACK 0x0001
50
 #define PDBS_CONFIG_FLAGS_GIVEBACK 0x0001
51
-/* Variable and battery PDOs supported (v_min and v_max valid) */
51
+/* Variable and battery PDOs supported (vmin and vmax valid) */
52
 #define PDBS_CONFIG_FLAGS_VAR_BAT 0x0002
52
 #define PDBS_CONFIG_FLAGS_VAR_BAT 0x0002
53
 
53
 
54
 
54
 

+ 2
- 2
src/shell.c 查看文件

202
     tmpcfg.flags = cfg->flags;
202
     tmpcfg.flags = cfg->flags;
203
     tmpcfg.v = cfg->v;
203
     tmpcfg.v = cfg->v;
204
     tmpcfg.i = cfg->i;
204
     tmpcfg.i = cfg->i;
205
-    tmpcfg.v_min = cfg->v_min;
206
-    tmpcfg.v_max = cfg->v_max;
205
+    tmpcfg.vmin = cfg->vmin;
206
+    tmpcfg.vmax = cfg->vmax;
207
 }
207
 }
208
 
208
 
209
 static void cmd_get_cfg(BaseSequentialStream *chp, int argc, char *argv[])
209
 static void cmd_get_cfg(BaseSequentialStream *chp, int argc, char *argv[])

Loading…
取消
儲存