Skip to content

Commit 1125209

Browse files
authored
Merge pull request #486 from cosmicpsyop/feature/add-platforms-to-worker-api
allow other platforms to call respective mining workers api
2 parents 0422617 + 27b4f42 commit 1125209

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/drivers/devices/esp322432s028r.h

+3
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,7 @@
3232
#define SDSPI_MOSI 23
3333
#define SDSPI_MISO 19
3434

35+
// calls api to retrieve worker metrics
36+
#define SCREEN_WORKERS_ENABLE (1)
37+
3538
#endif

src/drivers/devices/lilygoT_HMI.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@
3737
#define TOUCH_ENABLE (1)
3838
#define SDMMC_1BIT_FIX (1)
3939
#define SD_FREQUENCY (20000)
40+
41+
// calls api to retrieve worker metrics
42+
#define SCREEN_WORKERS_ENABLE (1)
43+
// retrieve current btc fees data
44+
#define SCREEN_FEES_ENABLE (1)
45+
4046
#ifndef TFT_BL
4147
// XXX - defined in User_Setups/Setup207_LilyGo_T_HMI.h:37
4248
#define TFT_BL (38) // LED back-light
4349
#endif
4450

45-
4651
#endif

src/monitor.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "utils.h"
99
#include "monitor.h"
1010
#include "drivers/storage/storage.h"
11+
#include "drivers/devices/device.h"
1112

1213
extern uint32_t templates;
1314
extern uint32_t hashes;
@@ -46,7 +47,7 @@ void setup_monitor(void){
4647
timeClient.setTimeOffset(3600 * Settings.Timezone);
4748

4849
Serial.println("TimeClient setup done");
49-
#ifdef NERDMINER_T_HMI
50+
#ifdef SCREEN_WORKERS_ENABLE
5051
poolAPIUrl = getPoolAPIUrl();
5152
Serial.println("poolAPIUrl: " + poolAPIUrl);
5253
#endif
@@ -98,7 +99,7 @@ void updateGlobalData(void){
9899
deserializeJson(doc, payload);
99100
String temp = "";
100101
if (doc.containsKey("halfHourFee")) gData.halfHourFee = doc["halfHourFee"].as<int>();
101-
#ifdef NERDMINER_T_HMI
102+
#ifdef SCREEN_FEES_ENABLE
102103
if (doc.containsKey("fastestFee")) gData.fastestFee = doc["fastestFee"].as<int>();
103104
if (doc.containsKey("hourFee")) gData.hourFee = doc["hourFee"].as<int>();
104105
if (doc.containsKey("economyFee")) gData.economyFee = doc["economyFee"].as<int>();
@@ -305,7 +306,7 @@ coin_data getCoinData(unsigned long mElapsed)
305306
data.currentHashRate = getCurrentHashRate(mElapsed);
306307
data.btcPrice = getBTCprice();
307308
data.currentTime = getTime();
308-
#ifdef NERDMINER_T_HMI
309+
#ifdef SCREEN_FEES_ENABLE
309310
data.hourFee = String(gData.hourFee);
310311
data.fastestFee = String(gData.fastestFee);
311312
data.economyFee = String(gData.economyFee);
@@ -364,7 +365,7 @@ pool_data getPoolData(void){
364365
String btcWallet = Settings.BtcWallet;
365366
// Serial.println(btcWallet);
366367
if (btcWallet.indexOf(".")>0) btcWallet = btcWallet.substring(0,btcWallet.indexOf("."));
367-
#ifdef NERDMINER_T_HMI
368+
#ifdef SCREEN_WORKERS_ENABLE
368369
Serial.println("Pool API : " + poolAPIUrl+btcWallet);
369370
http.begin(poolAPIUrl+btcWallet);
370371
#else

0 commit comments

Comments
 (0)