Moved buffer closer to where needed
This commit is contained in:
1 parent
f751833a88
commit
0a52110d47
1 file changed
+3
-3
@@ -123,9 +123,6 @@ class Uart {
|
||||
constexpr char alphaChar = (LowerCase) ? 'a' : 'A';
|
||||
constexpr size_t numDigits = detail::maxNumDigits<T, Base>();
|
||||
|
||||
data_t buffer[numDigits];
|
||||
data_t *bufEnd = buffer + numDigits - 1;
|
||||
|
||||
T digits = val;
|
||||
|
||||
if (digits < 0) {
|
||||
@@ -133,6 +130,9 @@ class Uart {
|
||||
txByte('-');
|
||||
}
|
||||
|
||||
data_t buffer[numDigits];
|
||||
data_t *bufEnd = buffer + numDigits - 1;
|
||||
|
||||
do {
|
||||
data_t lastDigit = digits % Base;
|
||||
*bufEnd-- = (lastDigit < 10) ? ('0' + lastDigit) : (alphaChar + lastDigit - 10);
|
||||
|
||||
Reference in new issue
Block a user