From e7e082bf3dcc4910c7859dc1276ac7dcf9f7a324 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Wed, 22 Dec 2010 15:18:30 +0000 Subject: [PATCH] Allow RX YRDK demos to work with Rev1 and Rev3 boards, and with any web browser. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1179 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/ParTest.c | 24 +++++----- .../RTOSDemo/include/yrdkrx62ndef.h | 10 ++++- .../RX600_RX62N-RDK_GNURX/RTOSDemo/uIP_Task.c | 45 ++++++++++++------- Demo/RX600_RX62N-RDK_IAR/ParTest.c | 24 +++++----- .../include/yrdkrx62ndef.h | 10 ++++- Demo/RX600_RX62N-RDK_IAR/uIP_Task.c | 45 ++++++++++++------- .../RTOSDemo/ParTest.c | 24 +++++----- .../RTOSDemo/include/yrdkrx62ndef.h | 10 ++++- .../RTOSDemo/uIP_Task.c | 45 ++++++++++++------- .../RX600_RX62N-RSK_GNURX/RTOSDemo/uIP_Task.c | 37 +++++++++------ Demo/RX600_RX62N-RSK_IAR/uIP_Task.c | 37 +++++++++------ .../RTOSDemo/uIP_Task.c | 36 ++++++++++----- 12 files changed, 219 insertions(+), 128 deletions(-) diff --git a/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/ParTest.c b/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/ParTest.c index 0c3034044..5389eddb6 100644 --- a/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/ParTest.c +++ b/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/ParTest.c @@ -185,62 +185,62 @@ long lReturn = pdFALSE; { switch( ulLED ) { - case 0 : if( LED4 != 0 ) + case 0 : if( LED4 != LED_OFF ) { lReturn = pdTRUE; } break; - case 1 : if( LED5 != 0 ) + case 1 : if( LED5 != LED_OFF ) { lReturn = pdTRUE; } break; - case 2 : if( LED6 != 0 ) + case 2 : if( LED6 != LED_OFF ) { lReturn = pdTRUE; } break; - case 3 : if( LED7 != 0 ) + case 3 : if( LED7 != LED_OFF ) { lReturn = pdTRUE; } break; - case 4 : if( LED8 != 0 ) + case 4 : if( LED8 != LED_OFF ) { lReturn = pdTRUE; } break; - case 5 : if( LED9 != 0 ) + case 5 : if( LED9 != LED_OFF ) { lReturn = pdTRUE; } break; - case 6 : if( LED10 != 0 ) + case 6 : if( LED10 != LED_OFF ) { lReturn = pdTRUE; } break; - case 7 : if( LED11 != 0 ) + case 7 : if( LED11 != LED_OFF ) { lReturn = pdTRUE; } break; - case 8 : if( LED12 != 0 ) + case 8 : if( LED12 != LED_OFF ) { lReturn = pdTRUE; } break; - case 9 : if( LED13 != 0 ) + case 9 : if( LED13 != LED_OFF ) { lReturn = pdTRUE; } break; - case 10 : if( LED14 != 0 ) + case 10 : if( LED14 != LED_OFF ) { lReturn = pdTRUE; } break; - case 11 : if( LED15 != 0 ) + case 11 : if( LED15 != LED_OFF ) { lReturn = pdTRUE; } diff --git a/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/include/yrdkrx62ndef.h b/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/include/yrdkrx62ndef.h index 29a1acee7..779da3562 100644 --- a/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/include/yrdkrx62ndef.h +++ b/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/include/yrdkrx62ndef.h @@ -40,8 +40,14 @@ Macro definitions #define CMT0_CLK_SELECT (512) /* General Values */ -#define LED_ON (1) -#define LED_OFF (0) +#ifdef LED_POSITIVE_LOGIC + #define LED_ON (1) + #define LED_OFF (0) +#else +/* LEDs are using NEGATIVE LOGIC... */ + #define LED_ON (0) + #define LED_OFF (1) +#endif #define SET_BIT_HIGH (1) #define SET_BIT_LOW (0) #define SET_BYTE_HIGH (0xFF) diff --git a/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/uIP_Task.c b/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/uIP_Task.c index 59d0a7890..0614e487c 100644 --- a/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/uIP_Task.c +++ b/Demo/RX600_RX62N-RDK_GNURX/RTOSDemo/uIP_Task.c @@ -243,28 +243,41 @@ void vApplicationProcessFormInput( char *pcInputString ) { char *c; - /* Process the form input sent by the IO page of the served HTML. */ - - c = strstr( pcInputString, "?" ); - if( c ) - { - /* Turn the LED's on or off in accordance with the check box status. */ - if( strstr( c, "LED0=1" ) != NULL ) - { - /* Turn LEDs on. */ - vParTestSetLED( 7, 1 ); - vParTestSetLED( 8, 1 ); - vParTestSetLED( 9, 1 ); - vParTestSetLED( 10, 1 ); - } + /* Only interested in processing form input if this is the IO page. */ + c = strstr( pcInputString, "io.shtml" ); + + if( c ) + { + /* Is there a command in the string? */ + c = strstr( pcInputString, "?" ); + if( c ) + { + /* Turn the LED's on or off in accordance with the check box status. */ + if( strstr( c, "LED0=1" ) != NULL ) + { + /* Turn the LEDs on. */ + vParTestSetLED( 7, 1 ); + vParTestSetLED( 8, 1 ); + vParTestSetLED( 9, 1 ); + vParTestSetLED( 10, 1 ); + } + else + { + /* Turn the LEDs off. */ + vParTestSetLED( 7, 0 ); + vParTestSetLED( 8, 0 ); + vParTestSetLED( 9, 0 ); + vParTestSetLED( 10, 0 ); + } + } else { - /* Turn LED 4 off. */ + /* Commands to turn LEDs off are not always explicit. */ vParTestSetLED( 7, 0 ); vParTestSetLED( 8, 0 ); vParTestSetLED( 9, 0 ); vParTestSetLED( 10, 0 ); } - } + } } diff --git a/Demo/RX600_RX62N-RDK_IAR/ParTest.c b/Demo/RX600_RX62N-RDK_IAR/ParTest.c index fdaf559e7..0b5a11b25 100644 --- a/Demo/RX600_RX62N-RDK_IAR/ParTest.c +++ b/Demo/RX600_RX62N-RDK_IAR/ParTest.c @@ -185,62 +185,62 @@ long lReturn = pdFALSE; { switch( ulLED ) { - case 0 : if( LED4 != 0 ) + case 0 : if( LED4 != LED_OFF ) { lReturn = pdTRUE; } break; - case 1 : if( LED5 != 0 ) + case 1 : if( LED5 != LED_OFF ) { lReturn = pdTRUE; } break; - case 2 : if( LED6 != 0 ) + case 2 : if( LED6 != LED_OFF ) { lReturn = pdTRUE; } break; - case 3 : if( LED7 != 0 ) + case 3 : if( LED7 != LED_OFF ) { lReturn = pdTRUE; } break; - case 4 : if( LED8 != 0 ) + case 4 : if( LED8 != LED_OFF ) { lReturn = pdTRUE; } break; - case 5 : if( LED9 != 0 ) + case 5 : if( LED9 != LED_OFF ) { lReturn = pdTRUE; } break; - case 6 : if( LED10 != 0 ) + case 6 : if( LED10 != LED_OFF ) { lReturn = pdTRUE; } break; - case 7 : if( LED11 != 0 ) + case 7 : if( LED11 != LED_OFF ) { lReturn = pdTRUE; } break; - case 8 : if( LED12 != 0 ) + case 8 : if( LED12 != LED_OFF ) { lReturn = pdTRUE; } break; - case 9 : if( LED13 != 0 ) + case 9 : if( LED13 != LED_OFF ) { lReturn = pdTRUE; } break; - case 10 : if( LED14 != 0 ) + case 10 : if( LED14 != LED_OFF ) { lReturn = pdTRUE; } break; - case 11 : if( LED15 != 0 ) + case 11 : if( LED15 != LED_OFF ) { lReturn = pdTRUE; } diff --git a/Demo/RX600_RX62N-RDK_IAR/include/yrdkrx62ndef.h b/Demo/RX600_RX62N-RDK_IAR/include/yrdkrx62ndef.h index 29a1acee7..779da3562 100644 --- a/Demo/RX600_RX62N-RDK_IAR/include/yrdkrx62ndef.h +++ b/Demo/RX600_RX62N-RDK_IAR/include/yrdkrx62ndef.h @@ -40,8 +40,14 @@ Macro definitions #define CMT0_CLK_SELECT (512) /* General Values */ -#define LED_ON (1) -#define LED_OFF (0) +#ifdef LED_POSITIVE_LOGIC + #define LED_ON (1) + #define LED_OFF (0) +#else +/* LEDs are using NEGATIVE LOGIC... */ + #define LED_ON (0) + #define LED_OFF (1) +#endif #define SET_BIT_HIGH (1) #define SET_BIT_LOW (0) #define SET_BYTE_HIGH (0xFF) diff --git a/Demo/RX600_RX62N-RDK_IAR/uIP_Task.c b/Demo/RX600_RX62N-RDK_IAR/uIP_Task.c index 59d0a7890..0614e487c 100644 --- a/Demo/RX600_RX62N-RDK_IAR/uIP_Task.c +++ b/Demo/RX600_RX62N-RDK_IAR/uIP_Task.c @@ -243,28 +243,41 @@ void vApplicationProcessFormInput( char *pcInputString ) { char *c; - /* Process the form input sent by the IO page of the served HTML. */ - - c = strstr( pcInputString, "?" ); - if( c ) - { - /* Turn the LED's on or off in accordance with the check box status. */ - if( strstr( c, "LED0=1" ) != NULL ) - { - /* Turn LEDs on. */ - vParTestSetLED( 7, 1 ); - vParTestSetLED( 8, 1 ); - vParTestSetLED( 9, 1 ); - vParTestSetLED( 10, 1 ); - } + /* Only interested in processing form input if this is the IO page. */ + c = strstr( pcInputString, "io.shtml" ); + + if( c ) + { + /* Is there a command in the string? */ + c = strstr( pcInputString, "?" ); + if( c ) + { + /* Turn the LED's on or off in accordance with the check box status. */ + if( strstr( c, "LED0=1" ) != NULL ) + { + /* Turn the LEDs on. */ + vParTestSetLED( 7, 1 ); + vParTestSetLED( 8, 1 ); + vParTestSetLED( 9, 1 ); + vParTestSetLED( 10, 1 ); + } + else + { + /* Turn the LEDs off. */ + vParTestSetLED( 7, 0 ); + vParTestSetLED( 8, 0 ); + vParTestSetLED( 9, 0 ); + vParTestSetLED( 10, 0 ); + } + } else { - /* Turn LED 4 off. */ + /* Commands to turn LEDs off are not always explicit. */ vParTestSetLED( 7, 0 ); vParTestSetLED( 8, 0 ); vParTestSetLED( 9, 0 ); vParTestSetLED( 10, 0 ); } - } + } } diff --git a/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/ParTest.c b/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/ParTest.c index 635676378..e6e41f3ae 100644 --- a/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/ParTest.c +++ b/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/ParTest.c @@ -185,62 +185,62 @@ long lReturn = pdFALSE; { switch( ulLED ) { - case 0 : if( LED4 != 0 ) + case 0 : if( LED4 != LED_OFF ) { lReturn = pdTRUE; } break; - case 1 : if( LED5 != 0 ) + case 1 : if( LED5 != LED_OFF ) { lReturn = pdTRUE; } break; - case 2 : if( LED6 != 0 ) + case 2 : if( LED6 != LED_OFF ) { lReturn = pdTRUE; } break; - case 3 : if( LED7 != 0 ) + case 3 : if( LED7 != LED_OFF ) { lReturn = pdTRUE; } break; - case 4 : if( LED8 != 0 ) + case 4 : if( LED8 != LED_OFF ) { lReturn = pdTRUE; } break; - case 5 : if( LED9 != 0 ) + case 5 : if( LED9 != LED_OFF ) { lReturn = pdTRUE; } break; - case 6 : if( LED10 != 0 ) + case 6 : if( LED10 != LED_OFF ) { lReturn = pdTRUE; } break; - case 7 : if( LED11 != 0 ) + case 7 : if( LED11 != LED_OFF ) { lReturn = pdTRUE; } break; - case 8 : if( LED12 != 0 ) + case 8 : if( LED12 != LED_OFF ) { lReturn = pdTRUE; } break; - case 9 : if( LED13 != 0 ) + case 9 : if( LED13 != LED_OFF ) { lReturn = pdTRUE; } break; - case 10 : if( LED14 != 0 ) + case 10 : if( LED14 != LED_OFF ) { lReturn = pdTRUE; } break; - case 11 : if( LED15 != 0 ) + case 11 : if( LED15 != LED_OFF ) { lReturn = pdTRUE; } diff --git a/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/include/yrdkrx62ndef.h b/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/include/yrdkrx62ndef.h index 29a1acee7..779da3562 100644 --- a/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/include/yrdkrx62ndef.h +++ b/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/include/yrdkrx62ndef.h @@ -40,8 +40,14 @@ Macro definitions #define CMT0_CLK_SELECT (512) /* General Values */ -#define LED_ON (1) -#define LED_OFF (0) +#ifdef LED_POSITIVE_LOGIC + #define LED_ON (1) + #define LED_OFF (0) +#else +/* LEDs are using NEGATIVE LOGIC... */ + #define LED_ON (0) + #define LED_OFF (1) +#endif #define SET_BIT_HIGH (1) #define SET_BIT_LOW (0) #define SET_BYTE_HIGH (0xFF) diff --git a/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/uIP_Task.c b/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/uIP_Task.c index 58caa5136..58f5e4504 100644 --- a/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/uIP_Task.c +++ b/Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/uIP_Task.c @@ -243,28 +243,41 @@ void vApplicationProcessFormInput( char *pcInputString ) { char *c; - /* Process the form input sent by the IO page of the served HTML. */ - - c = strstr( pcInputString, "?" ); - if( c ) - { - /* Turn the LED's on or off in accordance with the check box status. */ - if( strstr( c, "LED0=1" ) != NULL ) - { - /* Turn LEDs on. */ - vParTestSetLED( 7, 1 ); - vParTestSetLED( 8, 1 ); - vParTestSetLED( 9, 1 ); - vParTestSetLED( 10, 1 ); - } + /* Only interested in processing form input if this is the IO page. */ + c = strstr( pcInputString, "io.shtml" ); + + if( c ) + { + /* Is there a command in the string? */ + c = strstr( pcInputString, "?" ); + if( c ) + { + /* Turn the LED's on or off in accordance with the check box status. */ + if( strstr( c, "LED0=1" ) != NULL ) + { + /* Turn the LEDs on. */ + vParTestSetLED( 7, 1 ); + vParTestSetLED( 8, 1 ); + vParTestSetLED( 9, 1 ); + vParTestSetLED( 10, 1 ); + } + else + { + /* Turn the LEDs off. */ + vParTestSetLED( 7, 0 ); + vParTestSetLED( 8, 0 ); + vParTestSetLED( 9, 0 ); + vParTestSetLED( 10, 0 ); + } + } else { - /* Turn LED 4 off. */ + /* Commands to turn LEDs off are not always explicit. */ vParTestSetLED( 7, 0 ); vParTestSetLED( 8, 0 ); vParTestSetLED( 9, 0 ); vParTestSetLED( 10, 0 ); } - } + } } diff --git a/Demo/RX600_RX62N-RSK_GNURX/RTOSDemo/uIP_Task.c b/Demo/RX600_RX62N-RSK_GNURX/RTOSDemo/uIP_Task.c index b1f6f91f1..66efa5537 100644 --- a/Demo/RX600_RX62N-RSK_GNURX/RTOSDemo/uIP_Task.c +++ b/Demo/RX600_RX62N-RSK_GNURX/RTOSDemo/uIP_Task.c @@ -243,24 +243,35 @@ void vApplicationProcessFormInput( char *pcInputString ) { char *c; - /* Process the form input sent by the IO page of the served HTML. */ - - c = strstr( pcInputString, "?" ); - if( c ) - { - /* Turn the LED's on or off in accordance with the check box status. */ - if( strstr( c, "LED0=1" ) != NULL ) + /* Only interested in processing form input if this is the IO page. */ + c = strstr( pcInputString, "io.shtml" ); + + if( c ) + { + /* Is there a command in the string? */ + c = strstr( pcInputString, "?" ); + if( c ) { - /* Turn LEDs on. */ - vParTestSetLED( 3, 1 ); - vParTestSetLED( 4, 1 ); + /* Turn the LED's on or off in accordance with the check box status. */ + if( strstr( c, "LED0=1" ) != NULL ) + { + /* Turn LEDs on. */ + vParTestSetLED( 3, 1 ); + vParTestSetLED( 4, 1 ); + } + else + { + /* Turn LED 4 off. */ + vParTestSetLED( 3, 0 ); + vParTestSetLED( 4, 0 ); + } } else { - /* Turn LED 4 off. */ + /* Commands to turn LEDs off are not always explicit, turn LED 4 + off. */ vParTestSetLED( 3, 0 ); vParTestSetLED( 4, 0 ); } - } + } } - diff --git a/Demo/RX600_RX62N-RSK_IAR/uIP_Task.c b/Demo/RX600_RX62N-RSK_IAR/uIP_Task.c index 6ee495cd0..5a5a589ac 100644 --- a/Demo/RX600_RX62N-RSK_IAR/uIP_Task.c +++ b/Demo/RX600_RX62N-RSK_IAR/uIP_Task.c @@ -243,24 +243,35 @@ void vApplicationProcessFormInput( char *pcInputString ) { char *c; - /* Process the form input sent by the IO page of the served HTML. */ - - c = strstr( pcInputString, "?" ); - if( c ) - { - /* Turn the LED's on or off in accordance with the check box status. */ - if( strstr( c, "LED0=1" ) != NULL ) + /* Only interested in processing form input if this is the IO page. */ + c = strstr( pcInputString, "io.shtml" ); + + if( c ) + { + /* Is there a command in the string? */ + c = strstr( pcInputString, "?" ); + if( c ) { - /* Turn LEDs on. */ - vParTestSetLED( 3, 1 ); - vParTestSetLED( 4, 1 ); + /* Turn the LED's on or off in accordance with the check box status. */ + if( strstr( c, "LED0=1" ) != NULL ) + { + /* Turn LEDs on. */ + vParTestSetLED( 3, 1 ); + vParTestSetLED( 4, 1 ); + } + else + { + /* Turn LED 4 off. */ + vParTestSetLED( 3, 0 ); + vParTestSetLED( 4, 0 ); + } } else { - /* Turn LED 4 off. */ + /* Commands to turn LEDs off are not always explicit, turn LED 4 + off. */ vParTestSetLED( 3, 0 ); vParTestSetLED( 4, 0 ); } - } + } } - diff --git a/Demo/RX600_RX62N-RSK_Renesas/RTOSDemo/uIP_Task.c b/Demo/RX600_RX62N-RSK_Renesas/RTOSDemo/uIP_Task.c index b1f6f91f1..a571b083f 100644 --- a/Demo/RX600_RX62N-RSK_Renesas/RTOSDemo/uIP_Task.c +++ b/Demo/RX600_RX62N-RSK_Renesas/RTOSDemo/uIP_Task.c @@ -243,24 +243,36 @@ void vApplicationProcessFormInput( char *pcInputString ) { char *c; - /* Process the form input sent by the IO page of the served HTML. */ - - c = strstr( pcInputString, "?" ); - if( c ) - { - /* Turn the LED's on or off in accordance with the check box status. */ - if( strstr( c, "LED0=1" ) != NULL ) + /* Only interested in processing form input if this is the IO page. */ + c = strstr( pcInputString, "io.shtml" ); + + if( c ) + { + /* Is there a command in the string? */ + c = strstr( pcInputString, "?" ); + if( c ) { - /* Turn LEDs on. */ - vParTestSetLED( 3, 1 ); - vParTestSetLED( 4, 1 ); + /* Turn the LED's on or off in accordance with the check box status. */ + if( strstr( c, "LED0=1" ) != NULL ) + { + /* Turn LEDs on. */ + vParTestSetLED( 3, 1 ); + vParTestSetLED( 4, 1 ); + } + else + { + /* Turn LED 4 off. */ + vParTestSetLED( 3, 0 ); + vParTestSetLED( 4, 0 ); + } } else { - /* Turn LED 4 off. */ + /* Commands to turn LEDs off are not always explicit, turn LED 4 + off. */ vParTestSetLED( 3, 0 ); vParTestSetLED( 4, 0 ); } - } + } } -- 2.39.5