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

Missing noInterrupts() and interrupts() functions #431

Closed
santaimpersonator opened this issue Nov 18, 2021 · 2 comments
Closed

Missing noInterrupts() and interrupts() functions #431

santaimpersonator opened this issue Nov 18, 2021 · 2 comments

Comments

@santaimpersonator
Copy link

It appears that the Apollo3 Arduino core doesn't implement these Arduino functions:

I believe that enabling and disabling the interrupts were handled by these functions

  • am_hal_interrupt_master_enable()
  • am_hal_interrupt_master_disable()

in the Apollo3 Mbed OS platform in these files (location varies by branch):

I saw an old issue that got pulled, where @oclyke mentioned noInterrupts() being used; also, there was an example for the PDM microphone calling those functions. However, I think that the noInterrupts() and interrupts() functions were removed at a later point (probably by accident).


I found the issue when I was trying to get the LoRaWAN Arduino library working with the Artemis MicroMod processor board. However, I ran into compiler issues for noInterrupts() and interrupts() in the library at these lines:

I was able to work around the issue by throwing an ifdef to avoid compiling those functions, since the disabling of the interrupts in the library seemed mostly critical for AVR boards (from what I could tell).

void hal_disableIRQs () {
    #if !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)
        noInterrupts();
    #endif // !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)

    irqlevel++;
}

void hal_enableIRQs () {
    if(--irqlevel == 0) {
        #if !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)
            interrupts();
        #endif // !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)
@wemaxon
Copy link

wemaxon commented Nov 24, 2021

I had the exact same problem, which I solved too by commenting out both function calls. In the example provided by SparkFun the calls are removed as well. I still have some timing issues when trying to receive LoRa frames. I am using the LacunaSpace BasicMAC Library with the SparkFun LoRa Thing Plus explorable.

@Wenn0101
Copy link
Contributor

Fix is in dev and scheduled for release 2.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants