Skip to content

Commit

Permalink
uavcan: run initOnce every time for stm32h7 iot not crash on reinit
Browse files Browse the repository at this point in the history
  • Loading branch information
oystub committed Apr 11, 2024
1 parent 8634677 commit a5f6f71
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1174,13 +1174,8 @@ int CanDriver::init(const uavcan::uint32_t bitrate, const CanIface::OperatingMod

UAVCAN_STM32H7_LOG("Bitrate %lu mode %d", static_cast<unsigned long>(bitrate), static_cast<int>(mode));

static bool initialized_once = false;

if (!initialized_once) {
initialized_once = true;
UAVCAN_STM32H7_LOG("First initialization");
initOnce();
}
initOnce();

/*
* FDCAN1
Expand Down

0 comments on commit a5f6f71

Please sign in to comment.