1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 08:15:30 +03:00

Added check for valid profile number before changing profile.

This commit is contained in:
Michael Keller 2016-12-29 10:38:49 +13:00
parent d557281f0a
commit ecabbf6d21

View file

@ -1083,6 +1083,9 @@ void saveConfigAndNotify(void)
void changeProfile(uint8_t profileIndex)
{
if (profileIndex >= MAX_PROFILE_COUNT) {
profileIndex = MAX_PROFILE_COUNT - 1;
}
masterConfig.current_profile_index = profileIndex;
writeEEPROM();
readEEPROM();