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

Commit

Permalink
fix: update ext_sensors API
Browse files Browse the repository at this point in the history
Signed-off-by: Simen S. Røstad <[email protected]>
  • Loading branch information
simensrostad committed Oct 27, 2020
1 parent 23ba7b6 commit 3da3601
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/ext_sensors/ext_sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static struct env_sensor accel_sensor = {
.dev_name = CONFIG_ACCELEROMETER_DEV_NAME
};

static ext_sensors_evt_handler_t m_evt_handler;
static ext_sensor_handler_t m_evt_handler;
static double accelerometer_threshold;

static void accelerometer_trigger_handler(struct device *dev,
Expand Down Expand Up @@ -71,7 +71,7 @@ static void accelerometer_trigger_handler(struct device *dev,
}
}

int ext_sensors_init(ext_sensors_evt_handler_t handler)
int ext_sensors_init(ext_sensor_handler_t handler)
{
if (handler == NULL) {
LOG_INF("External sensor handler NULL!");
Expand Down Expand Up @@ -168,7 +168,7 @@ int ext_sensors_humidity_get(double *ext_hum)
return 0;
}

void ext_sensors_accelerometer_threshold_set(int acc_thres)
void ext_sensors_mov_thres_set(int acc_thres)
{
if (acc_thres == 0) {
accelerometer_threshold = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/ext_sensors/ext_sensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct ext_sensor_evt {
*
* @param[in] evt The event and any associated parameters.
*/
typedef void (*ext_sensors_evt_handler_t)(
typedef void (*ext_sensor_handler_t)(
const struct ext_sensor_evt *const evt);

/**
Expand All @@ -59,7 +59,7 @@ typedef void (*ext_sensors_evt_handler_t)(
*
* @return 0 on success or negative error value on failure.
*/
int ext_sensors_init(ext_sensors_evt_handler_t handler);
int ext_sensors_init(ext_sensor_handler_t handler);

/**
* @brief Get temperature from library.
Expand All @@ -86,7 +86,7 @@ int ext_sensors_humidity_get(double *ext_hum);
*
* @return 0 on success or negative error value on failure.
*/
void ext_sensors_accelerometer_threshold_set(int acc_thresh);
void ext_sensors_mov_thres_set(int acc_thresh);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ void cloud_event_handler(const struct cloud_backend *const backend,
}
/* Set new accelerometer threshold and GPS timeout. */
gps_cfg.timeout = cfg.gpst;
ext_sensors_accelerometer_threshold_set(cfg.acct);
ext_sensors_mov_thres_set(cfg.acct);
k_delayed_work_submit(&device_config_send_work, K_NO_WAIT);

/* Start movement timer which triggers every movement timeout.
Expand Down

0 comments on commit 3da3601

Please sign in to comment.