Skip to content

Commit

Permalink
feat(favourites): adds left and right button band select to favourites
Browse files Browse the repository at this point in the history
  • Loading branch information
JyeSmith committed Sep 4, 2018
1 parent d0de769 commit 63d55b4
Showing 1 changed file with 40 additions and 6 deletions.
46 changes: 40 additions & 6 deletions src/rx5808-pro-diversity/state_favourites.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,16 @@ void FavouritesStateHandler::onButtonChange(
);
}
if ( changeingChannel ) {
EepromSettings.favouriteChannels[favouritesSelectedChannel] += 8;
if ( EepromSettings.favouriteChannels[favouritesSelectedChannel] > CHANNELS_SIZE - 1 ) {
EepromSettings.favouriteChannels[favouritesSelectedChannel] -= CHANNELS_SIZE;
}
Receiver::setChannel(EepromSettings.favouriteChannels[favouritesSelectedChannel]);
EepromSettings.markDirty();
#ifdef FENIX_QUADVERSITY

#else
EepromSettings.favouriteChannels[favouritesSelectedChannel] += 8;
if ( EepromSettings.favouriteChannels[favouritesSelectedChannel] > CHANNELS_SIZE - 1 ) {
EepromSettings.favouriteChannels[favouritesSelectedChannel] -= CHANNELS_SIZE;
}
Receiver::setChannel(EepromSettings.favouriteChannels[favouritesSelectedChannel]);
EepromSettings.markDirty();
#endif
}
}
else if (
Expand Down Expand Up @@ -144,5 +148,35 @@ void FavouritesStateHandler::onButtonChange(
EepromSettings.markDirty();
}
}
else if (
pressType == Buttons::PressType::SHORT &&
button == Button::LEFT_PRESSED
) {
if ( !changeingChannel ) {
}
if ( changeingChannel ) {
EepromSettings.favouriteChannels[favouritesSelectedChannel] -= 8;
if ( EepromSettings.favouriteChannels[favouritesSelectedChannel] > CHANNELS_SIZE - 1) {
EepromSettings.favouriteChannels[favouritesSelectedChannel] += CHANNELS_SIZE;
}
Receiver::setChannel(EepromSettings.favouriteChannels[favouritesSelectedChannel]);
EepromSettings.markDirty();
}
}
else if (
pressType == Buttons::PressType::SHORT &&
button == Button::RIGHT_PRESSED
) {
if ( !changeingChannel ) {
}
if ( changeingChannel ) {
EepromSettings.favouriteChannels[favouritesSelectedChannel] += 8;
if ( EepromSettings.favouriteChannels[favouritesSelectedChannel] > CHANNELS_SIZE - 1 ) {
EepromSettings.favouriteChannels[favouritesSelectedChannel] -= CHANNELS_SIZE;
}
Receiver::setChannel(EepromSettings.favouriteChannels[favouritesSelectedChannel]);
EepromSettings.markDirty();
}
}
}

0 comments on commit 63d55b4

Please sign in to comment.