Singleton for cutting tools (#14429)

This commit is contained in:
Scott Lahteine
2019-06-27 23:06:49 -05:00
committed by GitHub
parent 2fde1475cb
commit d7d80418ae
127 changed files with 2773 additions and 2675 deletions

View File

@ -57,12 +57,14 @@ char* i8tostr3(const int8_t x) {
return &conv[4];
}
// Convert unsigned 16bit int to string 123 format
char* ui16tostr3(const uint16_t xx) {
// Convert unsigned 16bit int to string 12345 format
char* ui16tostr5(const uint16_t xx) {
conv[2] = RJDIGIT(xx, 10000);
conv[3] = RJDIGIT(xx, 1000);
conv[4] = RJDIGIT(xx, 100);
conv[5] = RJDIGIT(xx, 10);
conv[6] = DIGIMOD(xx, 1);
return &conv[4];
return &conv[2];
}
// Convert unsigned 16bit int to string 1234 format
@ -74,6 +76,14 @@ char* ui16tostr4(const uint16_t xx) {
return &conv[3];
}
// Convert unsigned 16bit int to string 123 format
char* ui16tostr3(const uint16_t xx) {
conv[4] = RJDIGIT(xx, 100);
conv[5] = RJDIGIT(xx, 10);
conv[6] = DIGIMOD(xx, 1);
return &conv[4];
}
// Convert signed 16bit int to rj string with 123 or -12 format
char* i16tostr3(const int16_t x) {
int xx = x;
@ -215,12 +225,7 @@ char* ftostr54sign(const float &f, char plus/*=' '*/) {
// Convert unsigned float to rj string with 12345 format
char* ftostr5rj(const float &f) {
const long i = ((f < 0 ? -f : f) * 10 + 5) / 10;
conv[2] = RJDIGIT(i, 10000);
conv[3] = RJDIGIT(i, 1000);
conv[4] = RJDIGIT(i, 100);
conv[5] = RJDIGIT(i, 10);
conv[6] = DIGIMOD(i, 1);
return &conv[2];
return ui16tostr5(i);
}
// Convert signed float to string with +1234.5 format

View File

@ -32,12 +32,15 @@ char* ui8tostr3(const uint8_t i);
// Convert int8_t to string with 123 format
char* i8tostr3(const int8_t x);
// Convert uint16_t to string with 123 format
char* ui16tostr3(const uint16_t x);
// Convert uint16_t to string with 12345 format
char* ui16tostr5(const uint16_t x);
// Convert uint16_t to string with 1234 format
char* ui16tostr4(const uint16_t x);
// Convert uint16_t to string with 123 format
char* ui16tostr3(const uint16_t x);
// Convert int16_t to string with 123 format
char* i16tostr3(const int16_t x);