Increase watchdog timeout to 15 minutes

Also increase nonce range to 25M to keep miner busy for up to 10 minutes.
This commit is contained in:
Stefan Berger 2023-08-05 21:32:37 +02:00
parent e2c6c85767
commit 3314237927
3 changed files with 7 additions and 6 deletions

View File

@ -20,8 +20,8 @@
//3 seconds WDT //3 seconds WDT
#define WDT_TIMEOUT 3 #define WDT_TIMEOUT 3
//120 seconds WDT for miner task //15 minutes WDT for miner task
#define WDT_MINER_TIMEOUT 120 #define WDT_MINER_TIMEOUT 900
OneButton button1(PIN_BUTTON_1); OneButton button1(PIN_BUTTON_1);
OneButton button2(PIN_BUTTON_2); OneButton button2(PIN_BUTTON_2);

View File

@ -375,9 +375,9 @@ void runMiner(void * task_id) {
mMiner.inRun = false; mMiner.inRun = false;
Serial.print(">>> Finished job waiting new data from pool"); Serial.print(">>> Finished job waiting new data from pool");
if(hashes>=MAX_NONCE) { if(hashes>=MAX_NONCE_STEP) {
Mhashes=Mhashes+MAX_NONCE/1000000; Mhashes=Mhashes+MAX_NONCE_STEP/1000000;
hashes=hashes-MAX_NONCE; hashes=hashes-MAX_NONCE_STEP;
} }
uint32_t duration = micros() - startT; uint32_t duration = micros() - startT;

View File

@ -3,7 +3,8 @@
#define MINING_API_H #define MINING_API_H
// Mining // Mining
#define MAX_NONCE 5000000U #define MAX_NONCE_STEP 5000000U
#define MAX_NONCE 25000000U
#define TARGET_NONCE 471136297U #define TARGET_NONCE 471136297U
#define DEFAULT_DIFFICULTY 1e-4 #define DEFAULT_DIFFICULTY 1e-4
#define KEEPALIVE_TIME_ms 30000 #define KEEPALIVE_TIME_ms 30000