Commit b1f907a5 authored by MagoKimbra's avatar MagoKimbra

Fix lcd babystepping

parent 1e7265b6
...@@ -2542,10 +2542,17 @@ char* ftostr32sp(const float& x) { ...@@ -2542,10 +2542,17 @@ char* ftostr32sp(const float& x) {
return conv; return conv;
} }
// Convert int to lj string with +123.0 format // Convert signed int to lj string with +012 / -012 format
char* itostr31(const int& x) { char* itostr3sign(const int& x) {
conv[0] = x >= 0 ? '+' : '-'; int xx;
int xx = abs(x); if (x >= 0) {
conv[0] = '+';
xx = x;
}
else {
conv[0] = '-';
xx = -x;
}
conv[1] = (xx / 100) % 10 + '0'; conv[1] = (xx / 100) % 10 + '0';
conv[2] = (xx / 10) % 10 + '0'; conv[2] = (xx / 10) % 10 + '0';
conv[3] = xx % 10 + '0'; conv[3] = xx % 10 + '0';
......
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
#endif // NEWPANEL #endif // NEWPANEL
char* itostr2(const uint8_t& x); char* itostr2(const uint8_t& x);
char* itostr31(const int& xx); char* itostr3sign(const int& x);
char* itostr3(const int& xx); char* itostr3(const int& xx);
char* itostr3left(const int& xx); char* itostr3left(const int& xx);
char* itostr4(const int& xx); char* itostr4(const int& xx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment