Does the Arduino dev sys compile 32 bit code for Teensy 3.2?

Bill_T

New member
Sorry if I missed this info during searches.

Does the current Arduino development system compile full 32 bit code for 32 bit processors like those on Teensy 3.2?

I ask because I want to implement an interrupt driven system with a few 32 bit volatile ints for communication, and would like to avoid bracketing accesses to shared variables with interrupt on/off statements to guard against "dual 16 bit access" issues.
 
Short answer = Yes, full 32 bit code.

Reads and writes to 32 bit variables are single instruction atomic access.

However, read-modify-write operations like "x |= 0x03;" will read the memory, perform the operation on registers, then write back. Those sorts of operations still need to be guarded. Likewise for using groups of variables. But for a single 32 bit variable, reads are atomic, and writes are atomic.
 
Good to have this confirmed, thanks Paul. Time to delete the "noInterrupts()" I just wrote out of caution around a volatile uint32 read :-D
 
Back
Top