LacunaSpace / basicmac

BasicMAC LoRaWAN stack that supports (but is not limited to) Arduino
Other
76 stars 18 forks source link

MAX_CLOCK_ERROR not defined #23

Open jpmeijers opened 3 years ago

jpmeijers commented 3 years ago

Using the Arduino basicmac-otaa example, if I enable line 225, which reads as follows: LMIC_setClockError(MAX_CLOCK_ERROR * 10 / 100);

I get the following error:

/tmp/arduino_modified_sketch_358454/basicmac-otaa.ino: In function 'void setup()':
basicmac-otaa:225:24: error: 'MAX_CLOCK_ERROR' was not declared in this scope
     LMIC_setClockError(MAX_CLOCK_ERROR * 10 / 100);
                        ^~~~~~~~~~~~~~~
basicmac-otaa:225:5: error: 'LMIC_setClockError' was not declared in this scope
     LMIC_setClockError(MAX_CLOCK_ERROR * 10 / 100);
     ^~~~~~~~~~~~~~~~~~
/tmp/arduino_modified_sketch_358454/basicmac-otaa.ino:225:5: note: suggested alternative: 'LMIC_setClassC'
     LMIC_setClockError(MAX_CLOCK_ERROR * 10 / 100);
     ^~~~~~~~~~~~~~~~~~
     LMIC_setClassC
Using library BasicMAC at version 2.2.1 in folder: /home/jpmeijers/Arduino/libraries/BasicMAC 
Using library SPI at version 1.0 in folder: /home/jpmeijers/.arduino15/packages/MightyCore/hardware/avr/2.0.5/libraries/SPI 
exit status 1
'MAX_CLOCK_ERROR' was not declared in this scope
matthijskooijman commented 3 years ago

I haven't ported over the clock error code from LMIC yet, but it seems I did leave in this part of the example (commented out, though). I'm not sure whether I should be porting this code over, it's quite rough and as the MCCI folks pointed out, in a lot of cases it was used to work around timing problems in the LMIC code, rather than actual clock inaccuracies (timing problems that I hope are fixed in BasicMAC also, but I haven't really checked)...