Research Article

Embedded System Based on an ARM Microcontroller to Analyze Heart Rate Variability in Real Time Using Wavelets

Code 1

Efficient use of RAM memory using structures and unions.
typedef union
unsigned uint8_tAllFlags;
struct
unsigned flag_0:1;
unsigned flag_1:1;
unsigned flag_2:1;
unsigned flag_3:1;
unsigned flag_4:1;
unsigned flag_5:1;
unsigned flag_6:1;
unsigned flag_7:1;
;
DeviceStatusFlags;
DeviceStatusFlags Flags;
Used Bytes in RAM: 1
uint8_t flag_0;
uint8_t flag_1;
uint8_t flag_2;
uint8_t flag_3;
uint8_t flag_4;
uint8_t flag_5;
uint8_t flag_6;
uint8_t flag_7;
Used Bytes in RAM: 8