diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-02-22 13:42:10 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-02-22 13:42:10 +0000 |
commit | 48506ff3481afe8e2490e78a451852bc4bbb1c0b (patch) | |
tree | 5df5c39412e8cd4b17d7dc935472b961d3145917 /testhal | |
parent | d4c246e1bf9af0096b69ded8ae65bbf754267754 (diff) | |
download | ChibiOS-48506ff3481afe8e2490e78a451852bc4bbb1c0b.tar.gz ChibiOS-48506ff3481afe8e2490e78a451852bc4bbb1c0b.tar.bz2 ChibiOS-48506ff3481afe8e2490e78a451852bc4bbb1c0b.zip |
CAN driver revision, work in progress.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5299 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32F30x/CAN/main.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/testhal/STM32F30x/CAN/main.c b/testhal/STM32F30x/CAN/main.c index a534b9dbf..978c31c1b 100644 --- a/testhal/STM32F30x/CAN/main.c +++ b/testhal/STM32F30x/CAN/main.c @@ -24,14 +24,11 @@ /*
* Internal loopback mode, 500KBaud, automatic wakeup, automatic recover
* from abort mode.
- * See section 22.7.7 on the STM32 reference manual.
*/
static const CANConfig cancfg = {
CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP,
CAN_BTR_LBKM | CAN_BTR_SJW(0) | CAN_BTR_TS2(1) |
- CAN_BTR_TS1(8) | CAN_BTR_BRP(6),
- 0,
- NULL
+ CAN_BTR_TS1(8) | CAN_BTR_BRP(6)
};
/*
@@ -48,7 +45,7 @@ static msg_t can_rx(void *p) { while(!chThdShouldTerminate()) {
if (chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(100)) == 0)
continue;
- while (canReceive(&CAND1, &rxmsg, TIME_IMMEDIATE) == RDY_OK) {
+ while (canReceive(&CAND1, 1, &rxmsg, TIME_IMMEDIATE) == RDY_OK) {
/* Process message.*/
palTogglePad(GPIOE, GPIOE_LED3_RED);
}
@@ -74,7 +71,7 @@ static msg_t can_tx(void * p) { txmsg.data32[1] = 0x00FF00FF;
while (!chThdShouldTerminate()) {
- canTransmit(&CAND1, &txmsg, MS2ST(100));
+ canTransmit(&CAND1, CAN_ANY_TX_MAILBOX, &txmsg, MS2ST(100));
chThdSleepMilliseconds(500);
}
return 0;
|