¿ªÔÆÌåÓý

Re: ubitx #v6 Screen Speed Mod #v6


 

I see no reason to do the memset in this function.? Removed it.? Less program space used and less processing cycles.
Added a rounding option, that is commented out.? More program space and processing cycles :)
Wrote a simple sketch that ran through a list of frequencies and then printed buff to STDOUT.
I will get a GitHub account so I can play better in the future.

void formatFreq(long f, char *buff) {
? // tks Jack Purdum W8TEE
? // replaced fsprint commmands by str commands for code size reduction
? // AG5TX
? // resolved issue with format below 1 MHz, there is an issue below 100 Hz
?
? // rounding uses more bytes of program storage space and adds processing cycles
? // uncomment if you want this feature
?
? // round up for when only 2 digits after decimal point are used
? /*
? if(f%10 >= 5) {
? ? f += 5;
? }
? */
?
? ultoa(f, b, DEC);
? int g = strlen(b);
?
? for (int i = g; i < 8 ; i++){
? ? ?strcat(buff, " ");
? }
?
? strncat(buff, b, g-3);
? strcat(buff, ".");
? strncat(buff, &b[g-3], 2); // could set last arg to 3 for 3 digits after dec point, just don't round up.
}

Join [email protected] to automatically receive all group messages.