Quellcode durchsuchen

Write 5 V in PDV as PD_MV2PDV(5000)

It's more obvious what is meant by that macro than by just the number
100.
Clara Hobbs vor 7 Jahren
Ursprung
Commit
24aa91ff64
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 4
    4
      src/device_policy_manager.c

+ 4
- 4
src/device_policy_manager.c Datei anzeigen

@@ -112,10 +112,10 @@ void pdb_dpm_get_sink_capability(union pd_msg *cap)
112 112
 
113 113
     /* If we have no configuration or want something other than 5 V, add a PDO
114 114
      * for vSafe5V */
115
-    if (cfg == NULL || cfg->v != 100) {
115
+    if (cfg == NULL || cfg->v != PD_MV2PDV(5000)) {
116 116
         /* Minimum current, 5 V, and higher capability. */
117 117
         cap->obj[numobj++] = PD_PDO_TYPE_FIXED
118
-            | PD_PDO_SNK_FIXED_VOLTAGE_SET(100)
118
+            | PD_PDO_SNK_FIXED_VOLTAGE_SET(PD_MV2PDV(5000))
119 119
             | PD_PDO_SNK_FIXED_CURRENT_SET(DPM_MIN_CURRENT);
120 120
     }
121 121
 
@@ -125,7 +125,7 @@ void pdb_dpm_get_sink_capability(union pd_msg *cap)
125 125
             | PD_PDO_SNK_FIXED_VOLTAGE_SET(cfg->v)
126 126
             | PD_PDO_SNK_FIXED_CURRENT_SET(cfg->i);
127 127
         /* If we want more than 5 V, set the Higher Capability flag */
128
-        if (cfg->v != 100) {
128
+        if (cfg->v != PD_MV2PDV(5000)) {
129 129
             cap->obj[0] |= PD_PDO_SNK_FIXED_HIGHER_CAP;
130 130
         }
131 131
     }
@@ -164,7 +164,7 @@ bool pdb_dpm_evaluate_typec_current(void)
164 164
 
165 165
     /* If we have no configuration or don't want 5 V, Type-C Current can't
166 166
      * possibly satisfy our needs */
167
-    if (cfg == NULL || cfg->v != 100) {
167
+    if (cfg == NULL || cfg->v != PD_MV2PDV(5000)) {
168 168
         return false;
169 169
     }
170 170
 

Laden…
Abbrechen
Speichern