mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-09-18 11:28:04 +02:00
Fix mistakes
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
#include "driver/adc.h"
|
||||
#include "esp_adc/adc_oneshot.h"
|
||||
#include "freertos/semphr.h"
|
||||
#ifndef Power_h
|
||||
#define Power_h
|
||||
#ifndef PowerManager_h
|
||||
#define PowerManager_h
|
||||
|
||||
#define TAG "Power"
|
||||
|
||||
@@ -47,7 +47,7 @@ private:
|
||||
xSemaphoreGive(mutex);
|
||||
}
|
||||
}
|
||||
bool isLocked() { return locked; }
|
||||
bool isLocked() const { return locked; }
|
||||
};
|
||||
|
||||
protected:
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
/// @return whether the current could be successfully allocated
|
||||
static bool
|
||||
tryAccquireCurrentAllowance(PowerParameters::PowerConsumers consumer,
|
||||
uint16_t neededcurrent,
|
||||
uint16_t neededCurrent,
|
||||
uint16_t requestedDurationMs = 0);
|
||||
/// @brief "Return" the current currently allocated to a consumer
|
||||
/// @param consumer the active consumer to release the current for
|
||||
|
@@ -304,9 +304,8 @@ float PowerScheduler::getConsumerCurrent(
|
||||
return currentSum;
|
||||
}
|
||||
|
||||
PowerScheduler::PowerScheduler(float i_limit_ma, float i_max_ma) {
|
||||
this->limitCurrent = i_limit_ma;
|
||||
this->maximumCurrent = i_max_ma;
|
||||
PowerScheduler::PowerScheduler(float i_limit_ma, float i_max_ma)
|
||||
: freeLimitCurrentBudget(i_limit_ma), freeMaximumCurrentBudget(i_max_ma) {
|
||||
this->currentAllowances = std::vector<CurrentAllowance>();
|
||||
this->powerSchedulerMutex = xSemaphoreCreateMutex();
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@ public:
|
||||
/// account, so requesting the same or less power will always succeed. Also,
|
||||
/// small amounts of power (below 1 mA) will always be granted.
|
||||
bool tryAccquireCurrentAllowance(PowerParameters::PowerConsumers consumer,
|
||||
float neededcurrent,
|
||||
float neededCurrent,
|
||||
uint16_t requestedDurationMs = 0);
|
||||
/// @brief "Return" the current currently allocated to a consumer
|
||||
/// @param consumer the active consumer to release the current for
|
||||
|
Reference in New Issue
Block a user