Compare commits

...
3 Commits
Author SHA1 Message Date
ManuelW77 8f4c67eb46 docs: update platformio.ini for version v3.4.10 2026-10-03 11:55:06 +02:00
ManuelW cb3d3952b0 Merge pull request #30 from anderl1969/fix/main-loop-indentation
style: fix indentation in main loop
2026-10-03 11:54:16 +02:00
anderl1969 3662422c1c style: fix indentation in main loop 2026-09-30 16:23:45 +02:00
2 changed files with 38 additions and 38 deletions

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html
[common]
version = "3.4.9"
version = "3.4.10"
to_old_version = "3.4.0"
[env:esp32dev]
+37 -37
View File
@@ -234,51 +234,51 @@ void loop() {
weightSend = 0;
}
lastWeight = weight;
lastWeight = weight;
// Wenn ein Tag erkannt wurde und das Gewicht stabil ist (4+ seconds), an FilaMan senden
if (!scanRequestActive && weightCounterToApi > 3 && weightSend == 0 && nfcReaderState == NFC_READ_SUCCESS && tagProcessed == false)
{
tagProcessed = true;
// Wenn ein Tag erkannt wurde und das Gewicht stabil ist (4+ seconds), an FilaMan senden
if (!scanRequestActive && weightCounterToApi > 3 && weightSend == 0 && nfcReaderState == NFC_READ_SUCCESS && tagProcessed == false)
{
tagProcessed = true;
// Check if it's a Bambu tag - if so, send only UUID without spoolId
if (isBambuTag) {
sendWeightAsync(0, activeTagUuid, weight);
Serial.println("Bambu weight queued for FilaMan (UUID only)");
} else {
// Normal NTAG: send spoolId + UUID
int sId = activeSpoolId.toInt();
sendWeightAsync(sId, activeTagUuid, weight);
Serial.println("Weight queued for FilaMan");
}
weightSend = 1;
// Feedback to user
oledShowProgressBar(3, 4, tr(STR_SPOOL_TAG), tr(STR_SENDING));
oledSetPriority(DISPLAY_PRIORITY_ACTION, 2000);
}
// Handle successful tag write
if (!scanRequestActive && nfcReaderState == NFC_WRITE_SUCCESS && tagProcessed == false)
{
tagProcessed = true;
// Only send weight if a valid spoolId exists (spool tag, not location tag)
if (activeSpoolId.length() > 0 && activeSpoolId != "0") {
int sId = activeSpoolId.toInt();
sendWeightAsync(sId, activeTagUuid, weight);
// Check if it's a Bambu tag - if so, send only UUID without spoolId
if (isBambuTag) {
sendWeightAsync(0, activeTagUuid, weight);
Serial.println("Bambu weight queued for FilaMan (UUID only)");
} else {
// Normal NTAG: send spoolId + UUID
int sId = activeSpoolId.toInt();
sendWeightAsync(sId, activeTagUuid, weight);
Serial.println("Weight queued for FilaMan");
}
weightSend = 1;
Serial.println("Weight queued for FilaMan after spool tag write");
// Feedback to user
oledShowProgressBar(3, 4, tr(STR_TAG_WRITTEN), tr(STR_SENDING));
oledShowProgressBar(3, 4, tr(STR_SPOOL_TAG), tr(STR_SENDING));
oledSetPriority(DISPLAY_PRIORITY_ACTION, 2000);
} else {
// Location tag written - no weight to send
Serial.println("Location tag written successfully - no weight send needed");
}
// Handle successful tag write
if (!scanRequestActive && nfcReaderState == NFC_WRITE_SUCCESS && tagProcessed == false)
{
tagProcessed = true;
// Only send weight if a valid spoolId exists (spool tag, not location tag)
if (activeSpoolId.length() > 0 && activeSpoolId != "0") {
int sId = activeSpoolId.toInt();
sendWeightAsync(sId, activeTagUuid, weight);
weightSend = 1;
Serial.println("Weight queued for FilaMan after spool tag write");
// Feedback to user
oledShowProgressBar(3, 4, tr(STR_TAG_WRITTEN), tr(STR_SENDING));
oledSetPriority(DISPLAY_PRIORITY_ACTION, 2000);
} else {
// Location tag written - no weight to send
Serial.println("Location tag written successfully - no weight send needed");
}
}
}
}
}
esp_task_wdt_reset();
}