mirror of
https://github.com/esp8266/Arduino.git
synced 2025-05-05 07:24:48 +03:00
Revert to explicit calculation of modulo, saving 16 bytes in IROM.
This commit is contained in:
parent
af53772e7b
commit
7e1d891e84
@ -280,8 +280,9 @@ size_t Print::printNumber(unsigned long n, uint8_t base) {
|
||||
base = 10;
|
||||
|
||||
do {
|
||||
char c = n % base;
|
||||
unsigned long m = n;
|
||||
n /= base;
|
||||
char c = m - base * n;
|
||||
|
||||
*--str = c < 10 ? c + '0' : c + 'A' - 10;
|
||||
} while(n);
|
||||
@ -300,8 +301,9 @@ size_t Print::printNumber(unsigned long long n, uint8_t base) {
|
||||
base = 10;
|
||||
|
||||
do {
|
||||
char c = n % base;
|
||||
unsigned long m = n;
|
||||
n /= base;
|
||||
char c = m - base * n;
|
||||
|
||||
*--str = c < 10 ? c + '0' : c + 'A' - 10;
|
||||
} while(n);
|
||||
|
Loading…
x
Reference in New Issue
Block a user