Update comments for Doxygen. Move old, unused files to the testing folder.
[matches/MCTX3420.git] / server / pin_test.c
index 2ef0612..8640a60 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * @file pin_test.c
- * @purpose Implementations to allow direct control over pins through FastCGI
+ * @brief Implementations to allow direct control over pins through FastCGI
  */
 
 #include "pin_test.h"
@@ -27,9 +27,15 @@ void Pin_Close()
                ADC_Unexport(i);
 
        for (int i = 0; i < PWM_NUM_PINS; ++i)
-               PWM_Unexport(g_pin_safe_pwm[i]);
+               PWM_Unexport(i);
 }
 
+/**
+ * Configures a pin (Export/Unexport business)
+ * @param type The pin type (GPIO/PWM/ADC)
+ * @param pin_export Whether to export/unexport/leave-as-is the pin
+ * @param num The pin number
+ */
 bool Pin_Configure(const char *type, int pin_export, int num)
 {
        bool ret = true;
@@ -175,7 +181,7 @@ void Pin_Handler(FCGIContext *context, char * params)
        }
        else if (strcmp(type, "pwm") == 0)
        {
-               if (num < 0 || num >= PWM_NUM_SAFE_PINS)
+               if (num < 0 || num >= PWM_NUM_PINS)
                {
                        FCGI_RejectJSON(context, "Invalid PWM pin");
                        return;
@@ -201,7 +207,7 @@ void Pin_Handler(FCGIContext *context, char * params)
                else
                {
                        Log(LOGDEBUG, "Stopping PWM%d",num);
-                       PWM_Stop(g_pin_safe_pwm[num]);
+                       PWM_Stop(num);
                        FCGI_PrintRaw("Content-type: text/plain\r\n\r\n");
                        FCGI_PrintRaw("PWM%d stopped",num);
                }               
@@ -212,4 +218,4 @@ void Pin_Handler(FCGIContext *context, char * params)
                FCGI_RejectJSON(context, "Invalid pin type");
        }
 
-}
\ No newline at end of file
+}

UCC git Repository :: git.ucc.asn.au