Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Lacuna Basic MAC #11

Draft
wants to merge 141 commits into
base: master
Choose a base branch
from
Draft

Merge Lacuna Basic MAC #11

wants to merge 141 commits into from

Commits on Apr 15, 2020

  1. Arduino: Add Arduino-specific files

    This adds an implementation of the LMIC HAL, plus some files needed for
    the Arduino library format and some examples.
    
    In addition, an export.sh script is added that can be used to generate
    an Arduino library from this repository. This script only reorders
    files, it does not change anything. When given the --link option, it
    creates symlinks instead of copies, allowing to test things in the
    Arduino IDE easily, while committing the original files in this
    repository.
    
    The HAL, examples and library.properties files are taken from the
    https://github.com/matthijskooijman/arduino-lmic repository, revision
    90bc049 (Print downlink ack status in ttn-otaa example too). Only the
    configuration mechanism was changed slightly.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    5556c1d View commit details
    Browse the repository at this point in the history
  2. Arduino: Make export script work on OSX

    Previously, this used GNU-specific cp options, which are not available
    on OSX.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    c722c99 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5d96aaa View commit details
    Browse the repository at this point in the history
  4. Arduino: Simplify examples

    This stops using the osjob scheduling from lmic for scheduling
    transmissions, since this is a bit tricky to integrate with existing
    code, and users now often think that using it is mandatory. By removing
    it, and replacing it by simple time-based checks for scheduling
    transmissions, it should be more clear how this works.
    
    Also, remove some code specific to the Pinoccio board.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    3b8bc60 View commit details
    Browse the repository at this point in the history
  5. Arduino: Adapt Arduino code to basicmac

    Examples are untouched, those will be updated separately.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    3ccfb5b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1505722 View commit details
    Browse the repository at this point in the history
  7. Move DECL_ON_LMIC_EVENT from lmic.c to lmic.h

    This declares the onLmicEvent() callback function that must be defined by an
    application. Previously, the application was expected to define this
    itself, and a reference to it was declared in lmic.c.
    
    By moving the declaration into lmic.h, this prevents problems when an
    application uses a different function signature for the function, or
    when defining the callback in a C++ file (since lmic.h uses extern "C",
    the compiler now knows to generate a C-style function rather than C++).
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    d747876 View commit details
    Browse the repository at this point in the history
  8. Fix AES encryption on 16-bit platforms

    The AES_S array contains 16-bit integers, which are shifted upwards
    during processing. On platforms where int is 32-bit or wider, these
    integers are integer-promoted to 32-bit before shifting, making them
    work as expected. On smaller platforms, this does not happen, causing
    the upper 16 bits to be shifted off before the value is converted to a
    32-bit integer.
    
    By manually casting these values to 32-bit before shifting, this issue
    is prevented.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    dc99921 View commit details
    Browse the repository at this point in the history
  9. Fix os_rlsbf4() and os_rmsbf4() when int is smaller than 32 bits

    These functions convert four individiual bytes from a buffer into a
    32-bit integer. The upper two bytes were cast to u4_t before being
    shifted in place, but not the lower bytes. It seems that this was not
    needed, since even when int is 16-bits, shifting a byte by 8 will not
    cause any bits to "fall off". However, a problem with sign-extension
    would occur in some cases.
    
    The problematic expression is:
    
    	return (u4_t)(buf[0] | (buf[1]<<8) | ((u4_t)buf[2]<<16) | ((u4_t)buf[3]<<24));
    
    Here, `buf[1]` would be integer-promoted before shifting.  It is
    promoted to a *signed* `int`, since the original `u1_t` type is small
    enough to fit in there. Now, if the MSB of `buf[1]` is 1, it is then
    shifted to become the MSB (i.e. sign bit) of the resulting *signed*
    integer. Then, before the bitwise-or operator is applied, this value is
    extended to 32-bits, since the right operand is 32-bit. Since the
    left-hand side is signed, it is sign-extended, causing all upper 16 bits
    to become 1, making them also 1 in the resulting value.
    
    To fix this, all bytes are first explicitely cast to `u4_t` to make sure
    they are already big enough and remain unsigned. For consistency, the
    same is done for `os_rlsbf2()`, even though this same problem cannot
    occur there (C guarantees that an int is at least 16-bits wide).
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    81de5e1 View commit details
    Browse the repository at this point in the history
  10. Add alternative AES implementation

    The original LMIC AES implementation is optimized for fast execution on
    32bit processors, but it ends up taking a lot of flash space on 8-bit
    AVR processors. This commit adds an alternative AES implementation
    written by Ideetron, which is a lot smaller, but also about twice as
    slow as the original implementation. This new implementation is selected
    by default, but the original can be used by modifying config.h.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    a0d1a61 View commit details
    Browse the repository at this point in the history
  11. Allow disabling class B suport

    Disabling this shrinks the code by a fair bit, so this is interesting
    for low-memory applications that do not need class B.
    
    This can also disable processing of some MAC commands. They are
    completely not recognized anymore, which should be ok since these
    commands should never be received at all. If they are received, this
    will break processing of subsequent commands, though.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    88c1220 View commit details
    Browse the repository at this point in the history
  12. Add extern "C" blocks around header files when using C++

    This allows the .h files to be included from C++ code directly, without
    having to worry about calling conventions and name mangling.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    edd6924 View commit details
    Browse the repository at this point in the history
  13. Fix compilation for SX1272

    The `LORA_RXSTART_FIXUP` macro was not defined for this board, breaking
    compilation. This just defines it to 0, which is probably incorrect, but
    related values are also 0 and to be determined, so this at least fixes
    compilation.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    48388d5 View commit details
    Browse the repository at this point in the history
  14. Let printf %F accept s4_t instead of int

    In practice, u4_t and s4_t arguments are always passed to %F (freq
    mostly). On systems where int is s4_t, this works fine (the signed vs
    unsigned mismatch works out as long as values are smaller than 2^31).
    However, on systems where int is s2_t, this causes the printf arguments
    to run out of sync, producing garbage output and potentially infinite
    loops.
    
    In two cases, %F was used for a s1_t, which must now be ucast to s4_t
    (it would already be implicitly converted to int, so again this was not needed
    on systems that have int equal to s4_t).
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    aa24fc4 View commit details
    Browse the repository at this point in the history
  15. Let debug_printf accept long modifier (e.g. %ld)

    This allows printing long values. On ARM, these are identical to int,
    but on AVR they are different, so this allows printing 32-bit values
    there.
    
    This is not actually used anywhere yet (the only 32-bit values used are
    timestamps, which are printed using %t), but this prepares for printing
    raw timestamps in a subsequent commit.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    d07233f View commit details
    Browse the repository at this point in the history
  16. Allow printing timestamps in raw ticks

    This supports a CFG_DEBUG_RAW_TIMESTAMPS define, which changes
    timestamps from the hh:mm:ss.mmm format to a raw tick value (which might
    be harder to read, but has more precisions).
    
    The default is still the millisecond format.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    fde3108 View commit details
    Browse the repository at this point in the history
  17. Prepend all debug prints with a timestamp

    This uses %t for printing ostime_t values. The field width in the format
    string is not normally used, but added for when the "raw" ticks
    timestamp format is applied (with CFG_DEBUG_RAW_TIMESTAMP).
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    7a60a5d View commit details
    Browse the repository at this point in the history
  18. Use %ld for printing 32-bit values

    On e.g. ARM, %d and %ld are equivalent, but on smaller architectures
    like AVR, they are not, so this makes these prints work there.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    cfee5b8 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    e8348c9 View commit details
    Browse the repository at this point in the history
  20. Add more verbose debug output

    This is triggered by a CFG_DEBUG_VERBOSE define and gives more spammy
    debug output.
    
    This also adds some sleeping-related debug output, but this is disabled
    for now since the Arduino port does not do sleeping yet.
    
    The osxtime_t values (which are 64-bit) are printed as ostime_t (which
    are 32-bit). Printing them as 64-bit would make it harder to compare
    them with ostime_t values. Things might get weird or incorrect after an
    overflow, though.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    8402e34 View commit details
    Browse the repository at this point in the history
  21. Support boards without reset connected

    This allows the HAL to indicate reset is not connected, which causes the
    reset to be skipped entirely. This will often work as expected, but
    (especially when the MCU is reset while the transceiver is working)
    might cause problems, of course.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    8230d35 View commit details
    Browse the repository at this point in the history
  22. Arduino: Wait for serial on startup

    This allows seeing startup messages and errors on native USB boards.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    703cdd4 View commit details
    Browse the repository at this point in the history
  23. Arduino: Use 115200 for serial in otaa example

    This was already used for the abp example, now they are consistent
    again.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    2570d6b View commit details
    Browse the repository at this point in the history
  24. Sx126x: Enable DIO3 als TCXO control

    This should probably be made configurable, but for now just always
    enable it (since typically DIO3 is not used as anything else anyway).
    
    The voltage and timeout values were taken from other example code and
    should probably also be configurable. Also, the timout adds TX/RX delay,
    so should probably be accounted for.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    5dacd66 View commit details
    Browse the repository at this point in the history
  25. Sx126x: Remove unneeded cast

    This actually breaks the build in recent gcc versions.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    935d460 View commit details
    Browse the repository at this point in the history
  26. Arduino: Support SX126x pin configuration

    The SX126x chips can map all interrupts to DIO1, so no need to connect
    anything else.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    7f02397 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    20afaf1 View commit details
    Browse the repository at this point in the history
  28. Arduino: Do not disable IRQs on hal_failed

    This prevents USB operation on native USB boards, which complicates
    subsequent uploads.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    d27018c View commit details
    Browse the repository at this point in the history
  29. Arduino: Use random nonces (HACK)

    We should really use them incrementally and save them, but for now the
    LoRaWAN 1.0 behaviour of random nonces should work.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    5011e02 View commit details
    Browse the repository at this point in the history
  30. Sx126x: Print warnings before disabling IRQs

    On some Arduino cores, printing with IRQs disabled is problematic (see
    e.g. arduino/ArduinoCore-samd#472). In
    general, disabling interrupts for shorter amounts of time is a good idea
    anyway.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    dc7428c View commit details
    Browse the repository at this point in the history
  31. Scheduling: Do not print with interrupts disabled

    Serial printing with IRQs disabled is problematic on some Arduino cores,
    see e.g.  arduino/ArduinoCore-samd#472
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    bd39b0a View commit details
    Browse the repository at this point in the history
  32. Arduino: Make libc printf work on non-AVR too

    BasicMAC (unlike LMIC) has its own debug_printf functions, so this is
    probably less necessary, but add it just in case.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    e1c2bc5 View commit details
    Browse the repository at this point in the history
  33. Schedule RX/TX timeout after starting RX/TX

    Previously, these timeouts were started before starting RX or TX. This
    worked normally, but when a HAL did not have access to the BUSY pin and
    instead resorted to conservative delays between SPI transactions,
    starting RX or TX would take so long that the timeout would effectively
    end up too short.
    
    Note that there is no HAL committed yet that supports working without a
    BUSY pin, but this came up in some as of yet uncommitted work on the
    Arduino port. Even if running without a BUSY pin will never be
    supported, setting the timeout like this should be fine, since in the
    worst case it only effectively extends the timeout by a few ms. Since
    the timeout should normally occur, this is fine.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    1aa3edb View commit details
    Browse the repository at this point in the history
  34. Arduino: Support separate RX and TX enable pins

    Some radio modules have separate pins for this, which allows switching
    the antenna switch off entirely to save power. On boards with just a
    single RXTX pin, this pin can be set as TX pin, to fall back to RX mode
    when idle.
    
    This commit intentionally breaks compatibility with the pinmap, to
    force sketches to update their pinmap (also for the busy pin, since
    omitting a field at the end of a struct initializes it to 0, which could
    be a valid pin number).
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    931d301 View commit details
    Browse the repository at this point in the history
  35. Enable interrupts on assertion failure

    This prevents printing with interrupts disabled, which is problematic on some
    Arduino cores, see e.g.  arduino/ArduinoCore-samd#472
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    32114b3 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    f8bee92 View commit details
    Browse the repository at this point in the history
  37. Arduino: Add pinout for some standard boards

    These are boards that include a LoRa module, so have a well-known
    pinout.
    
    These are added to a separate file, which is copied into each example
    directory on export, which makes it easier to change these pinmaps in a
    single place.
    
    This commit also adds some comments about how to add your own pinmap.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    9a323b6 View commit details
    Browse the repository at this point in the history
  38. SX127x: Remove useless part from debug print

    This just inserted an empty string, which does not really make sense.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    781f2f5 View commit details
    Browse the repository at this point in the history
  39. Arduino: Fix NSS initialization

    Previously, the NSS pin would only be set to OUTPUT mode, causing it to
    become OUTPUT LOW and starting an SPI transaction already. In some cases
    (possibly when the chip was subsequently reset), the first SPI
    transaction would then fail (readReg would return 0), causing
    an assertion failure during initialization.
    
    This is fixed by writing the NSS pin HIGH in addition to changing to
    OUTPUT mode. To prevent a low pulse on the line, it is written HIGH
    before setting OUTPUT, but it seems not all cores support this (e.g. the
    arduino-STM32L4 reset to LOW when changing to OUTPUT), so write HIGH
    again after setting OUTPUT to be sure.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    02d4a31 View commit details
    Browse the repository at this point in the history
  40. Arduino: Remove raw.ino example

    This example was not updated to BasicMAC yet, and already for LMIC it
    was not really using the library properly. Since it is likely only
    confusing for people, better remove it.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    f3841c0 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    ffec276 View commit details
    Browse the repository at this point in the history
  42. Mark unused functions unused

    This prevents a compiler warning. If these are used later, the attribute
    can stay without problems (it just says "It is ok if these are unused").
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    245c43e View commit details
    Browse the repository at this point in the history
  43. Fix undefined casting in GetRandom

    In C, it is not allowed to reference variables using pointers to an
    unrelated type, except when the pointer is uint8_t. So dereferencing a
    uint8_t[] through uint32_t* is not allowed (and gives a warning about
    type-punning), but dereferencing uint32_t through a uint8_t* is allowed.
    
    This rewrites GetRandom slightly to fix this warning.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    f74ec70 View commit details
    Browse the repository at this point in the history
  44. Arduino: Fix unused parameter warnings

    This just removes the parameter names to indicate they are unused.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    52b5642 View commit details
    Browse the repository at this point in the history
  45. Fix unused parameter warnings

    In C, we cannot omit parameter names (like in C++), so use a void-cast
    to reference the parameters without really using them. This is typically
    done with a macro, but doing it explicitly like this prevents further
    polluting the macro namespace with potential conflicting names.
    matthijskooijman committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    d03014f View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    75f527c View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    eb3621a View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    f4d97a4 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2020

  1. Merge tag 'v2.2'

    This merges the final release done by Semtech.
    matthijskooijman committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    b19dce4 View commit details
    Browse the repository at this point in the history
  2. Rename min/max macros to os_min/os_max

    This prevents conflicting with existing Arduino macros, or user-defined
    functions with the same name.
    matthijskooijman committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    cfca8e9 View commit details
    Browse the repository at this point in the history
  3. Sx126x: Fix compilation failure due to radio_cw rename

    In version 2.2, Semtech changed the 127x driver to rename txsw to
    radio_cw, but this change was not made in the 126x driver, making
    compilation fail when using it.
    
    This renames the function for 126x to at least fix compilation.
    
    However, for 126x the continuous mode was split into a TXCW and TXCONT
    mode, where the former uses the existing radio_cw (formerly txcw)
    function, but the latter txfsk() or txlora() with some changes for
    continuous mode. This is not implemented for 126x, so TXCONT is probably
    broken for 126x now.
    matthijskooijman committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    b83bb94 View commit details
    Browse the repository at this point in the history
  4. Replace all tabs by spaces

    Previously, most files used mixed tabs and spaces (e.g. 4 spaces indent,
    each 8 spaces replaced by a tab) which heavily relies on tabs being
    rendered as 8 spaces (so it does not allow changing the tab size to your
    personal preference). To prevent issues and conflicts resulting from
    inconsistent indentation, just switch everything to use spaces
    exclusively.
    
    A big indentation change like this is prone to causing conflicts with
    existing pullrequests and git clones, but since this repo is still
    fairly new, now seems like the best time to do this cleanup.
    
    This was done using the following command:
    
        for f in $(find -name \*.[ch]); do vim -c "set et|retab|wq" $f; done
    
    And then commiting everything except basicloader (which is a submodule)
    and stm32/CMSIS (which is third-party code imported verbatim).
    matthijskooijman committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    503dd9f View commit details
    Browse the repository at this point in the history
  5. Arduino: Update library.properties

    This still had some values from LMIC in there. Also update the project
    URL now Semtech officially stopped developing this.
    matthijskooijman committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    42efdda View commit details
    Browse the repository at this point in the history
  6. Bump version to 2.2.1

    This helps distinguish this version from the 2.2 version released by
    Semtech. Assigning a version number is not any particular indication of
    stability, though.
    matthijskooijman committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    cedc925 View commit details
    Browse the repository at this point in the history
  7. README: Fix typo

    matthijskooijman committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    4c399a2 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2020

  1. Arduino: Show how to enable sx126x radio support

    This leaves the default at sx1276, but adds a commented line for 126x in
    target-config.h.
    matthijskooijman committed May 22, 2020
    Configuration menu
    Copy the full SHA
    d8c82e8 View commit details
    Browse the repository at this point in the history

Commits on May 26, 2020

  1. Arduino: Rename top-level include to basicmac.h

    This is the first header from this library that an Arduino sketch should
    include, allowing the IDE to detect the sketch needs this library.
    Renaming this from the lmic.h that LMIC uses, allows LMIC and BasicMAC
    to co-exist in your libraries folder, with sketches selecting the right
    library based on this include.
    
    Note that other header files still use 'lmic' in their name (and
    contents). Renaming all these would be too invasive, but also not needed
    (once the top-level include selected one library, all other includes
    will be resolved using that library if possible).
    
    This is a breaking change, which breaks any existing sketches. Fixing
    such sketches is a matter of replacing `#include <lmic.h>` with
    `#include <basicmac.h>`.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    63023a0 View commit details
    Browse the repository at this point in the history
  2. Arduino: Rename examples to basicmac-abp/otaa

    These examples were not really TTN-specific, but could just as easily be
    used for other networks (maybe needing some settings changes), so
    reflect that in the name. This adds "basicmac" to the name, to make it
    easier to distinguish them from the lmic examples too, when working with
    both libraries.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    3305d8e View commit details
    Browse the repository at this point in the history
  3. Arduino: Fix FSK channel in basicmac-abp example

    This defined a channel for FSK, but specified the DR using the `FSK`
    constant, which is for specifying SF, not DR.
    
    This extends the list of DR constants (which are not currently defined
    in BasicMAC itself) in the example to include all EU868-defined
    datarates.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    e2841f7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2fe8715 View commit details
    Browse the repository at this point in the history
  5. Arduino: Enable DEBUG_TX/RX by default

    These contain detailed, but concise info about TX and RX and are
    generally useful without cluttering too much, so better enable them by
    default.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    cf7bf9c View commit details
    Browse the repository at this point in the history
  6. Arduino: Wait for join to complete in basicmac-otaa example

    This is not strictly needed, but starting the join explicitly and
    waiting for it to complete before scheduling the first packet typically
    makes things a little more predictable (and would prevent sending old
    data when the join takes long in a real sensor application).
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    b789d1d View commit details
    Browse the repository at this point in the history
  7. Arduino: Fix printing of downlink data size

    This was accidentally spread over three lines, now it is again just one
    line.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    fa4ef16 View commit details
    Browse the repository at this point in the history
  8. Arduino: Add empty lines around "Starting" message

    This makes it a bit easier to find restarts in the serial log.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    b9e74a6 View commit details
    Browse the repository at this point in the history
  9. Introduce isFsk and isLora helper functions

    These replace explicit checks against SF, making the code easier to
    read and prepares for adding additional modulations later.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    c4977f2 View commit details
    Browse the repository at this point in the history
  10. Remove some assumptions on constant values

    This makes it easier to change these constants if needed.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    e328468 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    897766d View commit details
    Browse the repository at this point in the history
  12. debug: Remove duplicate entry for EV_ADR_BACKOFF

    This fixes a compiler warning but should not otherwise change anything.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    c7a5db2 View commit details
    Browse the repository at this point in the history
  13. debug: Simplify RX debug messages

    There is no need to repeat all modulation parameters on successful RX or
    RX timeout, since those have already been printed when RX started with
    the RXMODE message.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    599b61e View commit details
    Browse the repository at this point in the history
  14. debug: Fix message about next join

    This would print a timestamp in the past, rather than the actual time of
    the next join attempt.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    5335f99 View commit details
    Browse the repository at this point in the history
  15. debug: Simplify bandwidth in RX prints

    Rather than indexing a string, just calculate the bandwidth value. This
    will produce "1000" instead of "rfu" for bw=3, but that should not be
    used anyway. This calculation was already used for TX, now also for RX.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    a60e701 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    eaabb27 View commit details
    Browse the repository at this point in the history
  17. debug: Split TX/RX prints by modulation

    Previously, sf=6 would indicate FSK and all modulation parameters were
    shown for FSK, even when most were unused. This makes makes the
    modulation used more explicit, and shows only relevant parameters in the
    debug output.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    c7f4ff0 View commit details
    Browse the repository at this point in the history
  18. debug: add [verbose_]debug_printf_continue macros

    This can be used to continue a previously started line, since this
    version does not include a timestamp.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    77307ef View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    b71a8dd View commit details
    Browse the repository at this point in the history
  20. debug: Handle a zero framecounter properly

    The `LMIC.seqnoUp` is the frame counter to be used for the *next* uplink
    packet. Therefore, one is subtracted before printing, to get the counter
    of the current framecounter.
    
    However, when no data uplinks have been sent yet (e.g. when sending a
    join request), `LMIC.seqnoUp` would be 0 and the subtraction would
    underflow. Earlier, this would print -1, but now that the counter is
    properly printed as unsigned, this would print some large value.
    
    With this commit, simply print 0 when no frames have been sent yet.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    389cbd3 View commit details
    Browse the repository at this point in the history
  21. debug: Add DEBUG_JOBS macro

    This can be used to independently toggle debug output about job
    scheduling. This is debug output is not usually useful, so it is
    disabled by default, making the verbose debug output a lot easier to
    read.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    b9d13d8 View commit details
    Browse the repository at this point in the history
  22. Expose LMIC_disableDC always

    Previously, this was only exposed when CFG_extapi was set. However,
    disabling DC limitations can sometimes be useful for testing. Use with
    caution!
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    a509eba View commit details
    Browse the repository at this point in the history
  23. Remove EV_SHUTDOWN constant

    This event was never fired, so better just remove it.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    0f54546 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    3ecfc59 View commit details
    Browse the repository at this point in the history
  25. Remove forward declaration of startScan

    This was not actually used before its definition, so this declaration is
    pointless. Also, when DISABLE_CLASS_B was defined, it would never be
    defined, resulting in:
    
         warning: 'startScan' declared 'static' but never defined [-Wunused-function]
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    f9d00f4 View commit details
    Browse the repository at this point in the history
  26. Make rx1DrOff signed

    This array stores offsets between up and own datarates. Some of these
    values are negative, but were now stored as unsigned numbers. In
    practice, this worked out ok because unsigned and signed addition are
    the same, and the result of such addition (in prepareDnDr) was cast to
    s1_t (so any upper bits incorrect due to lack of sign extension were
    discarded anyway).
    
    However, in a few cases, comparisons with ILLEGAL_RX1DRoff (which is
    defined as -128) would *not* work. The compiler also warned about this:
    
        warning: comparison is always false due to limited range of data type [-Wtype-limits]
    	 if( REGION.rx1DrOff[LMIC.dn1DrOffIdx] == ILLEGAL_RX1DRoff )
                                               ^~
    
    And then the optimizer would remove the if, assuming it is always false.
    
    In practice, this only meant that any invalid offsets in a join accept packet
    or MCMD_DN2P_SET MAC command would not be rejected.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    8c2316c View commit details
    Browse the repository at this point in the history
  27. Fix potential infinite loop in rps2dndr

    If this function would be passed rps that matches none of the defined
    DR's, this loop would loop infinitely. This happened because dr_t is
    signed, so `dr--` would loop from 0 to 255 rather than to -1, and `dr >=
    0` would never be false.
    
    The compiler warned about this:
    
        warning: comparison is always true due to limited range of data type [-Wtype-limits]
    	 for( dr_t dr = 15; dr >= 0; dr-- ) {
    			       ^~
    
    In practice, this never happened because there would always be a
    matching dr to break the loop, but fix this anyway.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    3d7a5e7 View commit details
    Browse the repository at this point in the history
  28. Fix some more warnings

    This fixes some signed vs unsigned mismatches, and some functions and
    variables that were only used inside preprocessor guards.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    bb2462d View commit details
    Browse the repository at this point in the history
  29. Change LMIC.errcr to cr_t

    This used to be u1_t, but cr_t is more appropriate, also saving a cast.
    Since cr_t is just a typdef for u1_t, this should not change the
    resulting output.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    9632795 View commit details
    Browse the repository at this point in the history
  30. Add LMIC_STATIC_ASSERT macro

    This uses the C11/C++11 static_assert feature, to be able to check
    certain conditions at compiletime. Unlike `#if`, this can make
    assertions involving C-level constants, instead of just preprocessor
    macros.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    f24e397 View commit details
    Browse the repository at this point in the history
  31. Fix warning in assert

    This assert would result in:
    
        warning: comparison is always true due to limited range of data type [-Wtype-limits]
             ASSERT(sf >= SF7 && sf <=SF12 && bw >= BW125 && bw <= BW500);
    
    Because it checked `bw >= BW125`, but `BW125` is 0. This means this part
    of the check can be removed, but replace it with a static assertion that
    `BW125` is indeed 0, just in case this code is every changed.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    2cc01a3 View commit details
    Browse the repository at this point in the history
  32. Remove sameSfBw function

    It was unused.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    420e915 View commit details
    Browse the repository at this point in the history
  33. Make RPS-building more clear

    This renames the LWUPDR/LWDNDR macros to LORA_UP_RPS and LORA_DN_RPS to
    make it more clear that these parameters are LoRa-specific and build an
    RPS rather than an DR-number. MAKERPS is also renamed to MAKE_LORA_RPS
    and makeRps to makeLoraRps.
    
    For FSK, FSK_UP_RPS, MAKE_FSK_RPS and makeFskRps are introduced which
    accept only the parameters needed for FSK.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    d189edc View commit details
    Browse the repository at this point in the history
  34. Replace decDR with lowerDR

    The `decDR` function would decrement a DR by one, while `lowerDR` would
    decrement it by a given amount. To make the code a bit more uniform and
    simple, just use ` lowerDR` for both, passing an explicit `1` for
    decrementing by one.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    0a09a6f View commit details
    Browse the repository at this point in the history
  35. dr2hsym: Use updr2rps instead of accessing REGION directly

    This is currently equivalent, but this prepares for adding a custom DR
    exception in updr2rps next.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    68b8206 View commit details
    Browse the repository at this point in the history
  36. Calculate LMIC.dndr earlier

    Previously, LMIC.dndr was set to the TX datarate on TX, and then the
    corresponding RX1 datarate was derived in txDone. Since nothing happens
    in between that could influence the RX1 datarate, it is easier to just
    derive the RX1 datarate on TX already.
    
    This removes the confusion where `LMIC.dndr` would actually contain the
    TX datarate. It also prepares for introducing a custom datarate.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    9ca1ec4 View commit details
    Browse the repository at this point in the history
  37. Report EV_TXDONE slightly later for data packets

    This makes sure that the `txDone()` function is ran before `EV_TXDONE`,
    which makes this consistent with join request packets, and allows to
    customize the radio settings for the RX windows without `txDone()`
    overwriting them again.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    3010a4e View commit details
    Browse the repository at this point in the history
  38. Support custom datarates

    This adds the LMIC_setCustomDr() function which can be used to enable a
    custom datarate with arbitrary settings (e.g different CR, bandwidth,
    etc.), which is used until explicitly changed back to a standard
    datarate.
    
    See comments in lmic.h for detailed usage info.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    42456b1 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    a4fd7d0 View commit details
    Browse the repository at this point in the history
  40. Include TX_RAMPUP in channel selection

    nextTx is called to select any channel that is available now. It then
    returns the timestamp when a channel is first available. If that
    timestamp is <= now, the channel is selected, if the timestamp > now,
    the nextTx should be called again after the returned timestamp.
    
    However, to decide whether a channel is available, nextTx looked at
    `now`, but to decide whether TX should then start, engineUpdate looked
    at `now + TX_RAMPUP`. This meant that if `nextTx` was called within
    `TX_RAMPUP` of airtime becoming available, `nextTx` could decide that no
    airtime was available yet, *not* selecting a channel. Then engineUpdate
    decides that airtime *is* available and continues with the transmission,
    with the same channel as the previous transmission.
    
    This fixes this by passing the actual threshold (`now + TX_RAMPUP`) to
    `nextTx`, so both decisions end up the same.
    
    Additionally, `nextTx_dyn` would actually call `os_getXTime()` rather
    than use the `now` argument passed. It now expands the given timestamp
    to an `osxtime_t` instead, so the added `TX_RAMPUP` is actually used.
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    4edad96 View commit details
    Browse the repository at this point in the history
  41. sx126x: Fix random write in GetRandom

    In commit f74ec70 (Fix undefined casting in GetRandom), an addressof
    operator for `value` was forgotten, so instead of casting the pointer to
    `value`, this would cast `value` itself to a pointer. Combined with a
    lack of initialization on `value`, this would end up writing the random
    value to a random place in memory, and not actually returning it.
    
    While we're here, also use sizeof instead of hardcoding the number of
    bytes to read.
    
    Note that none of this actually seems to make GetRandom work, the
    hardware still returns only zeroes from the random register somehow...
    matthijskooijman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    7caf7dc View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2020

  1. Arduino: Fix comment

    This referred to the DISABLE_PING that LMIC had, but this was merged
    with DISABLE_CLASSB in Basicmac.
    matthijskooijman committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    a493acb View commit details
    Browse the repository at this point in the history
  2. sx126x: Factor out regulator and DIO setup

    This code would be duplicated four times for different tx and rx mode,
    so better make it a function (this also prepares for more conditional
    and complicated setup later).
    matthijskooijman committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    cc25499 View commit details
    Browse the repository at this point in the history
  3. AU915: DR6 = SF8BW500

    Lw 1.0.2 and Lw 1.1 define DR6 for AU915 to be SF8BW500.
    reissjason authored and matthijskooijman committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    a42d65c View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2020

  1. Fix typo in constant name (#14)

    In commit e328468 (Remove some assumptions on constant values), a typo
    was introduced in this constant. This was only problematic for the
    SX1276, which was probably not tested after that commit.
    
    This fixes #13.
    pe1mew committed Jul 5, 2020
    Configuration menu
    Copy the full SHA
    20b58e2 View commit details
    Browse the repository at this point in the history
  2. debug: Rename itoa to prevent conflicts

    On some platforms (e.g. AVR), this produces conflicts with the builtin
    itoa function. It is not entirely clear why this was not problematic
    before, but now it prevents compilation. Renaming to debug_itoa fixes
    this.
    matthijskooijman committed Jul 5, 2020
    Configuration menu
    Copy the full SHA
    2f72bc9 View commit details
    Browse the repository at this point in the history
  3. arduino: Make basicmac-abp example compile for US915

    This removes the LMIC_selectSubBand function call, which no longer
    exists. This does not actually make the example work, just makes it
    compile.
    matthijskooijman committed Jul 5, 2020
    Configuration menu
    Copy the full SHA
    934a8ad View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8d73349 View commit details
    Browse the repository at this point in the history
  5. Fix warnings on 16-bit architectures

    There were some warnings caused by assuming int is 32-bit, which is not
    true on e.g. AVR. All of these probably resulted in actual problems at
    runtime, i.e.:
     - Problems with very high "available" times (e.g. long airtime combined
       with low duty cycle limits).
     - Problems parsing frequencies in network commands.
     - Extended callback scheduling not working (not used by BasicMAC
       itself).
     - Problems with the FSK TX timeout job.
    matthijskooijman committed Jul 5, 2020
    Configuration menu
    Copy the full SHA
    3b5bcdd View commit details
    Browse the repository at this point in the history
  6. Fix warnings

    matthijskooijman committed Jul 5, 2020
    Configuration menu
    Copy the full SHA
    277571d View commit details
    Browse the repository at this point in the history
  7. Work around double definition of REGION

    This prevents a warning about this.
    matthijskooijman committed Jul 5, 2020
    Configuration menu
    Copy the full SHA
    12e6dd5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3e21aa3 View commit details
    Browse the repository at this point in the history
  9. github: Compile examples with -Werror

    This should help accidentally (re)introducing warnings.
    matthijskooijman committed Jul 5, 2020
    Configuration menu
    Copy the full SHA
    d49f97c View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2020

  1. radio: Use ASSERT, not assert

    In commit 2fae1e8 (debug: Split TX/RX prints by modulation), three new
    assertions were introduced that accidentally used the system `assert`
    rather than BasicMAC's own ASSERT. It seems this worked ok for the
    Arduino build, but broke the regular Makefile build with a linker error.
    matthijskooijman committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    f6757c1 View commit details
    Browse the repository at this point in the history
  2. basicloader: Update submodule URL

    This used a relative URL, but the basicmac repository was moved, so the
    relative url no longer works. At some point, this basicloader reference
    might be removed, but until then, at least make it valid.
    matthijskooijman committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    52c849c View commit details
    Browse the repository at this point in the history
  3. basicloader: Update to correct version

    In BasicMac v2.2, the basicloader submodule was updated. However, when
    merging that release into this branch, it seems the submodule update was
    accidentally reverted, so this still had the version used with v2.1
    which prevented compilation from working.
    matthijskooijman committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    1c826fa View commit details
    Browse the repository at this point in the history
  4. stm32: Fix const-related warning

    The const was in the wrong place, making this an array of pointers to
    const-functions, rather than a const-array of pointers to functions. In
    certain environments (probably newer gcc) this produced a warning.
    
    Moving the const fixes this.
    matthijskooijman committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    aa4e3dc View commit details
    Browse the repository at this point in the history
  5. projects: Compile with -Werror

    The code is currently warning-free, so try to keep it that way.
    matthijskooijman committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    6e52925 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a374aaa View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2020

  1. arduino: Default to using the SX1262

    This transceiver is getting more common and one of the primary reasons
    for using basicmac, so make it the default.
    matthijskooijman committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    15fc2d1 View commit details
    Browse the repository at this point in the history
  2. hal: Define hal_pin_tcxo only for sx127x

    Configuring the TCXO is not possible using a MCU-controlled GPIO on the
    SX126x, so this function makes no sense there. This prevents
    accidentally calling it anyway.
    matthijskooijman committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    4197982 View commit details
    Browse the repository at this point in the history
  3. sx126x: No longer use DIO3 as TCXO control by default

    Enabling this unconditionally originally seemed harmless, since the pin
    was otherwise unused, but this also switches the transceiver into TCXO
    mode, breaking operation with a crystal.
    
    Instead of enabling this unconditionally, it is now disabled by default
    and can be enabled explicitly. On Arduino, set the `tcxo` field of the
    pin map to `LMIC_CONTROLLED_BY_DIO3`. With Makefile-based stm32, define
    `LMIC_DIO3_CONTROLS_TCXO` on the compiler commandline.
    
    The API between the radio driver and the HAL is not ideal and might need
    to be reconsidered later, but since the change on the Arduino side is
    breaking, better to get that out of the way soon (and the HAL side can
    be improved later).
    
    This fixes #9
    matthijskooijman committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    587776f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    abd286a View commit details
    Browse the repository at this point in the history
  5. arduino: Improve pin checks

    With the added `LMIC_CONTROLLED_BY_DIO3` pin value, the pin value
    asserts need to be slightly changed (and some asserts added for optional
    pins) to make sure that this new value is not considered a valid value
    for all pins.
    
    This also moves some asserts around to form a single block per
    transceiver type, rather than being spread around in multiple `#if`
    blocks.
    matthijskooijman committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    7bd00ca View commit details
    Browse the repository at this point in the history
  6. arduino: Fix running with busy = LMIC_UNUSED_PIN

    There was code to run without a busy pin, but the initialization asserts
    would forbid setting it to LMIC_UNUSED_PIN. This should make that work
    again.
    matthijskooijman committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    c94c2cc View commit details
    Browse the repository at this point in the history
  7. hal: No longer use DIO2 to control RXTX by default

    Enabling this unconditionally originally seemed harmless, since the pin was
    otherwise unused, but there is a (tiny) chance that boards have unused DIO pins
    grounded, which could lead to short-circuits. Also, it is probably good to make
    the DIO2-controls-TXRX situation explicit in the pinmap and be consistent with
    DIO3-controls-TCXO.
    
    Instead of enabling this unconditionally, it is now disabled by default
    and can be enabled explicitly. On Arduino, set the `tx` field of the
    pin map to `LMIC_CONTROLLED_BY_DIO2`. With Makefile-based stm32, define
    `LMIC_DIO2_CONTROLS_RXTX` on the compiler commandline.
    
    The API between the radio driver and the HAL is not ideal and might need
    to be reconsidered later, but since the change on the Arduino side is
    breaking, better to get that out of the way soon (and the HAL side can
    be improved later).
    matthijskooijman committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    3e09a97 View commit details
    Browse the repository at this point in the history
  8. Merge pull request #17 from LacunaSpace/dio3-tcxo-optional

    SX126x: Make using DIO2/DIO3 to control TXRX/TCXO optional
    matthijskooijman committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    8f38325 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    23e33fd View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5eb2d76 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    85a7a81 View commit details
    Browse the repository at this point in the history
  12. arduino: Show how to select SX1261

    Previously, target-config only showed the SX1262, not the SX1261. This
    fixes that by adding a commented define. It also completes the guard
    around the entire block, which is relevant for automatic (Github Action)
    builds (before this change both `BRD_sx1261_radio` and
    `BRD_sx1262_radio` might end up defined, which did not cause a
    compilation failure, so it was not noticed before).
    matthijskooijman committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    19e2962 View commit details
    Browse the repository at this point in the history
  13. arduino: Improve region handling

    This removes the hardcoded EU868 region from examples by just querying
    BasicMac for the first enabled region instead (thanks to Luiz Henrique
    Cassettari for suggesting this in #9).
    
    Additionally, this puts examples of all regional defines in
    target-config.h and documents that multiple can be defined at the same
    time (though multiple regions and other regions than EU868 have not been
    tested yet, see #8).
    matthijskooijman committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    fdb1f6f View commit details
    Browse the repository at this point in the history
  14. arduino: Fix TXRX-related comment in basicmac-otaa

    This comment was updated in the pinmap of basicmac-abp, but forgotten to
    be copied to basicmac-otaa.
    matthijskooijman committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    b704b72 View commit details
    Browse the repository at this point in the history
  15. EU868: Add new h0 band

    This is a band that was somewhat recently made available and can be used
    for LoRaWAN. The max allowed bandwidth is 350kHz (According to ERC
    recommendation 70-03), but since BasicMac has no way to encode this
    limitation currently, this is not enforced (so this should be taken into
    account when configuring channels instead).
    matthijskooijman committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    35a3f65 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2020

  1. TTGO T-Beam pinmap

    lyusupov authored and matthijskooijman committed Oct 10, 2020
    Configuration menu
    Copy the full SHA
    22731d9 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #15 from lyusupov/T_BEAM

    TTGO T-Beam pinmap
    matthijskooijman committed Oct 10, 2020
    Configuration menu
    Copy the full SHA
    32933af View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2020

  1. arduino: Remove hw.h content

    This was all commented out and unused, so just remove it. The file must
    still exist because it is included from elsewhere, though this can
    probably be changed in the future as well.
    matthijskooijman committed Nov 1, 2020
    Configuration menu
    Copy the full SHA
    2c0764d View commit details
    Browse the repository at this point in the history
  2. arduino: Change license to BSD

    Some parts of this code were still marked with the EPL license, used by
    older versions of LMIC. This changes the license to 3-clause BSD, the
    same as the rest of LMIC. This license is also added to the files that
    previously did not state any license.
    
    All of the affected code was written by me, with no significant
    contributions from others.
    matthijskooijman committed Nov 1, 2020
    Configuration menu
    Copy the full SHA
    68f76e5 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2020

  1. Fix link in README

    This pointed to the wrong commit, and it turns out github does not
    autolink commits in the README, so also make this an explicit link.
    matthijskooijman committed Nov 3, 2020
    Configuration menu
    Copy the full SHA
    b506988 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    04035d8 View commit details
    Browse the repository at this point in the history
  3. sx126x: Fix GetRandom

    When using DIO2 or DIO3 to control the TCXO or RxTx switch and GetRandom
    is called while the radio sleeps, the random generator will not be able
    to receive noise and return only zeroes.
    
    This fixes this by setting up the settings whenever GetRandom is called.
    
    To make sure CommonSetup is visible, also move GetRandom a bit downward
    in the file.
    matthijskooijman committed Nov 3, 2020
    Configuration menu
    Copy the full SHA
    f67f43f View commit details
    Browse the repository at this point in the history
  4. sx126x: Use random generator for random seed

    This radio has a random generator built in, so use it to seed the
    internal random generator. For the sx127x, the old, imperfect, method (based on
    DevEUI and compilation time is still used. This could maybe use RSSI
    measurements like LMIC did?
    
    Previously, the random generator was seeded on first use, but to prevent
    needing the radio while it is already operating, this now seeds the
    generator on startup.
    
    In particular, this means that on sx126x, the channel selection and join
    nonces are now properly randomized.
    matthijskooijman committed Nov 3, 2020
    Configuration menu
    Copy the full SHA
    cfb7f3d View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2020

  1. github: Use standard version of arduino-test-compile

    This previously used a customized version, but all customizations have
    been merged upstream, so use the standard version again.
    matthijskooijman committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    3e92fb1 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2020

  1. Configuration menu
    Copy the full SHA
    001a3aa View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2020

  1. Merge remote-tracking branch 'origin/master' into lacuna-master-merge

    * origin/master: (84 commits)
      direct PIO API (lower overhead to aid in implementing bit-banged protocols)
      timer peripheral
      timer peripheral -wip-
      timer peripheral beginnings
      spell check perso spec
      add missing DMA channel definition for USART2
      persotool, move perso uart back
      symlink perso test
      perso: cleanup, test cases
      perso -wip-
      unicorn: implement reset, perso -wip-
      perso -wip-
      simul peripheral fixes, perso -wip-
      GPIO simulation, USART simulation fix
      perso mode -wip-
      perso mode -wip-
      add idle detection to UART API, auto-pull and active high/low enhancements in PIO API
      increase test case robustness
      Update format of license so GitHub can auto-detect the type
      first draft of perso spec
      first draft of perso spec
      first draft of perso spec
      perso/test mode -wip-
      uart simulation -wip-
      change appstart hook signature to support multiple startup options
      svtool: support hook priorities
      use absolute URL for basicloader submodule
      updated readme and getting started guide
      cleanup
      multi-instance uart -wip-
      don't allow baud rates > 10M on LPUART
      multi-instance uart -wip-
      multi-instance uart -wip-
      multi-instance uart -wip-
      adressing comments from PR #4 review
      ex-join app test
      pass hex files for test in environment, symlink test from project
      cleanup: remove dockerfile, remove pylora (now using liblora on PyPI)
      add numpy to requirements.txt
      replace old simulation with new, add requirements.txt, re-activate test target in makefile, add test to travis ci build
      travis ci: install basicloader requirements, updated basicloader ref
      new travis ci file
      certification tests complete, traffic trace
      simul rework: even more compliance tests
      typing fixes
      simul rework: more compliance tests
      simul rework, more compliance tests
      simul rework: more compliance tests
      typing fixes
      simul rework: starting to port the compliance tests
      ...
    mkuyper committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    ddd274e View commit details
    Browse the repository at this point in the history