Adding more servos
[inav.git] / src / main / io / osd_utils.h
blob7f10f2bf8f94707596b80b3aef2f8b64fe16dafd
1 /*
2 * This file is part of INAV
4 * INAV is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * INAV is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #include <stdint.h>
21 #include <stdbool.h>
23 #include "platform.h"
25 #if defined(USE_OSD) || defined(OSD_UNIT_TEST)
27 int digitCount(int32_t value);
29 /**
30 * Formats a number given in cents, to support non integer values
31 * without using floating point math. Value is always right aligned
32 * and spaces are inserted before the number to always yield a string
33 * of the same length. If the value doesn't fit into the provided length
34 * it will be divided by scale and true will be returned.
36 bool osdFormatCentiNumber(char *buff, int32_t centivalue, uint32_t scale, int maxDecimals, int maxScaledDecimals, int length, bool leadingZeros);
38 #endif