这是indexloc提供的服务,不要输入任何密码
Skip to content

Memory usage optimization #4

@Ciusss89

Description

@Ciusss89
  1. files energy_meter/main.c and energy_meter/core.h
  2. In order to optimize the system resource, we have to reduce the memory required by tread sampling and logging.
char em_sampling_stack[THREAD_STACKSIZE_SMALL];
char em_logging_stack[THREAD_STACKSIZE_LARGE];
  1. Instead, to use a type double for the struct we can use two uint8_t to store the decimal and the unit part
/* @em_realtime contains all notable datas:
 * -rms_c/v▸     : real time values, they're update each sec
 * -rms_*_1m▸    : last minute average, they're update each 60 sec
 * -log_1m_ready : true when last minute average is ready
 */
struct em_realtime {
▸       double rms_c, rms_v;
▸       double rms_c_1m, rms_v_1m;
▸       bool log_1m_ready;
};

/* @em_loggin contains all temporary datas
 */
struct em_loggin {
▸       double c[60], v[60];
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions