]> git.sur5r.net Git - freertos/commitdiff
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@157 1d2547de-c912-0410...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 10 Feb 2008 14:48:23 +0000 (14:48 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 10 Feb 2008 14:48:23 +0000 (14:48 +0000)
Demo/MB91460_Softune/SRC/partest/partest.c [new file with mode: 0644]

diff --git a/Demo/MB91460_Softune/SRC/partest/partest.c b/Demo/MB91460_Softune/SRC/partest/partest.c
new file mode 100644 (file)
index 0000000..d741f5f
--- /dev/null
@@ -0,0 +1,117 @@
+/* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU */\r
+/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */\r
+/* ELIGIBILITY FOR ANY PURPOSES.                                                                                        */\r
+/*                              (C) Fujitsu Microelectronics Europe GmbH                                 */\r
+/*------------------------------------------------------------------------\r
+  MAIN.C\r
+  - description\r
+  - See README.TXT for project description and disclaimer.\r
+-------------------------------------------------------------------------*/\r
+/*************************@INCLUDE_START************************/\r
+\r
+\r
+/* TODO: Add comment here regarding the behaviour of the demo. */\r
+\r
+\r
+/* Hardware specific includes. */\r
+#include "mb91467d.h"\r
+\r
+/* Scheduler includes. */\r
+#include "FreeRTOS.h"\r
+\r
+\r
+static unsigned portSHORT sState[ ledNUMBER_OF_LEDS ] = { pdFALSE };\r
+static unsigned portSHORT sState1[ ledNUMBER_OF_LEDS ] = { pdFALSE };\r
+\r
+/*-----------------------------------------------------------*/\r
+static void vPartestInitialise( void )\r
+{\r
+       DDR16=0xFF;\r
+       DDR25=0xFF;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vParTestToggleLED( unsigned portBASE_TYPE uxLED )\r
+{\r
+       if (uxLED < ledNUMBER_OF_LEDS)\r
+       {\r
+               vTaskSuspendAll();\r
+               \r
+               /* Toggle the state of the single genuine on board LED. */\r
+               if( sState[uxLED])      \r
+               {\r
+                       PDR25 |= (1 << uxLED);\r
+               }\r
+               else\r
+               {\r
+                       PDR25 &= ~(1 << uxLED);\r
+               }\r
+       \r
+               sState[uxLED] = !(sState[uxLED]);\r
+               \r
+               xTaskResumeAll();\r
+       }\r
+       else\r
+       {\r
+               uxLED -= ledNUMBER_OF_LEDS;\r
+               \r
+               vTaskSuspendAll();\r
+               \r
+               /* Toggle the state of the single genuine on board LED. */\r
+               if( sState1[uxLED])     \r
+               {\r
+                       PDR16 |= (1 << uxLED);\r
+               }\r
+               else\r
+               {\r
+                       PDR16 &= ~(1 << uxLED);\r
+               }\r
+       \r
+               sState1[uxLED] = !(sState1[uxLED]);\r
+               \r
+               xTaskResumeAll();\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )\r
+{\r
+       /* Set or clear the output [in this case show or hide the '*' character. */\r
+       if( uxLED < ledNUMBER_OF_LEDS )\r
+       {\r
+               vTaskSuspendAll();\r
+               {\r
+                       if( xValue )\r
+                       {\r
+                               PDR25 |= (1 << uxLED);\r
+                               sState[uxLED] = 1;\r
+                       }\r
+                       else\r
+                       {\r
+                               PDR25 &= ~(1 << uxLED);\r
+                               sState[uxLED] = 0;\r
+                       }\r
+               }\r
+               xTaskResumeAll();\r
+       }\r
+       else \r
+       {\r
+               uxLED -= ledNUMBER_OF_LEDS;\r
+               vTaskSuspendAll();\r
+               {\r
+                       if( xValue )\r
+                       {\r
+                               PDR16 |= (1 << uxLED);\r
+                               sState1[uxLED] = 1;\r
+                       }\r
+                       else\r
+                       {\r
+                               PDR16 &= ~(1 << uxLED);\r
+                               sState1[uxLED] = 0;\r
+                       }\r
+               }\r
+               xTaskResumeAll();\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r