forked from btclock/btclock_v3
Refactor BitAxeFetch to a class
This commit is contained in:
parent
fa15e46d34
commit
c91428dd5f
5 changed files with 50 additions and 44 deletions
|
@ -7,10 +7,28 @@
|
|||
#include "lib/config.hpp"
|
||||
#include "lib/shared.hpp"
|
||||
|
||||
extern TaskHandle_t bitaxeFetchTaskHandle;
|
||||
class BitAxeFetch {
|
||||
public:
|
||||
static BitAxeFetch& getInstance() {
|
||||
static BitAxeFetch instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
void setupBitaxeFetchTask();
|
||||
void taskBitaxeFetch(void *pvParameters);
|
||||
void setup();
|
||||
uint64_t getHashRate() const;
|
||||
uint64_t getBestDiff() const;
|
||||
static void taskWrapper(void* pvParameters);
|
||||
TaskHandle_t getTaskHandle() const { return taskHandle; }
|
||||
|
||||
uint64_t getBitAxeHashRate();
|
||||
uint64_t getBitaxeBestDiff();
|
||||
private:
|
||||
BitAxeFetch() = default;
|
||||
~BitAxeFetch() = default;
|
||||
BitAxeFetch(const BitAxeFetch&) = delete;
|
||||
BitAxeFetch& operator=(const BitAxeFetch&) = delete;
|
||||
|
||||
void task();
|
||||
|
||||
TaskHandle_t taskHandle = nullptr;
|
||||
uint64_t hashrate = 0;
|
||||
uint64_t bestDiff = 0;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue