Add 868MHz envs, fix MAC id, offset timesync
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user