disable a bunch of print statements to speed things up

This commit is contained in:
2025-05-31 22:39:22 -06:00
parent 6ab68beb99
commit be88ee1937
2 changed files with 32 additions and 32 deletions

View File

@ -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);
}

View File

@ -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));
}