Skip to content

Commit 0d29ed3

Browse files
authored
Merge pull request #974 from mcci-catena/issue714
Rename `hal_` exports to `lmic_hal_`
2 parents 453cb4e + abb3523 commit 0d29ed3

File tree

11 files changed

+210
-208
lines changed

11 files changed

+210
-208
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ __vm
4646

4747
# files from vscode
4848
.vscode
49+
doxygen

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -684,13 +684,13 @@ The IBM LMIC used as the basis for this code disables interrupts while the radio
684684

685685
To avoid this, the LMIC processes events in several steps; these steps ensure that `radio_irq_handler_v2()` is only called at predictable times.
686686

687-
1. If interrupts are enabled via `LMIC_USE_INTERRUPTS`, hardware interrupts catch the time of the interrupt and record that the interrupt occurred. These routines rely on hardware edge-sensitive interrupts. If your hardware interrupts are level-sensitive, you must mask the interrupt somehow at the ISR. You can't use SPI routines to talk to the radio, because this may leave the SPI system and the radio in undefined states. In this configuration, `hal_io_pollIRQs()` exists but is a no-op.
687+
1. If interrupts are enabled via `LMIC_USE_INTERRUPTS`, hardware interrupts catch the time of the interrupt and record that the interrupt occurred. These routines rely on hardware edge-sensitive interrupts. If your hardware interrupts are level-sensitive, you must mask the interrupt somehow at the ISR. You can't use SPI routines to talk to the radio, because this may leave the SPI system and the radio in undefined states. In this configuration, `lmic_hal_io_pollIRQs()` exists but is a no-op.
688688

689-
2. If interrupts are not enabled via `LMIC_USE_INTERRUPTS`, the digital I/O lines are polled every so often by calling the routine `hal_io_pollIRQs()`. This routine watches for edges on the relevant digital I/O lines, and records the time of transition.
689+
2. If interrupts are not enabled via `LMIC_USE_INTERRUPTS`, the digital I/O lines are polled every so often by calling the routine `lmic_hal_io_pollIRQs()`. This routine watches for edges on the relevant digital I/O lines, and records the time of transition.
690690

691-
3. The LMIC `os_runloop_once()` routine calls `hal_processPendingIRQs()`. This routine uses the timestamps captured by the hardware ISRs and `hal_io_pollIRQs()` to invoke `radio_irq_hander_v2()` with the appropriate information. `hal_processPendingIRQs()` in turn calls `hal_io_pollIRQs()` (in case interrupts are not configured).
691+
3. The LMIC `os_runloop_once()` routine calls `lmic_hal_processPendingIRQs()`. This routine uses the timestamps captured by the hardware ISRs and `lmic_hal_io_pollIRQs()` to invoke `radio_irq_hander_v2()` with the appropriate information. `lmic_hal_processPendingIRQs()` in turn calls `lmic_hal_io_pollIRQs()` (in case interrupts are not configured).
692692

693-
4. For compatibility with older versions of the Arduino LMIC, `hal_enableIRQs()` also calls `hal_io_pollIRQs()` when enabling interrupts. However, it does not dispatch the interrupts to `radio_irq_handler_v2()`; this must be done by a subsequent call to `hal_processPendingIRQs()`.
693+
4. For compatibility with older versions of the Arduino LMIC, `lmic_hal_enableIRQs()` also calls `lmic_hal_io_pollIRQs()` when enabling interrupts. However, it does not dispatch the interrupts to `radio_irq_handler_v2()`; this must be done by a subsequent call to `lmic_hal_processPendingIRQs()`.
694694

695695
## Downlink data rate
696696

