aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/CAN/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32/CAN/main.c')
-rw-r--r--testhal/STM32/CAN/main.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/testhal/STM32/CAN/main.c b/testhal/STM32/CAN/main.c
index ab7fb1c5e..c8879d6d4 100644
--- a/testhal/STM32/CAN/main.c
+++ b/testhal/STM32/CAN/main.c
@@ -1,5 +1,6 @@
/*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -42,7 +43,7 @@ static msg_t can_rx(void *p) {
CANRxFrame rxmsg;
(void)p;
- chEvtRegister(&CAND1.cd_rxfull_event, &el, 0);
+ chEvtRegister(&CAND1.rxfull_event, &el, 0);
while(!chThdShouldTerminate()) {
if (chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(100)) == 0)
continue;
@@ -51,24 +52,24 @@ static msg_t can_rx(void *p) {
palTogglePad(IOPORT3, GPIOC_LED);
}
}
- chEvtUnregister(&CAND1.cd_rxfull_event, &el);
+ chEvtUnregister(&CAND1.rxfull_event, &el);
return 0;
}
/*
- * Transmitter thread.
+ * Transmitter thread.
*/
static WORKING_AREA(can_tx_wa, 256);
static msg_t can_tx(void * p) {
CANTxFrame txmsg;
(void)p;
- txmsg.cf_IDE = CAN_IDE_EXT;
- txmsg.cf_EID = 0x01234567;
- txmsg.cf_RTR = CAN_RTR_DATA;
- txmsg.cf_DLC = 8;
- txmsg.cf_data32[0] = 0x55AA55AA;
- txmsg.cf_data32[1] = 0x00FF00FF;
+ txmsg.IDE = CAN_IDE_EXT;
+ txmsg.EID = 0x01234567;
+ txmsg.RTR = CAN_RTR_DATA;
+ txmsg.DLC = 8;
+ txmsg.data32[0] = 0x55AA55AA;
+ txmsg.data32[1] = 0x00FF00FF;
while (!chThdShouldTerminate()) {
canTransmit(&CAND1, &txmsg, MS2ST(100));
@@ -93,12 +94,12 @@ int main(void) {
chSysInit();
/*
- * Activates the CAN driver 1.
+ * Activates the CAN driver 1.
*/
canStart(&CAND1, &cancfg);
/*
- * Starting the transmitter and receiver threads.
+ * Starting the transmitter and receiver threads.
*/
chThdCreateStatic(can_rx_wa, sizeof(can_rx_wa), NORMALPRIO + 7, can_rx, NULL);
chThdCreateStatic(can_tx_wa, sizeof(can_tx_wa), NORMALPRIO + 7, can_tx, NULL);