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

Merge pull request #1919 from mikeller/add_profile_index_check

Added check for valid profile number before changing profile.
This commit is contained in:
Michael Keller 2016-12-29 13:26:36 +13:00 committed by GitHub
commit 4191afdfdb

View file

@ -1084,6 +1084,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();