Skip to content

Missing noInterrupts() and interrupts() functions #431

Closed
@santaimpersonator

Description

@santaimpersonator

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions