Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

depreciate uint64ToString() #10

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions transmitter/transmitter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ void drawSettingsMenu() {
if(currentSetting == ADDRESS || currentSetting == RESET){
tString = uint64ToAddress(value);
}else{
tString = uint64ToString(value);
tString = String(value);
}
}

Expand Down Expand Up @@ -1053,13 +1053,16 @@ uint64_t generateAddress()

String uint64ToString(uint64_t number)
{
unsigned long part1 = (unsigned long)((number >> 32)); // Bitwise Right Shift
unsigned long part2 = (unsigned long)((number));

if(part1 == 0){
return String(part2, DEC);
}
return String(part1, DEC) + String(part2, DEC);
String result = "";
uint8_t base = 10;

do {
char c = (input % base) + '0';
input /= base;
result += c;
} while (input);

return result;
}

String uint64ToAddress(uint64_t number)
Expand Down