Small hashrate increase

- Adjust delays on threads and add a delay on loop
- Move miner to core 1 with loop and omit 0 to let wifi work alone with stratum and monitor thread
This commit is contained in:
BitMaker 2023-06-08 10:21:16 +02:00
parent 744c3e7a59
commit 35d7bcd634
4 changed files with 10 additions and 8 deletions

Binary file not shown.

View File

@ -111,11 +111,11 @@ void setup()
Serial.println("Initiating tasks..."); Serial.println("Initiating tasks...");
char *name = (char*) malloc(32); char *name = (char*) malloc(32);
sprintf(name, "(%s)", "Monitor"); sprintf(name, "(%s)", "Monitor");
BaseType_t res1 = xTaskCreatePinnedToCore(runMonitor, "Monitor", 5000, (void*)name, 4, NULL,1); BaseType_t res1 = xTaskCreatePinnedToCore(runMonitor, "Monitor", 5000, (void*)name, 4, NULL,0);
/******** CREATE STRATUM TASK *****/ /******** CREATE STRATUM TASK *****/
sprintf(name, "(%s)", "Stratum"); sprintf(name, "(%s)", "Stratum");
BaseType_t res2 = xTaskCreatePinnedToCore(runStratumWorker, "Stratum", 20000, (void*)name, 3, NULL,1); BaseType_t res2 = xTaskCreatePinnedToCore(runStratumWorker, "Stratum", 20000, (void*)name, 3, NULL,0);
/******** CREATE MINER TASKS *****/ /******** CREATE MINER TASKS *****/
@ -126,9 +126,9 @@ void setup()
// Start stratum tasks // Start stratum tasks
sprintf(name, "(%s)", "Miner0"); sprintf(name, "(%s)", "Miner0");
//BaseType_t res = xTaskCreatePinnedToCore(runMiner, "0", 10000, (void*)name, 1, NULL, 0); //BaseType_t res = xTaskCreatePinnedToCore(runMiner, "0", 10000, (void*)name, 1, NULL, 0);
BaseType_t res3 = xTaskCreatePinnedToCore(runMiner, "0", 10000, (void*)name, 1,NULL, 0); BaseType_t res3 = xTaskCreatePinnedToCore(runMiner, "0", 10000, (void*)name, 1,NULL, 1);
//sprintf(name, "(%s)", "Miner1"); //sprintf(name, "(%s)", "Miner1");
//BaseType_t res4 = xTaskCreatePinnedToCore(runMiner, "1", 10000, (void*)name, 1,NULL, 1); //BaseType_t res4 = xTaskCreatePinnedToCore(runMiner, "1", 10000, (void*)name, 1,NULL, 0);
//Serial.printf("Starting %s %s!\n", "1", res3 == pdPASS? "successful":"failed"); //Serial.printf("Starting %s %s!\n", "1", res3 == pdPASS? "successful":"failed");
@ -155,4 +155,5 @@ void loop() {
wifiManagerProcess(); // avoid delays() in loop when non-blocking and other long running code wifiManagerProcess(); // avoid delays() in loop when non-blocking and other long running code
vTaskDelay(100 / portTICK_PERIOD_MS);
} }

View File

@ -132,8 +132,8 @@ void runStratumWorker(void *name) {
//portNumber = 3333; //portNumber = 3333;
//strcpy(btcString,"Bitmaker.01"); //strcpy(btcString,"Bitmaker.01");
//CKpool //CKpool
strcpy(poolString, "solo.ckpool.org"); //strcpy(poolString, "solo.ckpool.org");
portNumber = 3333; //portNumber = 3333;
//strcpy(btcString,"test"); //strcpy(btcString,"test");
checkPoolConnection(); checkPoolConnection();
@ -200,7 +200,7 @@ void runStratumWorker(void *name) {
} }
} }
vTaskDelay(200 / portTICK_PERIOD_MS); //Small delay vTaskDelay(500 / portTICK_PERIOD_MS); //Small delay
} }
@ -320,7 +320,7 @@ void runMonitor(void *name){
Serial.println("[MONITOR] started"); Serial.println("[MONITOR] started");
unsigned long mLastCheck = 0; unsigned long mLastCheck = 0;
mMonitor.screen = SCREEN_GLOBAL; mMonitor.screen = SCREEN_MINING;
while(1){ while(1){

View File

@ -24,6 +24,7 @@ typedef struct{
float poolDifficulty; float poolDifficulty;
bool inRun; bool inRun;
bool newJob; bool newJob;
bool newJob2;
}miner_data; }miner_data;