Skip to content

Commit

Permalink
Merge pull request #53 CAN fixes
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'tdaede/master'
  • Loading branch information
esden committed Oct 31, 2012
2 parents 68e6818 + 0fd7cc3 commit 60aa32e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/libopencm3/stm32/can.h
Expand Up @@ -458,7 +458,7 @@
/* --- CAN_TIxR values ------------------------------------------------------ */

/* STID[10:0]: Standard identifier */
#define CAN_TIxR_STID_MASK (0x3FF << 21)
#define CAN_TIxR_STID_MASK (0x7FF << 21)
#define CAN_TIxR_STID_SHIFT 21

/* EXID[15:0]: Extended identifier */
Expand Down
13 changes: 11 additions & 2 deletions lib/stm32/f1/can.c → lib/stm32/can.c
Expand Up @@ -18,7 +18,16 @@
*/

#include <libopencm3/stm32/can.h>
#include <libopencm3/stm32/f1/rcc.h>

#if defined(STM32F1)
# include <libopencm3/stm32/f1/rcc.h>
#elif defined(STM32F2)
# include <libopencm3/stm32/f2/rcc.h>
#elif defined(STM32F4)
# include <libopencm3/stm32/f4/rcc.h>
#else
# error "stm32 family not defined."
#endif

void can_reset(u32 canport)
{
Expand Down Expand Up @@ -299,5 +308,5 @@ void can_receive(u32 canport, u8 fifo, bool release, u32 *id, bool *ext,

/* Release the FIFO. */
if (release)
can_fifo_release(CAN1, 0);
can_fifo_release(canport, fifo);
}

0 comments on commit 60aa32e

Please sign in to comment.