1
0
forked from me/IronOS

Remove unused variables in PD stack

This commit is contained in:
Ben V. Brown
2021-06-04 21:04:55 +10:00
parent 14c2ea37ce
commit 27c7166922
3 changed files with 2 additions and 8 deletions

View File

@@ -25,11 +25,9 @@ bool PolicyEngine::pdNegotiationComplete;
int PolicyEngine::current_voltage_mv;
int PolicyEngine::_requested_voltage;
bool PolicyEngine::_unconstrained_power;
union pd_msg PolicyEngine::currentMessage;
uint16_t PolicyEngine::hdr_template;
bool PolicyEngine::_explicit_contract;
int8_t PolicyEngine::_hard_reset_counter;
int8_t PolicyEngine::_old_tcc_match;
uint8_t PolicyEngine::_pps_index;
osThreadId PolicyEngine::TaskHandle = NULL;
uint32_t PolicyEngine::TaskBuffer[PolicyEngine::TaskStackSize];
@@ -45,6 +43,7 @@ StaticEventGroup_t PolicyEngine::xCreatedEventGroup;
bool PolicyEngine::PPSTimerEnabled = false;
TickType_t PolicyEngine::PPSTimeLastEvent = 0;
uint8_t PolicyEngine::_tx_messageidcounter = 0;
void PolicyEngine::init() {
messagesWaiting = xQueueCreateStatic(PDB_MSG_POOL_SIZE, sizeof(union pd_msg), ucQueueStorageArea, &xStaticQueue);
// Create static thread at PDB_PRIO_PE priority
@@ -65,7 +64,6 @@ void PolicyEngine::pe_task(const void *arg) {
// Internal thread loop
hdr_template = PD_DATAROLE_UFP | PD_POWERROLE_SINK;
/* Initialize the old_tcc_match */
_old_tcc_match = -1;
/* Initialize the pps_index */
_pps_index = 0xFF;

View File

@@ -76,16 +76,12 @@ private:
static int current_voltage_mv; // The current voltage PD is expecting
static int _requested_voltage; // The voltage the unit wanted to requests
static bool _unconstrained_power; // If the source is unconstrained
// Current message being handled
static union pd_msg currentMessage;
/* PD message header template */
static uint16_t hdr_template;
/* Whether or not we have an explicit contract */
static bool _explicit_contract;
/* The number of hard resets we've sent */
static int8_t _hard_reset_counter;
/* The result of the last Type-C Current match comparison */
static int8_t _old_tcc_match;
/* The index of the first PPS APDO */
static uint8_t _pps_index;

0
source/build.sh Normal file → Executable file
View File