Set size of callback irq array to IrqCnt

Rather than hard coding the size of the callback array for irqs,
instead set the size to IrqCnt which is defined by the irq enumeration.
pull/2714/head
Russ Butler 2016-08-30 10:33:44 -05:00 committed by Anna Bridge
parent 085bd4294a
commit 163a93460c
2 changed files with 8 additions and 4 deletions

View File

@ -203,7 +203,9 @@ public:
EpIrq, EpIrq,
AlIrq, AlIrq,
BeIrq, BeIrq,
IdIrq IdIrq,
IrqCnt
}; };
/** Attach a function to call whenever a CAN frame received interrupt is /** Attach a function to call whenever a CAN frame received interrupt is
@ -246,7 +248,7 @@ protected:
virtual void lock(); virtual void lock();
virtual void unlock(); virtual void unlock();
can_t _can; can_t _can;
Callback<void()> _irq[9]; Callback<void()> _irq[IrqCnt];
PlatformMutex _mutex; PlatformMutex _mutex;
}; };

View File

@ -55,7 +55,9 @@ public:
enum IrqType { enum IrqType {
RxIrq = 0, RxIrq = 0,
TxIrq TxIrq,
IrqCnt
}; };
enum Flow { enum Flow {
@ -231,7 +233,7 @@ protected:
#endif #endif
serial_t _serial; serial_t _serial;
Callback<void()> _irq[2]; Callback<void()> _irq[IrqCnt];
int _baud; int _baud;
}; };