Moved buffer closer to where needed
This commit is contained in:
parent
f751833a88
commit
0a52110d47
6
uart.hpp
6
uart.hpp
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user