Merge pull request #486 from cosmicpsyop/feature/add-platforms-to-worker-api

allow other platforms to call respective mining workers api
This commit is contained in:
BitMaker 2025-01-13 14:35:28 +01:00 committed by GitHub
commit 1125209315
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 5 deletions

View File

@ -32,4 +32,7 @@
#define SDSPI_MOSI 23
#define SDSPI_MISO 19
// calls api to retrieve worker metrics
#define SCREEN_WORKERS_ENABLE (1)
#endif

View File

@ -37,10 +37,15 @@
#define TOUCH_ENABLE (1)
#define SDMMC_1BIT_FIX (1)
#define SD_FREQUENCY (20000)
// calls api to retrieve worker metrics
#define SCREEN_WORKERS_ENABLE (1)
// retrieve current btc fees data
#define SCREEN_FEES_ENABLE (1)
#ifndef TFT_BL
// XXX - defined in User_Setups/Setup207_LilyGo_T_HMI.h:37
#define TFT_BL (38) // LED back-light
#endif
#endif

View File

@ -8,6 +8,7 @@
#include "utils.h"
#include "monitor.h"
#include "drivers/storage/storage.h"
#include "drivers/devices/device.h"
extern uint32_t templates;
extern uint32_t hashes;
@ -46,7 +47,7 @@ void setup_monitor(void){
timeClient.setTimeOffset(3600 * Settings.Timezone);
Serial.println("TimeClient setup done");
#ifdef NERDMINER_T_HMI
#ifdef SCREEN_WORKERS_ENABLE
poolAPIUrl = getPoolAPIUrl();
Serial.println("poolAPIUrl: " + poolAPIUrl);
#endif
@ -98,7 +99,7 @@ void updateGlobalData(void){
deserializeJson(doc, payload);
String temp = "";
if (doc.containsKey("halfHourFee")) gData.halfHourFee = doc["halfHourFee"].as<int>();
#ifdef NERDMINER_T_HMI
#ifdef SCREEN_FEES_ENABLE
if (doc.containsKey("fastestFee")) gData.fastestFee = doc["fastestFee"].as<int>();
if (doc.containsKey("hourFee")) gData.hourFee = doc["hourFee"].as<int>();
if (doc.containsKey("economyFee")) gData.economyFee = doc["economyFee"].as<int>();
@ -305,7 +306,7 @@ coin_data getCoinData(unsigned long mElapsed)
data.currentHashRate = getCurrentHashRate(mElapsed);
data.btcPrice = getBTCprice();
data.currentTime = getTime();
#ifdef NERDMINER_T_HMI
#ifdef SCREEN_FEES_ENABLE
data.hourFee = String(gData.hourFee);
data.fastestFee = String(gData.fastestFee);
data.economyFee = String(gData.economyFee);
@ -364,7 +365,7 @@ pool_data getPoolData(void){
String btcWallet = Settings.BtcWallet;
// Serial.println(btcWallet);
if (btcWallet.indexOf(".")>0) btcWallet = btcWallet.substring(0,btcWallet.indexOf("."));
#ifdef NERDMINER_T_HMI
#ifdef SCREEN_WORKERS_ENABLE
Serial.println("Pool API : " + poolAPIUrl+btcWallet);
http.begin(poolAPIUrl+btcWallet);
#else