mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Cache FUSB polls
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
#include "int_n.h"
|
#include "int_n.h"
|
||||||
#include "policy_engine.h"
|
#include "policy_engine.h"
|
||||||
bool FUSB302_present = false;
|
bool FUSB302_present = false;
|
||||||
|
bool FUSB302_probed = false;
|
||||||
|
|
||||||
void power_check() {
|
void power_check() {
|
||||||
#ifdef POW_PD
|
#ifdef POW_PD
|
||||||
@@ -28,7 +29,12 @@ void power_check() {
|
|||||||
}
|
}
|
||||||
uint8_t usb_pd_detect() {
|
uint8_t usb_pd_detect() {
|
||||||
#ifdef POW_PD
|
#ifdef POW_PD
|
||||||
FUSB302_present = fusb302_detect();
|
if (FUSB302_probed) {
|
||||||
|
return FUSB302_present;
|
||||||
|
} else {
|
||||||
|
FUSB302_present = fusb302_detect();
|
||||||
|
FUSB302_probed = true;
|
||||||
|
}
|
||||||
return FUSB302_present;
|
return FUSB302_present;
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "int_n.h"
|
#include "int_n.h"
|
||||||
#include "policy_engine.h"
|
#include "policy_engine.h"
|
||||||
bool FUSB302_present = false;
|
bool FUSB302_present = false;
|
||||||
|
bool FUSB302_probed = false;
|
||||||
|
|
||||||
void power_check() {
|
void power_check() {
|
||||||
#ifdef POW_PD
|
#ifdef POW_PD
|
||||||
@@ -28,8 +29,12 @@ void power_check() {
|
|||||||
}
|
}
|
||||||
uint8_t usb_pd_detect() {
|
uint8_t usb_pd_detect() {
|
||||||
#ifdef POW_PD
|
#ifdef POW_PD
|
||||||
FUSB302_present = fusb302_detect();
|
if (FUSB302_probed) {
|
||||||
|
return FUSB302_present;
|
||||||
|
} else {
|
||||||
|
FUSB302_present = fusb302_detect();
|
||||||
|
FUSB302_probed = true;
|
||||||
|
}
|
||||||
return FUSB302_present;
|
return FUSB302_present;
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user