Browse Source

Change the condition for printing voltage range

Now instead of checking the Var/Bat flag, it checks if either end of the
range is non-zero.
Clara Hobbs 7 years ago
parent
commit
d9d8e5d45a
2 changed files with 3 additions and 2 deletions
  1. 2
    1
      src/config.c
  2. 1
    1
      src/config.h

+ 2
- 1
src/config.c View File

@@ -69,7 +69,8 @@ void pdbs_config_print(BaseSequentialStream *chp, const struct pdbs_config *cfg)
69 69
     /* Print voltages and current */
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
-    if (cfg->flags & PDBS_CONFIG_FLAGS_VAR_BAT) {
72
+    /* If either end of the range is non-zero, print the range */
73
+    if (cfg->vmin != 0 || cfg->vmax != 0) {
73 74
         chprintf(chp, "vmin: %d.%02d V\r\n", PD_PDV_V(cfg->vmin),
74 75
                  PD_PDV_CV(cfg->vmin));
75 76
         chprintf(chp, "vmax: %d.%02d V\r\n", PD_PDV_V(cfg->vmax),

+ 1
- 1
src/config.h View File

@@ -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 (vmin and vmax valid) */
51
+/* Variable and battery PDOs preferred (FIXME: not implemented) */
52 52
 #define PDBS_CONFIG_FLAGS_VAR_BAT 0x0002
53 53
 
54 54
 

Loading…
Cancel
Save