You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You've hit the nail on the head on what the macro does :P
The end compiled code is the same as if cselect() and cdeselect() were used directly. I use the macro as I find it a little bit neater, really. I first came across the idea when looking at how AVR-LIBC did the ATOMIC_BLOCK stuff http://www.nongnu.org/avr-libc/user-manual/atomic_8h_source.html
You can also exit the block early with a 'continue;' and cdeselect() will still be called (I can't remember what happens with a return or break).
CHIPSELECT can be used inside an ISR or if you use the STANDBY option you can use it outside an ISR.
If a section of code should not be interrupted by the ISR (like coping buffers) then it should be wrapped with NRF905_ATOMIC.
Nice work! I'm porting your library to MicroPython so I can mix Arduino nodes with pyboard (STM32) and ESP8266 nodes.
Will share the GitHub link once it's ready.
Inside /arduino/nRF905/nRF905.cpp, line 75.
Can you please explain what these lines are used for?
Is the
CHIPSELECT
macro an optimised way of wrapping a block of code withcselect()
+cdeselect()
and optionally callingenableStandbyMode()
first?eg.
I noticed the pattern is repeated in the NRF905_ATOMIC macro:
The text was updated successfully, but these errors were encountered: