|
@@ -28,6 +28,9 @@
|
28
|
28
|
#include "fusb302b.h"
|
29
|
29
|
|
30
|
30
|
|
|
31
|
+bool pdb_dpm_led_pd_status = true;
|
|
32
|
+
|
|
33
|
+
|
31
|
34
|
/* The current draw when the output is disabled */
|
32
|
35
|
#define DPM_MIN_CURRENT PD_MA2PDI(100)
|
33
|
36
|
|
|
@@ -48,7 +51,9 @@ bool pdb_dpm_evaluate_capability(const union pd_msg *capabilities, union pd_msg
|
48
|
51
|
uint8_t numobj = PD_NUMOBJ_GET(capabilities);
|
49
|
52
|
|
50
|
53
|
/* Make the LED blink to indicate ongoing power negotiations */
|
51
|
|
- chEvtSignal(pdb_led_thread, PDB_EVT_LED_NEGOTIATING);
|
|
54
|
+ if (pdb_dpm_led_pd_status) {
|
|
55
|
+ chEvtSignal(pdb_led_thread, PDB_EVT_LED_NEGOTIATING);
|
|
56
|
+ }
|
52
|
57
|
|
53
|
58
|
/* Get whether or not the power supply is constrained */
|
54
|
59
|
dpm_unconstrained_power = capabilities->obj[0] & PD_PDO_SRC_FIXED_UNCONSTRAINED;
|
|
@@ -189,7 +194,9 @@ bool pdb_dpm_evaluate_typec_current(void)
|
189
|
194
|
|
190
|
195
|
void pdb_dpm_pd_start(void)
|
191
|
196
|
{
|
192
|
|
- chEvtSignal(pdb_led_thread, PDB_EVT_LED_NEGOTIATING);
|
|
197
|
+ if (pdb_dpm_led_pd_status) {
|
|
198
|
+ chEvtSignal(pdb_led_thread, PDB_EVT_LED_NEGOTIATING);
|
|
199
|
+ }
|
193
|
200
|
}
|
194
|
201
|
|
195
|
202
|
void pdb_dpm_sink_standby(void)
|
|
@@ -211,11 +218,15 @@ void pdb_dpm_output_set(bool state)
|
211
|
218
|
/* Set the power output */
|
212
|
219
|
if (state) {
|
213
|
220
|
/* Turn the output on */
|
214
|
|
- chEvtSignal(pdb_led_thread, PDB_EVT_LED_OUTPUT_ON);
|
|
221
|
+ if (pdb_dpm_led_pd_status) {
|
|
222
|
+ chEvtSignal(pdb_led_thread, PDB_EVT_LED_OUTPUT_ON);
|
|
223
|
+ }
|
215
|
224
|
palSetLine(LINE_OUT_CTRL);
|
216
|
225
|
} else {
|
217
|
226
|
/* Turn the output off */
|
218
|
|
- chEvtSignal(pdb_led_thread, PDB_EVT_LED_OUTPUT_OFF);
|
|
227
|
+ if (pdb_dpm_led_pd_status) {
|
|
228
|
+ chEvtSignal(pdb_led_thread, PDB_EVT_LED_OUTPUT_OFF);
|
|
229
|
+ }
|
219
|
230
|
palClearLine(LINE_OUT_CTRL);
|
220
|
231
|
}
|
221
|
232
|
}
|