Skip to main content
deleted 1 character in body
Source Link

It'sIts format is like this:

It's format is like this:

Its format is like this:

added 228 characters in body
Source Link

This answer covers: Which Arduinos support ATOMIC_BLOCK? And how can I duplicate this concept in C with __attribute__((__cleanup__(func_to_call_when_x_exits_scope))) and in C++ with class constructors and destructors?.

This answer covers: Which Arduinos support ATOMIC_BLOCK? And how can I duplicate this concept in C with __attribute__((__cleanup__(func_to_call_when_x_exits_scope))) and in C++ with class constructors and destructors?.

added 136 characters in body
Source Link
  1. Nick Gammon's excellent "Interrupts" page, which is how I first got started learning about interrupts in 2012~2014 or so: https://gammon.com.au/interrupts.
  2. Other answer's I've done about interrupts, locks/guards, and things:
    1. global volatile variable not being updated in ISR
    2. My own race condition problem: https://stackoverflow.com/questions/36381932/c-decrementing-an-element-of-a-single-byte-volatile-array-is-not-atomic-why
    3. My own race condition solution, demonstrating 3 (or 4, depending on how you look at it) ways to enforce "atomic access guards" on AVR-based 8-bit Arduinos: https://stackoverflow.com/questions/36381932/c-decrementing-an-element-of-a-single-byte-volatile-array-is-not-atomic-why/39693278#39693278
  3. What's that weird type##_OBJECT_NAME thing I did in the macro anyway? Read more about macro token concatenation using the ## preprocessor operator in the official gcc C++ user manual here: https://gcc.gnu.org/onlinedocs/cpp/Concatenation.html. Note: this also works in C of course.
  4. gcc inline or __inline__, and static inline or static __inline__ rules: https://gcc.gnu.org/onlinedocs/gcc/Inline.html
  1. Nick Gammon's excellent "Interrupts" page, which is how I first got started learning about interrupts in 2012~2014 or so: https://gammon.com.au/interrupts.
  2. Other answer's I've done about interrupts, locks/guards, and things:
    1. global volatile variable not being updated in ISR
    2. My own race condition problem: https://stackoverflow.com/questions/36381932/c-decrementing-an-element-of-a-single-byte-volatile-array-is-not-atomic-why
    3. My own race condition solution, demonstrating 3 (or 4, depending on how you look at it) ways to enforce "atomic access guards" on AVR-based 8-bit Arduinos: https://stackoverflow.com/questions/36381932/c-decrementing-an-element-of-a-single-byte-volatile-array-is-not-atomic-why/39693278#39693278
  3. What's that weird type##_OBJECT_NAME thing I did in the macro anyway? Read more about macro token concatenation using the ## preprocessor operator in the official gcc C++ user manual here: https://gcc.gnu.org/onlinedocs/cpp/Concatenation.html. Note: this also works in C of course.
  1. Nick Gammon's excellent "Interrupts" page, which is how I first got started learning about interrupts in 2012~2014 or so: https://gammon.com.au/interrupts.
  2. Other answer's I've done about interrupts, locks/guards, and things:
    1. global volatile variable not being updated in ISR
    2. My own race condition problem: https://stackoverflow.com/questions/36381932/c-decrementing-an-element-of-a-single-byte-volatile-array-is-not-atomic-why
    3. My own race condition solution, demonstrating 3 (or 4, depending on how you look at it) ways to enforce "atomic access guards" on AVR-based 8-bit Arduinos: https://stackoverflow.com/questions/36381932/c-decrementing-an-element-of-a-single-byte-volatile-array-is-not-atomic-why/39693278#39693278
  3. What's that weird type##_OBJECT_NAME thing I did in the macro anyway? Read more about macro token concatenation using the ## preprocessor operator in the official gcc C++ user manual here: https://gcc.gnu.org/onlinedocs/cpp/Concatenation.html. Note: this also works in C of course.
  4. gcc inline or __inline__, and static inline or static __inline__ rules: https://gcc.gnu.org/onlinedocs/gcc/Inline.html
added 11 characters in body
Source Link
Loading
added 35 characters in body
Source Link
Loading
deleted 3 characters in body
Source Link
Loading
deleted 3 characters in body
Source Link
Loading
added 450 characters in body
Source Link
Loading
added 450 characters in body
Source Link
Loading
deleted 2 characters in body
Source Link
Loading
added 95 characters in body
Source Link
Loading
added 1693 characters in body
Source Link
Loading
added 1693 characters in body
Source Link
Loading
added 1693 characters in body
Source Link
Loading
added 4673 characters in body
Source Link
Loading
Source Link
Loading