Larus glider flight sensor system 3.9.2024
Software-In-The-Loop test and validation system
Loading...
Searching...
No Matches
ascii_support.h
Go to the documentation of this file.
1/***********************************************************************/
25#ifndef ASCII_SUPPORT_H_
26#define ASCII_SUPPORT_H_
27
28#include "embedded_math.h"
29
30char * my_itoa( char * target, int value);
31char * my_ftoa( char * target, float value);
32
33#ifdef __cplusplus
34
35char * utox( char* result, uint32_t value, uint8_t nibbles = 8);
36char * lutox( char* result, uint64_t value);
37
38extern "C"
39 {
40#endif /* __cplusplus */
41
42char* ftoa( char* Buffer, float Value);
43
44float my_atof(const char *s);
45
46inline char * format_2_digits( char * target, uint32_t data)
47{
48 data %= 100;
49 *target++ = (char)(data / 10 + '0');
50 *target++ = (char)(data % 10 + '0');
51 *target = 0; // just be sure string is terminated
52 return target;
53}
54
56inline char *append_string( char *target, const char *source)
57{
58 while( *source)
59 *target++ = *source++;
60 *target = 0; // just to be sure :-)
61 return target;
62}
63
65inline void newline( char * &next)
66{
67 *next++ = '\r';
68 *next++ = '\n';
69 *next = 0;
70}
71
72char * format_integer( char *target, int32_t value);
73
74#ifdef __cplusplus
75 }
76#endif /* __cplusplus */
77
78#endif /* ASCII_SUPPORT_H_ */
char * utox(char *result, uint32_t value, uint8_t nibbles)
char * lutox(char *result, uint64_t value)
float my_atof(const char *s)
char * ftoa(char *Buffer, float Value)
char * format_2_digits(char *target, uint32_t data)
char * my_ftoa(char *target, float value)
char * format_integer(char *target, int32_t value)
signed integer to ASCII returning the string end
void newline(char *&next)
char * append_string(char *target, const char *source)
basically: kind of strcat returning the pointer to the string-end
char * my_itoa(char *target, int value)
float s[2][6]
mathematical vector of arbitrary type and size
Definition vector.h:40
defines platform-dependent algorithms and constants