Skip to content

Commit

Permalink
Previous improvements
Browse files Browse the repository at this point in the history
- Checking correctly JSON file before using it
- Disable DFU Uart cause gives problems when don't read incoming port data.
  • Loading branch information
BitMaker-hub committed Apr 17, 2023
1 parent e88a857 commit 472894d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
14 changes: 14 additions & 0 deletions GenerateXMLDPI.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"folders": [
{
"path": "../../../../../../../Documents/Proyectos/Electrotec/DISPLAYS/SERIES/SERIE DP/SOFTWARE DE TESTEO/PythonScripts/GenerateXMLDPI"
},
{
"name": "NerdMinerV2",
"path": "."
}
],
"settings": {
"platformio-ide.useDevelopmentPIOCore": true
}
}
6 changes: 6 additions & 0 deletions huge_app.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x300000,
spiffs, data, spiffs, 0x310000,0xE0000,
coredump, data, coredump,0x3F0000,0x10000,
7 changes: 4 additions & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ upload_speed = 921600

# 2 x 4.5MB app, 6.875MB SPIFFS
;board_build.partitions = large_spiffs_16MB.csv
board_build.partitions = default_8MB.csv
;board_build.partitions = default_8MB.csv
board_build.partitions = huge_app.csv
;board_build.partitions = default.csv

build_flags =
-D LV_LVGL_H_INCLUDE_SIMPLE
-D BOARD_HAS_PSRAM
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
;-D ARDUINO_USB_MODE=1
;-D ARDUINO_USB_CDC_ON_BOOT=1
-D DEBUG_MINING=1
lib_deps =
https://github.com/takkaO/OpenFontRender
Expand Down
15 changes: 11 additions & 4 deletions src/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ void runWorker(void *name) {

Serial.println("");
Serial.printf("\n[WORKER] Started. Running %s on core %d\n", (char *)name, xPortGetCoreID());
;Serial.printf("### [Total Heap / Free heap]: %d / %d \n", ESP.getHeapSize(), ESP.getFreeHeap());

String ADDRESS = String(btcString);

Expand Down Expand Up @@ -161,10 +162,7 @@ void runWorker(void *name) {
Serial.print(" error: "); Serial.println(error);
if((extranonce1.length() == 0) || line.length() == 0 || (error != 0)) {
Serial.printf("[WORKER] %s >>>>>>>>> Work aborted\n", (char *)name);
Serial.printf("extranonce1 length: %u | line2 length: %u | error code: %u \n",
extranonce1.length(),
line.length(),
error);
Serial.printf("extranonce1 length: %u | line2 length: %u | error code: %u \n", extranonce1.length(), line.length(), error);
client.stop();
doc.clear();
doc.garbageCollect();
Expand Down Expand Up @@ -204,6 +202,15 @@ void runWorker(void *name) {
Serial.print(" ntime: "); Serial.println(ntime);
Serial.print(" clean_jobs: "); Serial.println(clean_jobs);
#endif
//Check if parameters where correctly received
if((job_id.length() == 0)||(prevhash.length() == 0)||(coinb2.length() == 0)||(ntime.length() == 0)) {
Serial.println(">>>>>>>>> Worker aborted");
client.stop();
doc.clear();
doc.garbageCollect();
continue;
}

doc.clear();
templates++;

Expand Down

0 comments on commit 472894d

Please sign in to comment.