Skip to content

Commit e39932c

Browse files
authored
Merge pull request #2584 from c1728p9/array_size_count
Set size of callback irq array to IrqCnt
2 parents 7dd1b04 + 1ef06f5 commit e39932c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

hal/api/CAN.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ class CAN {
203203
EpIrq,
204204
AlIrq,
205205
BeIrq,
206-
IdIrq
206+
IdIrq,
207+
208+
IrqCnt
207209
};
208210

209211
/** Attach a function to call whenever a CAN frame received interrupt is
@@ -246,7 +248,7 @@ class CAN {
246248
virtual void lock();
247249
virtual void unlock();
248250
can_t _can;
249-
Callback<void()> _irq[9];
251+
Callback<void()> _irq[IrqCnt];
250252
PlatformMutex _mutex;
251253
};
252254

hal/api/SerialBase.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ class SerialBase {
5656

5757
enum IrqType {
5858
RxIrq = 0,
59-
TxIrq
59+
TxIrq,
60+
61+
IrqCnt
6062
};
6163

6264
enum Flow {
@@ -244,7 +246,7 @@ class SerialBase {
244246
#endif
245247

246248
serial_t _serial;
247-
Callback<void()> _irq[2];
249+
Callback<void()> _irq[IrqCnt];
248250
int _baud;
249251

250252
};

0 commit comments

Comments
 (0)