瀏覽代碼

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,10 +70,10 @@ void pdbs_config_print(BaseSequentialStream *chp, const struct pdbs_config *cfg)
70 70
     chprintf(chp, "v: %d.%02d V\r\n", PD_PDV_V(cfg->v), PD_PDV_CV(cfg->v));
71 71
     chprintf(chp, "i: %d.%02d A\r\n", PD_PDI_A(cfg->i), PD_PDI_CA(cfg->i));
72 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,8 +215,8 @@ void pdbs_config_flash_update(const struct pdbs_config *cfg)
215 215
     flash_write_halfword(&(empty->flags), cfg->flags);
216 216
     flash_write_halfword(&(empty->v), cfg->v);
217 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 221
     flash_lock();
222 222
 

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

@@ -32,8 +32,8 @@ struct pdbs_config {
32 32
     uint16_t flags;
33 33
     uint16_t v;
34 34
     uint16_t i;
35
-    uint16_t v_min;
36
-    uint16_t v_max;
35
+    uint16_t vmin;
36
+    uint16_t vmax;
37 37
     uint16_t _reserved[2];
38 38
 } __attribute__((packed));
39 39
 
@@ -48,7 +48,7 @@ struct pdbs_config {
48 48
 /* Flags for configuration structures. */
49 49
 /* GiveBack supported */
50 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 52
 #define PDBS_CONFIG_FLAGS_VAR_BAT 0x0002
53 53
 
54 54
 

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

@@ -202,8 +202,8 @@ static void cmd_load(BaseSequentialStream *chp, int argc, char *argv[])
202 202
     tmpcfg.flags = cfg->flags;
203 203
     tmpcfg.v = cfg->v;
204 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 209
 static void cmd_get_cfg(BaseSequentialStream *chp, int argc, char *argv[])

Loading…
取消
儲存