Skip to content
Snippets Groups Projects
  • Joakim Nohlgård's avatar
    dfa342b5
    cpu/samd21: Avoid clearing interrupt bits unintentionally · dfa342b5
    Joakim Nohlgård authored
    The INTENSET, INTENCLR, INTFLAG registers are write-1-to-confirm
    registers, so writing zeroes will not affect anything, on the other
    hand, a compiler generated read-modify-write cycle may unintentionally
    affect more bits than the one being set. Avoid by using direct
    assignment instead of or-assignment (|=) or bitfield writes (.bit.xxx=).
    dfa342b5
    History
    cpu/samd21: Avoid clearing interrupt bits unintentionally
    Joakim Nohlgård authored
    The INTENSET, INTENCLR, INTFLAG registers are write-1-to-confirm
    registers, so writing zeroes will not affect anything, on the other
    hand, a compiler generated read-modify-write cycle may unintentionally
    affect more bits than the one being set. Avoid by using direct
    assignment instead of or-assignment (|=) or bitfield writes (.bit.xxx=).