[Print] Chore: uncrustify formatting

pull/1532/head
jgromes 2025-07-19 19:27:31 +02:00
rodzic b2963ef232
commit 45cc32b50a
4 zmienionych plików z 61 dodań i 48 usunięć

Wyświetl plik

@ -22,8 +22,11 @@ size_t RadioLibPrint::println(ITA2String& ita2) {
size_t RadioLibPrint::write(const uint8_t* buffer, size_t size) {
size_t n = 0;
while(size--) {
if (write(*buffer++)) n++;
else break;
if(write(*buffer++)) {
n++;
} else {
break;
}
}
return n;
}
@ -246,11 +249,19 @@ size_t RadioLibPrint::printFloat(double number, uint8_t digits) {
size_t n = 0;
char code[] = {0x00, 0x00, 0x00, 0x00};
if (isnan(number)) strcpy(code, "nan");
if (isinf(number)) strcpy(code, "inf");
if (number > (double)4294967040.0) strcpy(code, "ovf"); // constant determined empirically
if (number < (double)-4294967040.0) strcpy(code, "ovf"); // constant determined empirically
if(isnan(number)) {
strcpy(code, "nan");
}
if(isinf(number)) {
strcpy(code, "inf");
}
if(number > (double)4294967040.0) {
strcpy(code, "ovf"); // constant determined empirically
}
if(number < (double)-4294967040.0) {
strcpy(code, "ovf"); // constant determined empirically
}
if(code[0] != 0x00) {
if(this->encoding == RADIOLIB_ITA2) {
ITA2String ita2 = ITA2String(code);

Wyświetl plik

@ -18,7 +18,9 @@ class RadioLibPrint {
public:
virtual size_t write(uint8_t) = 0;
size_t write(const char* str) {
if (str == NULL) return 0;
if(str == NULL) {
return 0;
}
return write(reinterpret_cast<const uint8_t*>(str), strlen(str));
}
virtual size_t write(const uint8_t* buffer, size_t size);