Skip to content

Commit

Permalink
DroneCAN: use bxCAN driver from ArduPilot for STM32
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Dec 12, 2024
1 parent d4931ac commit c16321a
Show file tree
Hide file tree
Showing 3 changed files with 322 additions and 69 deletions.
10 changes: 9 additions & 1 deletion bootloader/DroneCAN/DroneCAN.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,10 +675,18 @@ void DroneCAN_receiveFrame(void)
{
CanardCANFrame rx_frame = {0};
while (sys_can_receive(&rx_frame) > 0) {
canardHandleRxFrame(&canard, &rx_frame, micros64());
canardHandleRxFrame(&canard, &rx_frame, micros64());
}
}

/*
handle a frame from interrupt context
*/
void DroneCAN_handleFrame(CanardCANFrame *frame)
{
canardHandleRxFrame(&canard, frame, micros64());
}

/*
Transmits all frames from the TX queue
*/
Expand Down
5 changes: 5 additions & 0 deletions bootloader/DroneCAN/sys_can.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ extern void DroneCAN_processTxQueue();
*/
extern void DroneCAN_receiveFrame();

/*
called from IRQ to handle incoming frame
*/
void DroneCAN_handleFrame(CanardCANFrame *frame);

/*
try to transmit a frame.
return 1 for success, 0 for no space, -ve for error
Expand Down
Loading

0 comments on commit c16321a

Please sign in to comment.