1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Merge pull request #3659 from martinbudden/bf_blackbox_tidy

Blackbox header and function name tidy
This commit is contained in:
Martin Budden 2017-07-29 14:48:41 +01:00 committed by GitHub
commit 47a0f15b7d
6 changed files with 6 additions and 6 deletions

View file

@ -1143,7 +1143,7 @@ static bool sendFieldDefinition(char mainFrameChar, char deltaFrameChar, const v
// The first header is a field name
if (xmitState.headerIndex == 0) {
blackboxPrint(def->name);
blackboxWriteString(def->name);
// Do we need to print an index in brackets after the name?
if (def->fieldNameIndex != -1) {
@ -1359,7 +1359,7 @@ void blackboxLogEvent(FlightLogEvent event, flightLogEventData_t *data)
blackboxWriteUnsignedVB(data->loggingResume.currentTime);
break;
case FLIGHT_LOG_EVENT_LOG_END:
blackboxPrint("End of log");
blackboxWriteString("End of log");
blackboxWrite(0);
break;
}

View file

@ -51,7 +51,7 @@ void blackboxPrintfHeaderLine(const char *name, const char *fmt, ...)
blackboxWrite('H');
blackboxWrite(' ');
blackboxPrint(name);
blackboxWriteString(name);
blackboxWrite(':');
va_start(va, fmt);

View file

@ -19,7 +19,6 @@
int blackboxPrintf(const char *fmt, ...);
void blackboxPrintfHeaderLine(const char *name, const char *fmt, ...);
int blackboxPrint(const char *s);
void blackboxWriteUnsignedVB(uint32_t value);
void blackboxWriteSignedVB(int32_t value);

View file

@ -84,7 +84,7 @@ void blackboxWrite(uint8_t value)
}
// Print the null-terminated string 's' to the blackbox device and return the number of bytes written
int blackboxPrint(const char *s)
int blackboxWriteString(const char *s)
{
int length;
const uint8_t *pos;

View file

@ -39,6 +39,7 @@ extern int32_t blackboxHeaderBudget;
void blackboxOpen(void);
void blackboxWrite(uint8_t value);
int blackboxWriteString(const char *s);
void blackboxDeviceFlush(void);
bool blackboxDeviceFlushForce(void);

View file

@ -246,7 +246,7 @@ PG_REGISTER(blackboxConfig_t, blackboxConfig, PG_BLACKBOX_CONFIG, 0);
int32_t blackboxHeaderBudget;
void mspSerialAllocatePorts(void) {}
void blackboxWrite(uint8_t value) {serialWrite(blackboxPort, value);}
int blackboxPrint(const char *s)
int blackboxWriteString(const char *s)
{
const uint8_t *pos = (uint8_t*)s;
while (*pos) {