floats are nice
Some checks failed
Some checks failed
This commit is contained in:
@ -15,4 +15,5 @@ CONFIG_DISPLAY=y
|
||||
CONFIG_LOG=y
|
||||
|
||||
CONFIG_CFB_LOG_LEVEL_DBG=y
|
||||
CONFIG_CHARACTER_FRAMEBUFFER=y
|
||||
CONFIG_CHARACTER_FRAMEBUFFER=y
|
||||
CONFIG_CBPRINTF_FP_SUPPORT=y
|
@ -218,37 +218,37 @@ int main(void)
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
sprintf(str_v, "V:%01d.%06d", voltage.val1, voltage.val2);
|
||||
sprintf(str_i, "I:%01d.%06d", current.val1, current.val2);
|
||||
sprintf(str_p, "P:%03d.%04d", pressure.val1, pressure.val2 / 100);
|
||||
sprintf(str_t, "T:%03d.%04d", temperature.val1, temperature.val2 / 100);
|
||||
sprintf(str_az, "Z:%03d.%04d", accel_z.val1, accel_z.val2 / 100);
|
||||
sprintf(str_az_ref, "Z:%03d.%04d", accel_z_ref.val1, accel_z_ref.val2 / 100);
|
||||
sprintf(str_h, "H:%05d.%06d", humidity.val1, humidity.val2);
|
||||
sprintf(str_v, "V :%7.5f", voltage.val1 + voltage.val2 * 1e-6);
|
||||
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_az, "Z :%7.4f", accel_z.val1 + accel_z.val2 * 1e-6);
|
||||
sprintf(str_az_ref, "Zr:%7.4f", accel_z_ref.val1 + accel_z_ref.val2 * 1e-6);
|
||||
sprintf(str_h, "H :%7.5f", humidity.val1 + humidity.val2 * 1e-6);
|
||||
|
||||
// printf("%s\t%s\t%s\t%s\n", str_v, str_i, str_p, str_t);
|
||||
|
||||
cfb_framebuffer_clear(dev, false);
|
||||
if (cfb_print(dev, str_v, 0, 0))
|
||||
if (cfb_print(dev, str_az, 0, 0))
|
||||
{
|
||||
printf("Failed to print a string\n");
|
||||
continue;
|
||||
}
|
||||
if (cfb_print(dev, str_i, 0, 16))
|
||||
{
|
||||
printf("Failed to print a string\n");
|
||||
continue;
|
||||
}
|
||||
if (cfb_print(dev, str_az, 0, 16 * 2))
|
||||
{
|
||||
printf("Failed to print a string\n");
|
||||
continue;
|
||||
}
|
||||
if (cfb_print(dev, str_az_ref, 0, 16 * 3))
|
||||
if (cfb_print(dev, str_az_ref, 0, 16))
|
||||
{
|
||||
printf("Failed to print a string\n");
|
||||
continue;
|
||||
}
|
||||
// if (cfb_print(dev, str_az, 0, 16 * 2))
|
||||
// {
|
||||
// printf("Failed to print a string\n");
|
||||
// continue;
|
||||
// }
|
||||
// if (cfb_print(dev, str_az_ref, 0, 16 * 3))
|
||||
// {
|
||||
// printf("Failed to print a string\n");
|
||||
// continue;
|
||||
// }
|
||||
|
||||
cfb_framebuffer_finalize(dev);
|
||||
#if defined(CONFIG_ARCH_POSIX)
|
||||
|
Reference in New Issue
Block a user