Browse Source

Rename enum fusb_typec_current values

Their names were a bit too greedy for the global namespace, so I
changed them to start with fusb_tcc_.
Clara Hobbs 7 years ago
parent
commit
7f5ce831ac
4 changed files with 11 additions and 11 deletions
  1. 4
    4
      lib/include/fusb302b.h
  2. 2
    2
      src/device_policy_manager.c
  3. 1
    1
      src/main.c
  4. 4
    4
      src/shell.c

+ 4
- 4
lib/include/fusb302b.h View File

@@ -271,10 +271,10 @@ union fusb_status {
271 271
  * FUSB Type-C Current level enum
272 272
  */
273 273
 enum fusb_typec_current {
274
-    None = 0,
275
-    Default = 1,
276
-    OnePointFiveAmps = 2,
277
-    ThreePointZeroAmps = 3
274
+    fusb_tcc_none = 0,
275
+    fusb_tcc_default = 1,
276
+    fusb_tcc_1_5 = 2,
277
+    fusb_tcc_3_0 = 3
278 278
 };
279 279
 
280 280
 

+ 2
- 2
src/device_policy_manager.c View File

@@ -198,12 +198,12 @@ bool pdbs_dpm_evaluate_typec_current(struct pdb_config *cfg,
198 198
     }
199 199
 
200 200
     /* If 1.5 A is available and we want no more than that, great. */
201
-    if (tcc == OnePointFiveAmps && scfg->i <= 150) {
201
+    if (tcc == fusb_tcc_1_5 && scfg->i <= 150) {
202 202
         dpm_data->_capability_match = true;
203 203
         return true;
204 204
     }
205 205
     /* If 3 A is available and we want no more than that, that's great too. */
206
-    if (tcc == ThreePointZeroAmps && scfg->i <= 300) {
206
+    if (tcc == fusb_tcc_3_0 && scfg->i <= 300) {
207 207
         dpm_data->_capability_match = true;
208 208
         return true;
209 209
     }

+ 1
- 1
src/main.c View File

@@ -59,7 +59,7 @@ static const I2CConfig i2c2config = {
59 59
  */
60 60
 static struct pdbs_dpm_data dpm_data = {
61 61
     NULL,
62
-    None,
62
+    fusb_tcc_none,
63 63
     true,
64 64
     true,
65 65
     false,

+ 4
- 4
src/shell.c View File

@@ -358,14 +358,14 @@ static void cmd_get_source_cap(BaseSequentialStream *chp, int argc, char *argv[]
358 358
     /* If we haven't seen any Source_Capabilities */
359 359
     if (pdbs_dpm_data->capabilities == NULL) {
360 360
         /* Have we started reading Type-C Current advertisements? */
361
-        if (pdbs_dpm_data->typec_current != None) {
361
+        if (pdbs_dpm_data->typec_current != fusb_tcc_none) {
362 362
             /* Type-C Current is available, so report it */
363 363
             chprintf(chp, "PDO 1: typec_virtual\r\n");
364
-            if (pdbs_dpm_data->typec_current == Default) {
364
+            if (pdbs_dpm_data->typec_current == fusb_tcc_default) {
365 365
                 chprintf(chp, "\ti: 0.50 A\r\n");
366
-            } else if (pdbs_dpm_data->typec_current == OnePointFiveAmps) {
366
+            } else if (pdbs_dpm_data->typec_current == fusb_tcc_1_5) {
367 367
                 chprintf(chp, "\ti: 1.50 A\r\n");
368
-            } else if (pdbs_dpm_data->typec_current == ThreePointZeroAmps) {
368
+            } else if (pdbs_dpm_data->typec_current == fusb_tcc_3_0) {
369 369
                 chprintf(chp, "\ti: 3.00 A\r\n");
370 370
             }
371 371
             return;

Loading…
Cancel
Save