1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

Fix arming disable flag and OSD warning buffer size (#14057)

* Fix missing arming disable flag

* Add test for array length

* Fix array init && add getter

* armingDisableFlagNames is no longer external

* Update array

* Thanks ledvinap

* Revert designated initializers

* Increase OSD Warnings buffer size

* Remove standard libraries

* Refactor

* Update pos

* Restore comment

* Micro optimize

* Extract condition

* Another optimization

* Use cmpTimeUs (not cmp32)

* Revert STATIC ASSERT string change

* Adjust esc sensor warning

* I like this

* Optimize intended minimum width

* revert Optimize intended minimum width

* Is dshot telemetry and esc telemetry exclusive

* Fix conflict

* OSD - WARNINGS_PREFERRED_SIZE

* OSD - Return NONE for no flag
This commit is contained in:
Mark Haslinghuis 2024-12-06 15:33:25 +01:00 committed by GitHub
parent 3138141cd1
commit 4b78aeec51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 77 additions and 71 deletions

View file

@ -1301,7 +1301,7 @@ case MSP_NAME:
{
bool isBlinking;
uint8_t displayAttr;
char warningsBuffer[OSD_FORMAT_MESSAGE_BUFFER_SIZE];
char warningsBuffer[OSD_WARNINGS_MAX_SIZE + 1];
renderOsdWarning(warningsBuffer, &isBlinking, &displayAttr);
const uint8_t warningsLen = strlen(warningsBuffer);
@ -1311,9 +1311,7 @@ case MSP_NAME:
}
sbufWriteU8(dst, displayAttr); // see displayPortSeverity_e
sbufWriteU8(dst, warningsLen); // length byte followed by the actual characters
for (unsigned i = 0; i < warningsLen; i++) {
sbufWriteU8(dst, warningsBuffer[i]);
}
sbufWriteData(dst, warningsBuffer, warningsLen);
break;
}
#endif