Small bug fix and ioTag_t cast
This commit is contained in:
parent
e2ad32cd5e
commit
aaa2ba4883
|
@ -40,7 +40,7 @@
|
||||||
#define DEFIO_REC_INDEXED(idx) (ioRecs + (idx))
|
#define DEFIO_REC_INDEXED(idx) (ioRecs + (idx))
|
||||||
|
|
||||||
// ioTag_t accessor macros
|
// 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_ISEMPTY(tag) (!(tag))
|
||||||
#define DEFIO_TAG_GPIOID(tag) (((tag) >> 4) - 1)
|
#define DEFIO_TAG_GPIOID(tag) (((tag) >> 4) - 1)
|
||||||
#define DEFIO_TAG_PIN(tag) ((tag) & 0x0f)
|
#define DEFIO_TAG_PIN(tag) ((tag) & 0x0f)
|
||||||
|
|
|
@ -1081,7 +1081,7 @@ void changeProfile(uint8_t profileIndex)
|
||||||
|
|
||||||
void changeControlRateProfile(uint8_t profileIndex)
|
void changeControlRateProfile(uint8_t profileIndex)
|
||||||
{
|
{
|
||||||
if (profileIndex > MAX_RATEPROFILES) {
|
if (profileIndex >= MAX_RATEPROFILES) {
|
||||||
profileIndex = MAX_RATEPROFILES - 1;
|
profileIndex = MAX_RATEPROFILES - 1;
|
||||||
}
|
}
|
||||||
setControlRateProfile(profileIndex);
|
setControlRateProfile(profileIndex);
|
||||||
|
|
Loading…
Reference in New Issue