Add 868MHz envs, fix MAC id, offset timesync

This commit is contained in:
2026-01-21 21:14:48 +01:00
parent 8c9520f7e5
commit 5f42575b10
6 changed files with 46 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ static uint32_t g_last_test_ms = 0;
static uint16_t g_test_code_counter = 1000;
static uint32_t g_last_timesync_ms = 0;
static constexpr uint32_t TEST_SEND_INTERVAL_MS = 30000;
static constexpr uint32_t TEST_TIMESYNC_OFFSET_MS = 15000;
void test_sender_loop(uint16_t short_id, const char *device_id) {
LoraPacket rx = {};
@@ -76,6 +77,9 @@ void test_sender_loop(uint16_t short_id, const char *device_id) {
}
void test_receiver_loop(SenderStatus *statuses, uint8_t count, uint16_t self_short_id) {
if (g_last_timesync_ms == 0) {
g_last_timesync_ms = millis() - (TIME_SYNC_INTERVAL_SEC * 1000UL - TEST_TIMESYNC_OFFSET_MS);
}
if (millis() - g_last_timesync_ms > TIME_SYNC_INTERVAL_SEC * 1000UL) {
g_last_timesync_ms = millis();
time_send_timesync(self_short_id);