Add CLOCK_ERROR option to enable/disable feature (#4)

This commit is contained in:
Kyle Gabriel 2019-08-28 20:10:32 -04:00
parent d0ece33e8e
commit c7e014fb38
2 changed files with 8 additions and 1 deletions

View File

@ -50,6 +50,10 @@ void ttn_register(void (*callback)(uint8_t message));
// If using a single-channel gateway, uncomment this next option and set to your gateway's channel
//#define SINGLE_CHANNEL_GATEWAY 0
// If you are having difficulty sending messages to TTN after the first successful send,
// uncomment the next option and experiment with values (~ 1 - 5)
//#define CLOCK_ERROR 5
#define DEBUG_PORT Serial // Serial debug port
#define SERIAL_BAUD 115200 // Serial debug baud rate
#define SLEEP_BETWEEN_MESSAGES 0 // Do sleep between messages

View File

@ -143,7 +143,10 @@ bool ttn_setup() {
void ttn_join() {
// Reset the MAC state. Session and pending data transfers will be discarded.
LMIC_reset();
LMIC_setClockError(MAX_CLOCK_ERROR * 5 / 100);
#ifdef CLOCK_ERROR
LMIC_setClockError(MAX_CLOCK_ERROR * CLOCK_ERROR / 100);
#endif
#if defined(USE_ABP)