Skip to content

Commit a3a16b3

Browse files
committed
Avoid hardfault when CAN object is destructed.
interrupts have to be disabled(can_irq_free) before we turn off(can_free) the peripheral
1 parent 2b7d2bb commit a3a16b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/mbed/common/CAN.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ CAN::CAN(PinName rd, PinName td) {
2727
}
2828

2929
CAN::~CAN() {
30-
can_free(&_can);
3130
can_irq_free(&_can);
31+
can_free(&_can);
3232
}
3333

3434
int CAN::frequency(int f) {

0 commit comments

Comments
 (0)