aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/CAN/main.c
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-06-07 14:34:59 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-06-07 14:34:59 +0000
commit5cad241306f64d0a3c0f7829421e4bf8f4b18fbe (patch)
treeebbcad6d0cdb19fa5ef0bf5f6dc5cf80dfbdc4d1 /testhal/STM32/CAN/main.c
parent152f34a80c6ffe5fd17809732272823091b854e8 (diff)
parentaec912f13f9aa85cd677353fa556f679c3832970 (diff)
downloadChibiOS-5cad241306f64d0a3c0f7829421e4bf8f4b18fbe.tar.gz
ChibiOS-5cad241306f64d0a3c0f7829421e4bf8f4b18fbe.tar.bz2
ChibiOS-5cad241306f64d0a3c0f7829421e4bf8f4b18fbe.zip
I2C. Merged code from trunk.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3036 35acf78f-673a-0410-8e92-d51de3d6d3f4
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);