Mercurial > ecos
changeset 2424:4c366bd69cd5
* tests/can_overrun1.c (can0_thread): Fix the length of the data
in the message. Add a delay to allow the CAN device to process
the packets.
* test/can_txcevent.c: (can0_thread): Add a delay to allow the CAN device
to process the packet.s
* src/loop_can.c (FIFO_SIZE): Changed to one more than the TX
queue size. If it is less, the loopback tests don't pass because
packets don't get transmitted.
| author | asl |
|---|---|
| date | Tue, 28 Aug 2007 15:56:03 +0000 |
| parents | 82aabda670f8 |
| children | 44054a00feca |
| files | packages/devs/can/loop/current/ChangeLog packages/devs/can/loop/current/src/loop_can.c packages/devs/can/loop/current/tests/can_overrun1.c packages/devs/can/loop/current/tests/can_txevent.c |
| diffstat | 4 files changed, 23 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/devs/can/loop/current/ChangeLog +++ b/packages/devs/can/loop/current/ChangeLog @@ -1,3 +1,14 @@ +2007-08-28 Andrew Lunn <andrew.lunn@ascom.ch> + + * tests/can_overrun1.c (can0_thread): Fix the length of the data + in the message. Add a delay to allow the CAN device to process + the packets. + * test/can_txcevent.c: (can0_thread): Add a delay to allow the CAN device + to process the packet.s + * src/loop_can.c (FIFO_SIZE): Changed to one more than the TX + queue size. If it is less, the loopback tests don't pass because + packets don't get transmitted. + 2007-08-24 Andrew Lunn <andrew.lunn> * doc/synth_test.ecm: Import file for running the tests on synth.
--- a/packages/devs/can/loop/current/src/loop_can.c +++ b/packages/devs/can/loop/current/src/loop_can.c @@ -100,7 +100,7 @@ static cyg_handle_t alarm_handle; //------------------------------------------------------------------------- // Transfer FIFOs -#define FIFO_SIZE 16 +#define FIFO_SIZE 33 struct fifo {
--- a/packages/devs/can/loop/current/tests/can_overrun1.c +++ b/packages/devs/can/loop/current/tests/can_overrun1.c @@ -116,7 +116,7 @@ void can0_thread(cyg_addrword_t data) }, CYGNUM_CAN_ID_STD, // standard frame CYGNUM_CAN_FRAME_DATA, // data frame - 0, // data length code + 1, // data length code }; if (ENOERR != cyg_io_lookup("/dev/can0", &hCAN0)) @@ -156,6 +156,11 @@ void can0_thread(cyg_addrword_t data) print_can_msg(&tx_msg, ""); } } + + // + // Give the loop back driver time to process all those messages. + // + cyg_thread_delay(10); // // now check if receive queue is completely filled - that means number of rx events should
--- a/packages/devs/can/loop/current/tests/can_txevent.c +++ b/packages/devs/can/loop/current/tests/can_txevent.c @@ -164,6 +164,11 @@ void can0_thread(cyg_addrword_t data) } // + // Give the loop back driver time to process all those messages. + // + cyg_thread_delay(10); + + // // now we read the buffer info - we expect a completely filled recieve queue // len = sizeof(buf_info);
