The reason I still have the pinWake call in the riseLazarus function is it is doing something else besides just manipulating the PIN_CNF bits. Perhaps it is manipulating GIOPTE. Would be nice to get source code or insite from RF Digital into exactly what pinWake is doing.
A few things learned.
pinMODE(LazarusPin, INPUT_PULLDOWN) does not activate pulldowns. Hmm! So need to do that with PIN_CNF.
By default, the input buffer is not connected. Activating pulldown or pullup will activate the input buffer so no need to fiddle with those PIN_CNFs.
Doing pinWake in riseLazarus will not work unless the pullup is on. pinWake will then kick off immediately even though it does not set the sense bits in PIN_CNF.
Forcing sense level in PIN_CNF makes no difference kicking off the WAKE. The mere act of executing pinWake HIGH with the PULLUP on does what is needed. Just need to turn PULLDOWN back on to keep from ignoring future pinWakes particular on other pins.
Here is Lazarus for testing without Library.
Fascinating... Like you said, it would be nice to have the source for the PinWake and GPIOTE functions.
Thanks for sending the test code. Unconvinced that saving the sense bits didn't matter I played around with that and also dumped the GPIOTE Config registers at key points. What I found is that you were exactly right, the sense bits, even though they changed at various states, didn't seem to matter in the workings of things. More interestingly, the GPIOTE Config registers were always 0!
Finally, it appears, at least with my testing, that the PinWake MUST be executed inside ariseLazarus. This confounds me. I had expected to be able to do call pinWake once within setup() and, as long as I save the PIN_CNF bits, setting Pullup High would cause the event - not so, nothing happened unless pinWake was executed inside ariseLazarus.
Confounded, but, at least, with working code, I thank you for your efforts. This will serve my needs nicely.
PS: I was curious about whether the pinWakeCallback function might be useful in this regard, but I'm not seeing it. The callback allows you to do things 'under the covers' without exiting the ULPDelay()... Lazarus allows us to force an exit from ULPDelay() without consuming an RFDuino GPIO.