Browse Source

Documentation, for (;;) -> while (true)

Clara Hobbs 7 years ago
parent
commit
13db7c7276
2 changed files with 11 additions and 2 deletions
  1. 6
    0
      src/main.c
  2. 5
    2
      src/policy_engine.c

+ 6
- 0
src/main.c View File

61
     0
61
     0
62
 };
62
 };
63
 
63
 
64
+/*
65
+ * Enter setup mode
66
+ */
64
 static void setup(void)
67
 static void setup(void)
65
 {
68
 {
66
     chEvtSignal(pdb_led_thread, PDB_EVT_LED_SLOW_BLINK);
69
     chEvtSignal(pdb_led_thread, PDB_EVT_LED_SLOW_BLINK);
80
     pdb_shell();
83
     pdb_shell();
81
 }
84
 }
82
 
85
 
86
+/*
87
+ * Negotiate with the power supply for the configured power
88
+ */
83
 static void pd_buddy(void)
89
 static void pd_buddy(void)
84
 {
90
 {
85
     chEvtSignal(pdb_led_thread, PDB_EVT_LED_FAST_BLINK);
91
     chEvtSignal(pdb_led_thread, PDB_EVT_LED_FAST_BLINK);

+ 5
- 2
src/policy_engine.c View File

18
 
18
 
19
 #include "policy_engine.h"
19
 #include "policy_engine.h"
20
 
20
 
21
+#include <stdbool.h>
22
+
21
 #include "messages.h"
23
 #include "messages.h"
22
 #include "priorities.h"
24
 #include "priorities.h"
23
 #include "device_policy_manager.h"
25
 #include "device_policy_manager.h"
364
     /* If we've already sent the maximum number of hard resets, give up */
366
     /* If we've already sent the maximum number of hard resets, give up */
365
     if (hard_reset_counter > PD_N_HARD_RESET_COUNT) {
367
     if (hard_reset_counter > PD_N_HARD_RESET_COUNT) {
366
         pdb_dpm_output_off();
368
         pdb_dpm_output_off();
367
-        /* TODO: Fall back to USB BC or Type-C power if configured for 5 V. */
368
-        for (;;)
369
+        /* TODO: Fall back to Type-C Current if configured for 5 V. */
370
+        while (true) {
369
             chThdSleepMilliseconds(1000);
371
             chThdSleepMilliseconds(1000);
372
+        }
370
     }
373
     }
371
 
374
 
372
     /* Generate a hard reset signal */
375
     /* Generate a hard reset signal */

Loading…
Cancel
Save