Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Crippa committed Apr 27, 2024
1 parent 34f1f7b commit 3988a3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
19 changes: 5 additions & 14 deletions src/miner/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,11 @@ void miner(uint32_t core)
uint32_t winning_nonce = 0;
uint8_t hash[SHA256M_BLOCK_SIZE];

uint32_t antilock = 5;

while (1)
while (current_job_is_valid)
{
if (current_job_is_valid == 0)
{
l_error(TAG_MINER, "[%d] > No valid job", core);
return;
}

#if defined(ESP8266)
ESP.wdtFeed();
#endif // ESP8266

#endif
current_increment_hashes();

if (!current_job->pickaxe(core, hash, winning_nonce))
Expand Down Expand Up @@ -66,10 +57,10 @@ void miner(uint32_t core)
void mineTaskFunction(void *pvParameters)
{
uint32_t core = (uint32_t)pvParameters;
while (1)
while (current_job_is_valid)
{
miner(core);
vTaskDelay(33 / portTICK_PERIOD_MS);
vTaskDelay(33 / portTICK_PERIOD_MS); // Add a small delay to prevent tight loop
}
}
#endif
#endif
2 changes: 1 addition & 1 deletion src/network/autoupdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void autoupdate()
{
l_debug(TAG_AUTOUPDATE, "Begin Update");
size_t written = Update.writeStream(http.getStream());
if (written == http.getSize())
if (written == static_cast<size_t>(http.getSize()))
{
l_debug(TAG_AUTOUPDATE, "Written: %d", written);
if (Update.end())
Expand Down

0 comments on commit 3988a3f

Please sign in to comment.