control_reg_copy |= step_bit;
is a read-modify-write access as well. The difference in the timing is not much and lies in the range of µs. In the generated controlregister.h file you will see a declaration of the register itself, so you may use your above scheme directly on the control register and not on a shadow copy.
One more question. If I need to update the control register both in an ISR and in the normal code, I think I must
to be safe. Is that ok? Is that fast? Is there a better solution?
" Is there a better solution?" Yes, there is. When not disturbing your concept a CyEnterCriticalSection() and CyExitCriticalSection() would be the most common solution. See "System Reference Guide" from Creator help menu.
Again Thanks, Bob, this is exactly what I was looking for.
You are always welcome, Turtle.