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
  * FUSB Type-C Current level enum
271
  * FUSB Type-C Current level enum
272
  */
272
  */
273
 enum fusb_typec_current {
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
     }
198
     }
199
 
199
 
200
     /* If 1.5 A is available and we want no more than that, great. */
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
         dpm_data->_capability_match = true;
202
         dpm_data->_capability_match = true;
203
         return true;
203
         return true;
204
     }
204
     }
205
     /* If 3 A is available and we want no more than that, that's great too. */
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
         dpm_data->_capability_match = true;
207
         dpm_data->_capability_match = true;
208
         return true;
208
         return true;
209
     }
209
     }

+ 1
- 1
src/main.c View File

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

+ 4
- 4
src/shell.c View File

358
     /* If we haven't seen any Source_Capabilities */
358
     /* If we haven't seen any Source_Capabilities */
359
     if (pdbs_dpm_data->capabilities == NULL) {
359
     if (pdbs_dpm_data->capabilities == NULL) {
360
         /* Have we started reading Type-C Current advertisements? */
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
             /* Type-C Current is available, so report it */
362
             /* Type-C Current is available, so report it */
363
             chprintf(chp, "PDO 1: typec_virtual\r\n");
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
                 chprintf(chp, "\ti: 0.50 A\r\n");
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
                 chprintf(chp, "\ti: 1.50 A\r\n");
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
                 chprintf(chp, "\ti: 3.00 A\r\n");
369
                 chprintf(chp, "\ti: 3.00 A\r\n");
370
             }
370
             }
371
             return;
371
             return;

Loading…
Cancel
Save