]> rtime.felk.cvut.cz Git - arc.git/blobdiff - examples/switch_node/switch_node_helpers.c
Removed a lot of examples. Added some under boards.
[arc.git] / examples / switch_node / switch_node_helpers.c
diff --git a/examples/switch_node/switch_node_helpers.c b/examples/switch_node/switch_node_helpers.c
deleted file mode 100644 (file)
index 3014a22..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -------------------------------- Arctic Core ------------------------------\r
- * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
- *\r
- * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
- *\r
- * This source code is free software; you can redistribute it and/or modify it\r
- * under the terms of the GNU General Public License version 2 as published by the\r
- * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
- *\r
- * This program is distributed in the hope that it will be useful, but\r
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
- * for more details.\r
- * -------------------------------- Arctic Core ------------------------------*/\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-#include "Adc.h"\r
-#include "Com.h"\r
-#include "debug.h"\r
-#include "RTE_switch.h"\r
-\r
-#define SWITCH_LOW_THRESHOLD 100\r
-\r
-/*\r
- * ADC callback. This function is called each time the switches are read.\r
- */\r
-static Adc_ValueGroupType switchValues[ADC_NBR_OF_SWITCH_CHANNELS];\r
-void switch_node_switches_callback(void) {\r
-\r
-       if (E_OK == Adc_ReadGroup(ADC_SWITCHES, switchValues)) {\r
-\r
-               if (switchValues[ADC_SWITCH_RED] <= SWITCH_LOW_THRESHOLD) {\r
-                       switch_handle_switch1();\r
-               } else if (switchValues[ADC_SWITCH_BLACK] <= SWITCH_LOW_THRESHOLD) {\r
-                       switch_handle_switch2();\r
-               }\r
-\r
-       } else {\r
-               DEBUG(DEBUG_HIGH, "Switches failed!\n");\r
-       }\r
-}\r
-\r
-\r
-/*\r
- * Read values from Adc channels connected to potentiometers.\r
- * Nothing is done with their values though.\r
- */\r
-static Adc_ValueGroupType potentiometerValues[ADC_NBR_OF_POTENTIOMETER_CHANNELS];\r
-void switch_node_potentiometers_callback(void){\r
-\r
-       if (E_OK == Adc_ReadGroup(ADC_POTENTIOMETERS, potentiometerValues)) {\r
-               DEBUG(DEBUG_MEDIUM, "Potentiometers read successfully! %d %d\n", potentiometerValues[ADC_POTENTIOMETER_0], potentiometerValues[ADC_POTENTIOMETER_1]);\r
-\r
-       } else {\r
-               DEBUG(DEBUG_HIGH, "Potentiometers failed!\n");\r
-       }\r
-}\r
-\r
-\r