Small bug fix and ioTag_t cast

This commit is contained in:
blckmn 2016-12-31 20:27:44 +11:00
parent e2ad32cd5e
commit aaa2ba4883
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@
#define DEFIO_REC_INDEXED(idx) (ioRecs + (idx))
// ioTag_t accessor macros
#define DEFIO_TAG_MAKE(gpioid, pin) ((((gpioid) + 1) << 4) | (pin))
#define DEFIO_TAG_MAKE(gpioid, pin) ((ioTag_t)((((gpioid) + 1) << 4) | (pin)))
#define DEFIO_TAG_ISEMPTY(tag) (!(tag))
#define DEFIO_TAG_GPIOID(tag) (((tag) >> 4) - 1)
#define DEFIO_TAG_PIN(tag) ((tag) & 0x0f)

View File

@ -1081,7 +1081,7 @@ void changeProfile(uint8_t profileIndex)
void changeControlRateProfile(uint8_t profileIndex)
{
if (profileIndex > MAX_RATEPROFILES) {
if (profileIndex >= MAX_RATEPROFILES) {
profileIndex = MAX_RATEPROFILES - 1;
}
setControlRateProfile(profileIndex);