We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, I would like to add support for flight mode to the library, but I'm not quite sure how to do it. In the Arduino file, I added a function:
void sendFlightMode(uint8_t flightMode) { crsf.queuePacket(CRSF_SYNC_BYTE, CRSF_FRAMETYPE_FLIGHT_MODE, &flightMode, sizeof(flightMode)); }
I uncommented the line // CRSF_FRAMETYPE_FLIGHT_MODE = 0x21, //no need to support?'
// CRSF_FRAMETYPE_FLIGHT_MODE = 0x21, //no need to support?'
I don't know how to modify the other library files. Could someone help me?
PETER
The text was updated successfully, but these errors were encountered:
Your flightMode is 1 byte according to your code there, and CRSF defines it as a string. You probably want something like this:
void sendFlightMode(const char *flightMode) { uint8_t len = min(strlen(flightMode), 15); // limit to 15 chars max uint8_t buf[16]; buf[0] = len; memcpy(&buf[1], flightMode, len); crsf.queuePacket(CRSF_SYNC_BYTE, CRSF_FRAMETYPE_FLIGHT_MODE, buf, len+1); } //usage: sendFlightMode("ACRO");
Sorry, something went wrong.
No branches or pull requests
Hello, I would like to add support for flight mode to the library, but I'm not quite sure how to do it. In the Arduino file, I added a function:
void sendFlightMode(uint8_t flightMode) { crsf.queuePacket(CRSF_SYNC_BYTE, CRSF_FRAMETYPE_FLIGHT_MODE, &flightMode, sizeof(flightMode)); }
I uncommented the line
// CRSF_FRAMETYPE_FLIGHT_MODE = 0x21, //no need to support?'
I don't know how to modify the other library files. Could someone help me?
PETER
The text was updated successfully, but these errors were encountered: