Преглед на файлове

ftostr12ns: change xx from long to int

flash: -44
RAM: 0

Largest expected number is 999 after the multiplication by 100.

I measured the execution time drops from ~170us to ~73us.
Guðni Már Gilbert преди 2 години
родител
ревизия
7711969e57
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      Firmware/conv2str.cpp

+ 1 - 1
Firmware/conv2str.cpp

@@ -104,7 +104,7 @@ char *ftostr43(const float &x, uint8_t offset)
 //Float to string with 1.23 format
 char *ftostr12ns(const float &x)
 {
-  long xx = x * 100;
+  int xx = x * 100;
 
   xx = abs(xx);
   conv[0] = (xx / 100) % 10 + '0';