From 163a93460cec58b9fb5605d0b33b478ad42a1bd5 Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Tue, 30 Aug 2016 10:33:44 -0500 Subject: [PATCH] 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. --- hal/api/CAN.h | 6 ++++-- hal/api/SerialBase.h | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hal/api/CAN.h b/hal/api/CAN.h index a96c2b86b9..3d0e8491a4 100644 --- a/hal/api/CAN.h +++ b/hal/api/CAN.h @@ -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 _irq[9]; + Callback _irq[IrqCnt]; PlatformMutex _mutex; }; diff --git a/hal/api/SerialBase.h b/hal/api/SerialBase.h index 1d7ae7c34d..45df1ce04b 100644 --- a/hal/api/SerialBase.h +++ b/hal/api/SerialBase.h @@ -55,7 +55,9 @@ public: enum IrqType { RxIrq = 0, - TxIrq + TxIrq, + + IrqCnt }; enum Flow { @@ -231,7 +233,7 @@ protected: #endif serial_t _serial; - Callback _irq[2]; + Callback _irq[IrqCnt]; int _baud; };