Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.

Commit

Permalink
fix: Removed keyword
Browse files Browse the repository at this point in the history
Removed static keyword to prevent persisting
accelerometer data values. Closes #23

Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
  • Loading branch information
simensrostad committed Mar 12, 2020
1 parent 79e222e commit babce3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
6 changes: 0 additions & 6 deletions src/cloud_codec/cloud_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ struct cloud_data {
s64_t dev_modem_data_ts;
};

struct cloud_data_time {
s64_t epoch;
s64_t update_time;
s64_t delta_time;
};

int cloud_decode_response(char *input, struct cloud_data *cloud_data);

int cloud_encode_sensor_data(struct cloud_msg *output,
Expand Down
11 changes: 5 additions & 6 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static int modem_configure(void)
LOG_INF("This may take several minutes.");
err = lte_lc_init_and_connect();
if (err) {
LOG_ERR("lte_lc_init_connect, error: %d");
LOG_ERR("lte_lc_init_connect, error: %d", err);
return err;
}

Expand Down Expand Up @@ -477,12 +477,11 @@ static void cloud_send_buffered_data_work_fn(struct k_work *work)

static void movement_timeout_work_fn(struct k_work *work)
{
int err;

if (!cloud_data.active) {
LOG_INF("Movement timeout triggered");
int err = lte_connection_check();
if (err) {
LOG_ERR("lte_connection_check, error: %d");
LOG_ERR("lte_connection_check, error: %d", err);
error_handler(err);
}
cloud_update();
Expand Down Expand Up @@ -515,7 +514,7 @@ static void work_init(void)
static void adxl362_trigger_handler(struct device *dev,
struct sensor_trigger *trig)
{
static struct sensor_value accel[3];
struct sensor_value accel[3];

switch (trig->type) {
case SENSOR_TRIG_THRESHOLD:
Expand Down Expand Up @@ -883,7 +882,7 @@ void main(void)
/*Check lte connection*/
err = lte_connection_check();
if (err) {
LOG_ERR("lte_connection_check, error: %d");
LOG_ERR("lte_connection_check, error: %d", err);
error_handler(err);
}

Expand Down

0 comments on commit babce3a

Please sign in to comment.