2015-08-12 05:20 AM
what is the difference between ''uint16_t'' VS ''__IO uint16_t'' ?
2015-08-12 05:26 AM
Typically in one or more header files you'll find something like,
#ifdef __cplusplus
#define __I volatile /*!< defines 'read only' permissions */
#else
#define __I volatile const /*!< defines 'read only' permissions */
#endif
#define __O volatile /*!< defines 'write only' permissions */
#define __IO volatile /*!< defines 'read / write' permissions */
2015-08-12 05:43 AM
volatile is important for peripheral registers, they don't act like memory, and operate independently of the processor, require strict sequencing and reading every time they are used.
2015-08-12 06:08 AM
Hi SamTheMan,
__IO = volatile is a variable that no compiler optimization is applied.A variable should be declared volatile whenever its value could change unexpectedly. -Syrine-2015-08-12 10:23 AM
thank you