Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New fitness and Sensor Fusion App icons #363

Merged
merged 2 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/applications/fitness/fitness_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ static void fitness_app_stop(void);

static void step_sample_work(struct k_work *work);

ZSW_LV_IMG_DECLARE(move);
ZSW_LV_IMG_DECLARE(fitness_app_icon);

static application_t app = {
.name = "Fitness",
.start_func = fitness_app_start,
.stop_func = fitness_app_stop,
.icon = ZSW_LV_IMG_USE(move),
.icon = ZSW_LV_IMG_USE(fitness_app_icon),
};

static zsw_history_t fitness_history_context;
Expand Down
4 changes: 2 additions & 2 deletions app/src/applications/sensor_fusion/fusion_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ static void fusion_app_start(lv_obj_t *root, lv_group_t *group);
static void fusion_app_stop(void);
static void on_close_fusion(void);

ZSW_LV_IMG_DECLARE(move);
ZSW_LV_IMG_DECLARE(imu_sensor_icon);

ZBUS_CHAN_DECLARE(periodic_event_100ms_chan);
ZBUS_LISTENER_DEFINE(accel_app_lis, zbus_fetch_fusion_data_callback);

static application_t app = {
.name = "Sensor Fusion",
.icon = ZSW_LV_IMG_USE(move),
.icon = ZSW_LV_IMG_USE(imu_sensor_icon),
.start_func = fusion_app_start,
.stop_func = fusion_app_stop
};
Expand Down
Binary file not shown.
Binary file added app/src/images/binaries/S/imu_sensor_icon.bin
Binary file not shown.
174 changes: 174 additions & 0 deletions app/src/images/icons/fitness_app_icon.c

Large diffs are not rendered by default.

174 changes: 174 additions & 0 deletions app/src/images/icons/imu_sensor_icon.c

Large diffs are not rendered by default.

19 changes: 16 additions & 3 deletions app/src/sensor_fusion/zsw_sensor_fusion.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,26 @@ static void sensor_fusion_timeout(struct k_work *)
k_work_schedule(&sensor_fusion_timer, K_MSEC((1000 / SAMPLE_RATE_HZ) - (k_uptime_get_32() - start)));
}

void zsw_sensor_fusion_init(void)
int zsw_sensor_fusion_init(void)
{
#if CONFIG_SEND_SENSOR_READING_OVER_RTT
SEGGER_RTT_ConfigUpBuffer(CONFIG_SENSOR_LOG_RTT_TRANSFER_CHANNEL, "FUSION",
up_buffer, UP_BUFFER_SIZE,
SEGGER_RTT_MODE_NO_BLOCK_SKIP);
#endif
zsw_imu_feature_enable(ZSW_IMU_FEATURE_GYRO, false);
zsw_magnetometer_set_enable(true);
int ret;

ret = zsw_imu_feature_enable(ZSW_IMU_FEATURE_GYRO, false);
if (ret != 0) {
LOG_ERR("zsw_imu_feature_enable err: %d", ret);
return ret;
}

ret = zsw_magnetometer_set_enable(true);
if (ret != 0) {
LOG_ERR("zsw_magnetometer_set_enable err: %d", ret);
return ret;
}

memset(&ahrs, 0, sizeof(ahrs));

Expand All @@ -203,6 +214,8 @@ void zsw_sensor_fusion_init(void)
FusionAhrsSetSettings(&ahrs, &settings);

k_work_schedule(&sensor_fusion_timer, K_MSEC(1000 / SAMPLE_RATE_HZ));

return 0;
}

void zsw_sensor_fusion_deinit(void)
Expand Down
2 changes: 1 addition & 1 deletion app/src/sensor_fusion/zsw_sensor_fusion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ typedef struct sensor_fusion {
float z;
} sensor_fusion_t;

void zsw_sensor_fusion_init(void);
int zsw_sensor_fusion_init(void);

void zsw_sensor_fusion_deinit(void);

Expand Down