Commit Graph
23 Commits
Author SHA1 Message Date
Henry Gabryjelski 55c1b9f53d Remove sequence points / barriers ...
when programming the GPIOTE peripheral.
the memory barrier is still used once in the ISR,
to prevent spurious interrupts caused by delay
writing over the (16MHz) AHB bus.
2020-04-27 11:25:54 -07:00
Henry Gabryjelski c3c8ac3c8f Updated per @hathach requested changes
* Changed to use compiler intrinsics
* Significantly reduced comments near memory barrier usage, as per request
* Updating `attachInterrupt()` loops to more closely match requested style
2020-04-26 16:20:13 -07:00
Henry Gabryjelski 48fda18996 one more edge case covered 2020-04-24 11:59:53 -07:00
Henry Gabryjelski 1c90673a64 Ensure config is written before enabling the corresponding interrupt enable flag 2020-04-23 16:33:01 -07:00
Henry Gabryjelski cbbc57bd0d Ensure CONFIG is fully cleared 2020-04-23 16:15:09 -07:00
Henry Gabryjelski 280ecaf5aa Three bugs fixed
* First loop should not be checking pinmap for -1.

* Second loop should ensure no pending event when
  first allocating the GPIOTE channel.

* Second loop needs to update pinmap with pin when
  allocated the GPIOTE channel.
2020-04-23 15:56:50 -07:00
Henry Gabryjelski 9d47073cae fix obvious typo 2020-04-21 19:53:15 -07:00
Henry Gabryjelski 0cb59145fd Reduce ISR overhead
Reduce the number of cycles spent in the GPIOTE ISR,
by reading common volatile registers across AHB only
once, and using a safer hack to prevent spurious ISR
firing when the last channel's event was cleared.
2020-04-21 17:00:55 -07:00
Henry Gabryjelski 3ac53c52b4 Fix GPIOTE channel usage
First, when looking for a channel, first loop through
all mapped channels to see if the GPIO was already mapped.
This prevents a single GPIO being configured for more than
one channel at a time.

Second, do not use a GPIOTE channel if the channel is
already in use (e.g., by a library, sketch, or other code
outside the Board Support Package).
2020-04-21 17:00:55 -07:00
Henry Gabryjelski 20b080f9a2 Control SysView by CFG_SYSVIEW
Of course, this commit ensures the following:

* Zero change to BSP defaults
* Zero change to compiled code
* Zero change to UI / menu options
2020-03-25 16:20:33 -07:00
Henry Gabryjelski bc042c0c34 Record ISR entry/exit, when added via AttachInterrupt().
This only affects debug level 3 (Segger SysView) builds.
2019-11-04 09:20:44 -08:00
hathach 577b2039b2 refactor ada_callback, detect isr using cortex ICSR
remove ada_callback_FromISR()
2019-06-07 10:23:38 +07:00
Pol Van Aubel 7f03236718 Fix interrupts for device with multiple I/O Ports
Fixes adafruit/Adafruit_nRF52_Arduino#259
2019-05-03 22:50:42 +02:00
hathach c88bd0092f Merge branch 'master' into develop 2019-04-04 20:34:43 +07:00
Brian Johnson 3d923e95b0 Fix return in attachInterrupt 2019-03-10 20:31:37 -04:00
hathach e13922c58b enhance ada_callback, add malloc len for cleaner usage 2019-02-14 12:50:17 +07:00
hathach 53ed8be45a set attachInterrupt irq prio to 3 2018-11-09 11:43:19 +07:00
hathach 3e4e6f9bac Added ISR_DEFERRED option for attachInterrupt() to defer callback from ISR context 2018-11-06 15:12:20 +07:00
hathach d478e200e1 Merge branch 'master' into develop 2018-09-15 17:02:00 +07:00
Petr Nejedly 4beb472c6f Fix upstream issue #171: Better choice of pin interrupt priority
Nordic SoftDevice needs to have control over lowest priority interrupts
for reliable, timing sensitive operation. If user code tries to use
such a low priority level, SoftDevice refuses to start.
One way to overcome this limitation is to start the SoftDevice before
attaching pin change interrupts, though in such a case, SD will
cap the effective priority of the user interrupt anyway and it is
a common mistake API users do. This change simply changes the priority
to 2, which is legal (for fast interrupt handlers anyway) under SoftDevice,
no matter if attached before of after SD start.
2018-09-01 12:46:57 -07:00
hathach 313705e15c add nrf52 series common macros NRF52_SERIES 2018-04-17 17:20:22 +07:00
hathach ebea46c98d port SoftwareSerial close #62
- can receive data, and sending
2017-08-03 12:04:35 +07:00
hathach 6151838f8f adding file from sandeepmistry/arduino-nRF5 2016-11-22 01:08:21 +07:00