@@ -1004,6 +1004,7 @@ function uflt12f(rawUflt12)
10041004
- Enable device time request by default in config file ([#840](https://github.com/mcci-catena/arduino-lmic/issues/840)).
10051005
- Add support for SX126x radios ([#949](https://github.com/mcci-catena/arduino-lmic/pull/949)).
10061006
- Refactor `README.md` a little and put little used configuration info in a separate file.
1007+
- Change all exports named `hal_*` to `lmic_hal_*`. This is a breaking change, and so the version number is advanced to 5.0.0-pre1. ([#714](https://github.com/mcci-catena/arduino-lmic/issues/714))
10071008

10081009
- v4.1.1 is a patch release.
10091010

@@ -1064,7 +1065,7 @@ function uflt12f(rawUflt12)
10641065
- [#443](https://github.com/mcci-catena/arduino-lmic/pull/443) addresses a number of problems found in cooperation with [RedwoodComm](https://redwoodcomm.com). They suggested a timing improvement to speed testing; this lead to the discovery of a number of problems. Some were in the compliance framework, but one corrects timing for very high spreading factors, several ([#442](https://github.com/mcci-catena/arduino-lmic/issues/442), [#436](https://github.com/mcci-catena/arduino-lmic/issues/438), [#435](https://github.com/mcci-catena/arduino-lmic/issues/435), [#434](https://github.com/mcci-catena/arduino-lmic/issues/434) fix glaring problems in FSK support; [#249](https://github.com/mcci-catena/arduino-lmic/issues/249) greatly enhances stability by making API calls much less likely to crash the LMIC if it's active. Version is v3.0.99.3.
10651066
- [#388](https://github.com/mcci-catena/arduino-lmic/issues/388), [#389](https://github.com/mcci-catena/arduino-lmic/issues/390), [#390](https://github.com/mcci-catena/arduino-lmic/issues/390) change the LMIC to honor the maximum frame size for a given DR in the current region. This proves to be a breaking change for many applications, especially in the US, because DR0 in the US supports only an 11-byte payload, and many apps were ignoring this. Additional error codes were defined so that apps can detect and recover from this situation, but they must detect; otherwise they run the risk of being blocked from the network by the LMIC. Because of this change, the next version of the LMIC will be V3.1 or higher, and the LMIC version for development is bumped to 3.0.99.0.
10661067
- [#401](https://github.com/mcci-catena/arduino-lmic/issues/401) adds 865 MHz through 868 MHz to the "1%" band for EU.
1067-
- [#395](https://github.com/mcci-catena/arduino-lmic/pull/395) corrects pin-mode initialization if using `hal_interrupt_init()`.
1068+
- [#395](https://github.com/mcci-catena/arduino-lmic/pull/395) corrects pin-mode initialization if using `lmic_hal_interrupt_init()`.
10681069
- [#385](https://github.com/mcci-catena/arduino-lmic/issues/385) corrects an error handling data rate selection for `TxParamSetupReq`, found in US-915 certification testing. (v2.3.2.71)
10691070
- [#378](https://github.com/mcci-catena/arduino-lmic/pull/378) completely reworks MAC downlink handling. Resulting code passes the LoRaWAN V1.5 EU certification test. (v2.3.2.70)
10701071
- [#360](https://github.com/mcci-catena/arduino-lmic/issues/360) adds support for the KR-920 regional plan.
@@ -1086,7 +1087,7 @@ function uflt12f(rawUflt12)
10861087

10871088
- Interim bug fixes: added a new API (`radio_irq_handler_v2()`), which allows the caller to provide the timestamp of the interrupt. This allows for more accurate timing, because the knowledge of interrupt overhead can be moved to a platform-specific layer ([#148](https://github.com/mcci-catena/arduino-lmic/issues/148)). Fixed compile issues on ESP32 ([#140](https://github.com/mcci-catena/arduino-lmic/issues/140) and [#153](https://github.com/mcci-catena/arduino-lmic/issues/150)). We added ESP32 and 32u4 as targets in CI testing. We switched CI testing to Arduino IDE 1.8.7.
10881089
Fixed issue [#161](https://github.com/mcci-catena/arduino-lmic/issues/161) selecting the Japan version of as923 using `CFG_as923jp` (selecting via `CFG_as923` and `LMIC_COUNTRY_CODE=LMIC_COUNTRY_CODE_JP` worked).
1089-
Fixed [#38](https://github.com/mcci-catena/arduino-lmic/issues/38) -- now any call to hal_init() will put the NSS line in the idle (high/inactive) state. As a side effect, RXTX is initialized, and RESET code changed to set value before transitioning state. Likely no net effect, but certainly more correct.
1090+
Fixed [#38](https://github.com/mcci-catena/arduino-lmic/issues/38) -- now any call to lmic_hal_init() will put the NSS line in the idle (high/inactive) state. As a side effect, RXTX is initialized, and RESET code changed to set value before transitioning state. Likely no net effect, but certainly more correct.
10901091

10911092
- V2.2.2 adds `ttn-abp-feather-us915-dht22.ino` example, and fixes some documentation typos. It also fixes encoding of the `Margin` field of the `DevStatusAns` MAC message ([#130](https://github.com/mcci-catena/arduino-lmic/issues/130)). This makes Arduino LMIC work with networks implemented with [LoraServer](https://www.loraserver.io/).
10921093

examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ void LMICOS_logEventUint32(const char *pMessage, uint32_t datum)
209209
}
210210
#endif // LMIC_ENABLE_event_logging
211211

212-
hal_failure_handler_t log_assertion;
212+
lmic_hal_failure_handler_t log_assertion;
213213

214214
void log_assertion(const char *pMessage, uint16_t line) {
215215
eventQueue.putEvent(ev_t(-3), pMessage, line);
@@ -369,7 +369,7 @@ void printFcnts(cEventQueue::eventnode_t &e) {
369369
void printAllRegisters(void) {
370370
uint8_t regbuf[0x80];
371371
regbuf[0] = 0;
372-
hal_spi_read(1, regbuf + 1, sizeof(regbuf) - 1);
372+
lmic_hal_spi_read(1, regbuf + 1, sizeof(regbuf) - 1);
373373

374374
for (unsigned i = 0; i < sizeof(regbuf); ++i) {
375375
if (i % 16 == 0) {
@@ -381,14 +381,14 @@ void printAllRegisters(void) {
381381
}
382382

383383
// reset the radio, just in case the register dump caused issues.
384-
hal_pin_rst(0);
384+
lmic_hal_pin_rst(0);
385385
delay(2);
386-
hal_pin_rst(2);
386+
lmic_hal_pin_rst(2);
387387
delay(6);
388388

389389
// restore the radio to idle.
390390
const uint8_t opmode = 0x88; // LoRa and sleep.
391-
hal_spi_write(0x81, &opmode, 1);
391+
lmic_hal_spi_write(0x81, &opmode, 1);
392392
}
393393
#endif
394394

@@ -698,7 +698,7 @@ void setup() {
698698
}
699699

700700
// now that we have a pinmap, initalize the low levels accordingly.
701-
hal_set_failure_handler(log_assertion);
701+
lmic_hal_set_failure_handler(log_assertion);
702702
os_init_ex(pPinMap);
703703

704704
// LMIC_reset() doesn't affect callbacks, so we can do this first.

src/arduino_lmic_hal_configuration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class HalConfiguration_t
114114
}
115115
};
116116

117-
bool hal_init_with_pinmap(const HalPinmap_t *pPinmap);
117+
bool lmic_hal_init_with_pinmap(const HalPinmap_t *pPinmap);
118118

119119
}; // end namespace Arduino_LMIC
120120

0 commit comments

Comments
 (0)