This commit is contained in:
2026-01-13 01:14:51 +01:00
parent eed612f457
commit 6a48dcd61e
10 changed files with 163 additions and 52 deletions

View File

@@ -14,7 +14,7 @@
uint8_t PacketParams[6];
char txActive;
int txLost = 0;
static char debugPrint;
char debugPrint;
// Arduino compatible macros
#define delayMicroseconds(us) esp_rom_delay_us (us)
@@ -25,6 +25,7 @@ void LoRaError (int error) {
MESH_LOGE (TAG, "LoRaErrorDefault=%d", error);
}
while (1) {
printf("GONE WRONG\n");
vTaskDelay (1);
}
}
@@ -706,11 +707,18 @@ void SetTx (uint32_t timeoutInMs) {
buf[2] = (uint8_t)(tout & 0xFF);
WriteCommand (SX126X_CMD_SET_TX, buf, 3); // 0x83
for (int retry = 0; retry < 10; retry++) {
if (debugPrint) {
MESH_LOGD(TAG, "Written command, retrying");
}
for (int retry = 0; retry < 20; retry++) {
if ((GetStatus() & 0x70) == 0x60)
break;
vTaskDelay (1);
}
if (debugPrint) {
MESH_LOGI(TAG, "Broke out");
}
if ((GetStatus() & 0x70) != 0x60) {
MESH_LOGE (TAG, "SetTx Illegal Status");
LoRaError (ERR_INVALID_SETTX_STATE);