diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-02-23 09:04:38 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-02-23 09:04:38 +0000 |
commit | 4256a9113fd16e1b8d7cef963f83931b7d9182ad (patch) | |
tree | 5d4e1692bfef3431bcb95255afc8c22915234969 /testhal | |
parent | 61524c2014380d425983c269f641c6f7404fb8d9 (diff) | |
download | ChibiOS-4256a9113fd16e1b8d7cef963f83931b7d9182ad.tar.gz ChibiOS-4256a9113fd16e1b8d7cef963f83931b7d9182ad.tar.bz2 ChibiOS-4256a9113fd16e1b8d7cef963f83931b7d9182ad.zip |
CAN driver enhancements completed.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5303 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32F1xx/CAN/main.c | 8 | ||||
-rw-r--r-- | testhal/STM32F30x/CAN/.project | 52 | ||||
-rw-r--r-- | testhal/STM32F30x/CAN/main.c | 4 | ||||
-rw-r--r-- | testhal/STM32F4xx/CAN/.project | 52 | ||||
-rw-r--r-- | testhal/STM32F4xx/CAN/main.c | 7 |
5 files changed, 113 insertions, 10 deletions
diff --git a/testhal/STM32F1xx/CAN/main.c b/testhal/STM32F1xx/CAN/main.c index 2ea6b7dec..3fbda37c8 100644 --- a/testhal/STM32F1xx/CAN/main.c +++ b/testhal/STM32F1xx/CAN/main.c @@ -29,9 +29,7 @@ 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 +46,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, CAN_ANY_MAILBOX, &rxmsg, TIME_IMMEDIATE) == RDY_OK) {
/* Process message.*/
palTogglePad(IOPORT3, GPIOC_LED);
}
@@ -74,7 +72,7 @@ static msg_t can_tx(void * p) { txmsg.data32[1] = 0x00FF00FF;
while (!chThdShouldTerminate()) {
- canTransmit(&CAND1, &txmsg, MS2ST(100));
+ canTransmit(&CAND1, CAN_ANY_MAILBOX, &txmsg, MS2ST(100));
chThdSleepMilliseconds(500);
}
return 0;
diff --git a/testhal/STM32F30x/CAN/.project b/testhal/STM32F30x/CAN/.project index a2e4698ac..a01f8a133 100644 --- a/testhal/STM32F30x/CAN/.project +++ b/testhal/STM32F30x/CAN/.project @@ -9,6 +9,58 @@ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value>-j1</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
</arguments>
</buildCommand>
<buildCommand>
diff --git a/testhal/STM32F30x/CAN/main.c b/testhal/STM32F30x/CAN/main.c index 978c31c1b..59e0c99d7 100644 --- a/testhal/STM32F30x/CAN/main.c +++ b/testhal/STM32F30x/CAN/main.c @@ -45,7 +45,7 @@ static msg_t can_rx(void *p) { while(!chThdShouldTerminate()) {
if (chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(100)) == 0)
continue;
- while (canReceive(&CAND1, 1, &rxmsg, TIME_IMMEDIATE) == RDY_OK) {
+ while (canReceive(&CAND1, CAN_ANY_MAILBOX, &rxmsg, TIME_IMMEDIATE) == RDY_OK) {
/* Process message.*/
palTogglePad(GPIOE, GPIOE_LED3_RED);
}
@@ -71,7 +71,7 @@ static msg_t can_tx(void * p) { txmsg.data32[1] = 0x00FF00FF;
while (!chThdShouldTerminate()) {
- canTransmit(&CAND1, CAN_ANY_TX_MAILBOX, &txmsg, MS2ST(100));
+ canTransmit(&CAND1, CAN_ANY_MAILBOX, &txmsg, MS2ST(100));
chThdSleepMilliseconds(500);
}
return 0;
diff --git a/testhal/STM32F4xx/CAN/.project b/testhal/STM32F4xx/CAN/.project index 91c2aa2ca..3c1df9502 100644 --- a/testhal/STM32F4xx/CAN/.project +++ b/testhal/STM32F4xx/CAN/.project @@ -9,6 +9,58 @@ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value>-j1</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
</arguments>
</buildCommand>
<buildCommand>
diff --git a/testhal/STM32F4xx/CAN/main.c b/testhal/STM32F4xx/CAN/main.c index e095da4d5..2ff2025e0 100644 --- a/testhal/STM32F4xx/CAN/main.c +++ b/testhal/STM32F4xx/CAN/main.c @@ -56,7 +56,8 @@ static msg_t can_rx(void *p) { while(!chThdShouldTerminate()) {
if (chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(100)) == 0)
continue;
- while (canReceive(cip->canp, 1, &rxmsg, TIME_IMMEDIATE) == RDY_OK) {
+ while (canReceive(cip->canp, CAN_ANY_MAILBOX,
+ &rxmsg, TIME_IMMEDIATE) == RDY_OK) {
/* Process message.*/
palTogglePad(GPIOD, cip->led);
}
@@ -82,8 +83,8 @@ static msg_t can_tx(void * p) { txmsg.data32[1] = 0x00FF00FF;
while (!chThdShouldTerminate()) {
- canTransmit(&CAND1, CAN_ANY_TX_MAILBOX, &txmsg, MS2ST(100));
- canTransmit(&CAND2, CAN_ANY_TX_MAILBOX, &txmsg, MS2ST(100));
+ canTransmit(&CAND1, CAN_ANY_MAILBOX, &txmsg, MS2ST(100));
+ canTransmit(&CAND2, CAN_ANY_MAILBOX, &txmsg, MS2ST(100));
chThdSleepMilliseconds(500);
}
return 0;
|