Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: m-labs/autotest-m1
base: 77a3f43
...
head fork: m-labs/autotest-m1
compare: 2fe1bf9
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 18, 2011
Xiangfu Liu update tests_ethernet.c to minimac2 0ac14f0
Commits on Jun 08, 2011
Xiangfu Liu IR, test 5 buttons one by one ff351c1
Commits on Jun 09, 2011
Xiangfu Liu tests_ir: output all rx values 2fe1bf9
Showing with 51 additions and 13 deletions.
  1. +2 −4 src/tests_ethernet.c
  2. +49 −9 src/tests_ir.c
View
6 src/tests_ethernet.c
@@ -35,12 +35,10 @@ static int mdio()
static int arp_resolution()
{
- int ethbuf[MICROUDP_BUFSIZE/4];
-
- microudp_start((unsigned char *)FLASH_OFFSET_MAC_ADDRESS, IPTOINT(192, 168, 0, 42), ethbuf);
+ microudp_start((unsigned char *)FLASH_OFFSET_MAC_ADDRESS, IPTOINT(192, 168, 0, 42));
if(!microudp_arp_resolve(IPTOINT(192, 168, 0, 14)))
return TEST_STATUS_FAILED;
- microudp_shutdown();
+
return TEST_STATUS_PASSED;
}
View
58 src/tests_ir.c
@@ -25,24 +25,64 @@
static int reception()
{
char c;
- int rx;
+ int pre_rx,i,rx;
+ int result;
+
+ int rc5_code[5] = {0x0c, 0x01, 0x03, 0x05, 0x10};
+
+ char *code_strings[] = {
+ "[Standby] passed",
+ "[1] passed",
+ "[3] passed",
+ "[5] passed",
+ "[VolumeUp] passed"
+ };
+
+ pre_rx = 0;
+ i = 0;
+ result = TEST_STATUS_NOT_DONE;
+
+ printf("Press the remote's [standby], [1], [3], [5], [VolumeUp] one by one\n");
+ printf("Waiting for remote. e for exit\n");
- printf("Press the remote's \"power\" button...\n");
- printf("Waiting for remote. f to fail test, s to skip.\n");
while(1) {
while(!(irq_pending() & IRQ_IR)) {
if(readchar_nonblock()) {
c = readchar();
- if(c == 'f')
- return TEST_STATUS_FAILED;
- if(c == 's')
- return TEST_STATUS_NOT_DONE;
+ if(c == 'e')
+ return result;
}
}
+
rx = CSR_RC5_RX;
irq_ack(IRQ_IR);
- if((rx & 0x003f) == 12)
- return TEST_STATUS_PASSED;
+
+ if(i == 5 || i == -1) { /* 5: all passed, -1: failed */
+ printf("Now press 'e' exit Infrared test. rx [0x%04x]\n", rx);
+ continue;
+ }
+
+ printf(" should be [0x%02x], get [0x%02x], [0x%04x].\n",
+ rc5_code[i], rx & 0x003f, rx);
+
+ rx = rx & 0x003f;
+
+ if(rx != pre_rx) {
+ if(rx != rc5_code[i]) {
+ result = TEST_STATUS_FAILED;
+ i = -1;
+ continue;
+ }
+
+ printf("%s\n", code_strings[i]);
+ pre_rx = rx;
+ i++;
+
+ if(i == 5) {
+ result = TEST_STATUS_PASSED;
+ continue;
+ }
+ }
}
}

No commit comments for this range

Something went wrong with that request. Please try again.