aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32F37x/CAN/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32F37x/CAN/main.c')
-rw-r--r--testhal/STM32F37x/CAN/main.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/testhal/STM32F37x/CAN/main.c b/testhal/STM32F37x/CAN/main.c
index 12e0c4650..7b8b7bf59 100644
--- a/testhal/STM32F37x/CAN/main.c
+++ b/testhal/STM32F37x/CAN/main.c
@@ -30,18 +30,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(GPIOC, GPIOC_LED1);
}
@@ -53,8 +53,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;
@@ -66,7 +66,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);
}