application: minor, rename print_voltage to printf_fpu
This commit is contained in:
parent
312da80d6b
commit
a90c189eb3
|
@ -92,7 +92,7 @@ size_t putc(char c)
|
||||||
* @param[in] precision number of digits after comma to print
|
* @param[in] precision number of digits after comma to print
|
||||||
* @note %f is used to force scientific notation
|
* @note %f is used to force scientific notation
|
||||||
*/
|
*/
|
||||||
static void print_voltage(double voltage, uint8_t precision)
|
static void print_fpu(double voltage, uint8_t precision)
|
||||||
{
|
{
|
||||||
uint32_t multiplier = 1;
|
uint32_t multiplier = 1;
|
||||||
for (uint8_t i = 0; i < precision; i++) {
|
for (uint8_t i = 0; i < precision; i++) {
|
||||||
|
@ -139,7 +139,7 @@ static void print_voltage_target(void)
|
||||||
gpio_set(GPIO_PORT(TARGET_EN), GPIO_PIN(TARGET_EN)); // ensure the level shifters pulling up the signals are not enabled
|
gpio_set(GPIO_PORT(TARGET_EN), GPIO_PIN(TARGET_EN)); // ensure the level shifters pulling up the signals are not enabled
|
||||||
float* voltages = measure_voltages(); // measure voltages
|
float* voltages = measure_voltages(); // measure voltages
|
||||||
puts("target voltage: ");
|
puts("target voltage: ");
|
||||||
print_voltage(voltages[1], 2);
|
print_fpu(voltages[1], 2);
|
||||||
puts(" V");
|
puts(" V");
|
||||||
if (voltages[1] > 3.25) {
|
if (voltages[1] > 3.25) {
|
||||||
puts(" (warning: signal voltage may exceed 3.30 V limit)");
|
puts(" (warning: signal voltage may exceed 3.30 V limit)");
|
||||||
|
@ -226,7 +226,7 @@ static void command_voltages(void* argument)
|
||||||
mux_select(i); // select the channel
|
mux_select(i); // select the channel
|
||||||
voltages = measure_voltages(); // measure raw voltages
|
voltages = measure_voltages(); // measure raw voltages
|
||||||
puts(" ");
|
puts(" ");
|
||||||
print_voltage(voltages[2], 2);
|
print_fpu(voltages[2], 2);
|
||||||
puts(" V\n");
|
puts(" V\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue