From be88ee1937ae73ad05b54c8b526cd6e09ceeca8a Mon Sep 17 00:00:00 2001 From: Brendan Haines Date: Sat, 31 May 2025 22:39:22 -0600 Subject: [PATCH] disable a bunch of print statements to speed things up --- firmware/app/src/bt_services.c | 2 +- firmware/app/src/main.c | 62 +++++++++++++++++----------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/firmware/app/src/bt_services.c b/firmware/app/src/bt_services.c index f618b8a..df26828 100644 --- a/firmware/app/src/bt_services.c +++ b/firmware/app/src/bt_services.c @@ -33,7 +33,7 @@ static ssize_t read_sensors(struct bt_conn *conn, const struct bt_gatt_attr *att const char *value = attr->user_data; size_t size = sizeof(sensors_raw_t); - LOG_INF("Attribute read, handle: %u, conn: %p, bytes: %d", attr->handle, (void *)conn, size); + // LOG_INF("Attribute read, handle: %u, conn: %p, bytes: %d", attr->handle, (void *)conn, size); return bt_gatt_attr_read(conn, attr, buf, len, offset, value, size); } diff --git a/firmware/app/src/main.c b/firmware/app/src/main.c index 429f4fe..4090402 100644 --- a/firmware/app/src/main.c +++ b/firmware/app/src/main.c @@ -331,40 +331,40 @@ int thread_sensors(void) values.mag_z = NAN; set_sensors(&values); - sprintf(str_v, "V :%7.5f", vbat); - sprintf(str_i, "I :%7.5f", current.val1 + current.val2 * 1e-6); - sprintf(str_p, "P :%7.4f", pressure.val1 + pressure.val2 * 1e-6); - sprintf(str_t, "T :%7.4f", temperature.val1 + temperature.val2 * 1e-6); - sprintf(str_ax, "AX:%+7.3f", values.accel_x); - sprintf(str_ay, "AY:%+7.3f", values.accel_y); - sprintf(str_az, "AZ:%+7.3f", values.accel_z); - sprintf(str_gx, "GX:%+7.3f", values.gyro_x); - sprintf(str_gy, "GY:%+7.3f", values.gyro_y); - sprintf(str_gz, "GZ:%+7.3f", values.gyro_z); - sprintf(str_az_ref, "Zr:%+7.3f", accel_z_ref.val1 + accel_z_ref.val2 * 1e-6); - sprintf(str_h, "H :%7.3f", humidity.val1 + humidity.val2 * 1e-6); + // sprintf(str_v, "V :%7.5f", vbat); + // sprintf(str_i, "I :%7.5f", current.val1 + current.val2 * 1e-6); + // sprintf(str_p, "P :%7.4f", pressure.val1 + pressure.val2 * 1e-6); + // sprintf(str_t, "T :%7.4f", temperature.val1 + temperature.val2 * 1e-6); + // sprintf(str_ax, "AX:%+7.3f", values.accel_x); + // sprintf(str_ay, "AY:%+7.3f", values.accel_y); + // sprintf(str_az, "AZ:%+7.3f", values.accel_z); + // sprintf(str_gx, "GX:%+7.3f", values.gyro_x); + // sprintf(str_gy, "GY:%+7.3f", values.gyro_y); + // sprintf(str_gz, "GZ:%+7.3f", values.gyro_z); + // sprintf(str_az_ref, "Zr:%+7.3f", accel_z_ref.val1 + accel_z_ref.val2 * 1e-6); + // sprintf(str_h, "H :%7.3f", humidity.val1 + humidity.val2 * 1e-6); - // LOG_INF("%s\t%s\t%s\t%s", str_v, str_i, str_p, str_t); + // // LOG_INF("%s\t%s\t%s\t%s", str_v, str_i, str_p, str_t); - cfb_framebuffer_clear(display, false); - if (cfb_print(display, str_ay, 0, 0)) - { - LOG_ERR("Failed to print a string"); - } - if (cfb_print(display, str_gy, 0, 16)) - { - LOG_ERR("Failed to print a string"); - } - if (cfb_print(display, str_gz, 0, 16 * 2)) - { - LOG_ERR("Failed to print a string"); - } - if (cfb_print(display, str_ax, 0, 16 * 3)) - { - LOG_ERR("Failed to print a string"); - } + // cfb_framebuffer_clear(display, false); + // if (cfb_print(display, str_ay, 0, 0)) + // { + // LOG_ERR("Failed to print a string"); + // } + // if (cfb_print(display, str_gy, 0, 16)) + // { + // LOG_ERR("Failed to print a string"); + // } + // if (cfb_print(display, str_gz, 0, 16 * 2)) + // { + // LOG_ERR("Failed to print a string"); + // } + // if (cfb_print(display, str_ax, 0, 16 * 3)) + // { + // LOG_ERR("Failed to print a string"); + // } - cfb_framebuffer_finalize(display); + // cfb_framebuffer_finalize(display); k_sleep(K_MSEC(20)); }