Преглед на файлове

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

Clara Hobbs преди 7 години
родител
ревизия
13db7c7276
променени са 2 файла, в които са добавени 11 реда и са изтрити 2 реда
  1. 6
    0
      src/main.c
  2. 5
    2
      src/policy_engine.c

+ 6
- 0
src/main.c Целия файл

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

+ 5
- 2
src/policy_engine.c Целия файл

@@ -18,6 +18,8 @@
18 18
 
19 19
 #include "policy_engine.h"
20 20
 
21
+#include <stdbool.h>
22
+
21 23
 #include "messages.h"
22 24
 #include "priorities.h"
23 25
 #include "device_policy_manager.h"
@@ -364,9 +366,10 @@ static enum policy_engine_state pe_sink_hard_reset(void)
364 366
     /* If we've already sent the maximum number of hard resets, give up */
365 367
     if (hard_reset_counter > PD_N_HARD_RESET_COUNT) {
366 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 371
             chThdSleepMilliseconds(1000);
372
+        }
370 373
     }
371 374
 
372 375
     /* Generate a hard reset signal */

Loading…
Отказ
Запис