Thanks, I'll give your file a go (PM sent). Hopefully Paul will be able to add support into Teensy 3.0 at some point.
Matt
Thank you. I added the file into the library RF22 library directory for now (until it becomes part of the Teensy distribution)I've emailed you the file to the address in your PM. I've also cc'ed Paul at paul (at) pjrc.com. Hopefully, "should just work", but any questions or issues, let me know.
..\sketchbook\libraries\RF22/util/cortex_m3_atomic.h: In function 'void __set_primask(uint32_t)':
..\sketchbook\libraries\RF22/util/cortex_m3_atomic.h:18: error: expected ';' before 'asm'
{ __asm__ volatile ("MSR PRIMASK, %[value]\n\t""dmb\n\t""dsb\n\t""isb\n\t"::[value]"r"(setval):)[COLOR="#FF0000"];[/COLOR]
..\sketchbook\libraries\RF22\RF22.cpp:520: error: 'memcpy_P' was not declared in this scope
I did find a small error in the file:
Code:..\sketchbook\libraries\RF22/util/cortex_m3_atomic.h: In function 'void __set_primask(uint32_t)': ..\sketchbook\libraries\RF22/util/cortex_m3_atomic.h:18: error: expected ';' before 'asm'
So I added the missing ; here
Code:{ __asm__ volatile ("MSR PRIMASK, %[value]\n\t""dmb\n\t""dsb\n\t""isb\n\t"::[value]"r"(setval):)[COLOR="#FF0000"];[/COLOR]
And it compiles.
{ __asm__ volatile ("MSR PRIMASK, %[value]\n\t""dmb\n\t""dsb\n\t""isb\n\t"::[value]"r"(setval):)[COLOR="#FF0000"]; \[/COLOR]
The library will recognise an RFM22B device attached to the SPI port, so it's partially working (it can at least read the device ID over the SPI port)Please let me know if it works?
The main problem is "floating" or disconnected input mode pins consume power.
Yes, don't know how that crept in. Usual random source of error between chair and keyboard, no doubt.
Actually, three characters went missing. As well as the ';', there should be a ' ' and '\' (space and backslash) to indicate a continuation line.
Code:{ __asm__ volatile ("MSR PRIMASK, %[value]\n\t""dmb\n\t""dsb\n\t""isb\n\t"::[value]"r"(setval):)[COLOR="#FF0000"]; \[/COLOR]
I'm not sure if it makes any difference to the inlining of the function, to have the function broken over more than one line, but that's the way Dean had them in the original, so I was trying to keep to the convention.
{ __asm__ volatile ("MSR PRIMASK, %[value]\n" \
"\tdmb\n" \
"\tdsb\n" \
"\tisb\n\t" \
: \
: [value] "r" (setval):); \