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/2584/head
Russ Butler 2016-08-30 10:33:44 -05:00
parent 9111aa4c2d
commit 1ef06f5eb0
2 changed files with 8 additions and 4 deletions

View File

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

View File

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