diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-10-03 14:18:56 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-10-03 14:18:56 +0000 |
commit | 4b049c1f175144f8583df5eb9e3a620ac306ee98 (patch) | |
tree | d20a3ec4de726fbfb746c6062061e24b7ac3d3be /testhal/STM32F1xx/CAN/main.c | |
parent | fe65d988275f509d3e7b71014c19c1d1aefac035 (diff) | |
download | ChibiOS-4b049c1f175144f8583df5eb9e3a620ac306ee98.tar.gz ChibiOS-4b049c1f175144f8583df5eb9e3a620ac306ee98.tar.bz2 ChibiOS-4b049c1f175144f8583df5eb9e3a620ac306ee98.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6353 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F1xx/CAN/main.c')
-rw-r--r-- | testhal/STM32F1xx/CAN/main.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/testhal/STM32F1xx/CAN/main.c b/testhal/STM32F1xx/CAN/main.c index 43164e1ce..39fdc29ae 100644 --- a/testhal/STM32F1xx/CAN/main.c +++ b/testhal/STM32F1xx/CAN/main.c @@ -31,18 +31,18 @@ static const CANConfig cancfg = { /*
* Receiver thread.
*/
-static WORKING_AREA(can_rx_wa, 256);
-static msg_t can_rx(void *p) {
- EventListener el;
+static THD_WORKING_AREA(can_rx_wa, 256);
+static THD_FUNCTION(can_rx, p) {
+ event_listener_t el;
CANRxFrame rxmsg;
(void)p;
chRegSetThreadName("receiver");
chEvtRegister(&CAND1.rxfull_event, &el, 0);
- while(!chThdShouldTerminate()) {
+ while(!chThdShouldTerminateX()) {
if (chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(100)) == 0)
continue;
- while (canReceive(&CAND1, CAN_ANY_MAILBOX, &rxmsg, TIME_IMMEDIATE) == RDY_OK) {
+ while (canReceive(&CAND1, CAN_ANY_MAILBOX, &rxmsg, TIME_IMMEDIATE) == MSG_OK) {
/* Process message.*/
palTogglePad(IOPORT3, GPIOC_LED);
}
@@ -54,8 +54,8 @@ static msg_t can_rx(void *p) { /*
* Transmitter thread.
*/
-static WORKING_AREA(can_tx_wa, 256);
-static msg_t can_tx(void * p) {
+static THD_WORKING_AREA(can_tx_wa, 256);
+static THD_FUNCTION(can_tx, p) {
CANTxFrame txmsg;
(void)p;
@@ -67,7 +67,7 @@ static msg_t can_tx(void * p) { txmsg.data32[0] = 0x55AA55AA;
txmsg.data32[1] = 0x00FF00FF;
- while (!chThdShouldTerminate()) {
+ while (!chThdShouldTerminateX()) {
canTransmit(&CAND1, CAN_ANY_MAILBOX, &txmsg, MS2ST(100));
chThdSleepMilliseconds(500);
}
|