X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fpin_test.c;h=77c0ef9a32064428e047e9368635581c2ffe6547;hb=6bc90047ed36b392d90a1bf778baf9687b835f2d;hp=2ef06120f8313feff4331c6051e3393aea4b9026;hpb=f96e7c76c334e7ae4c60615bc0f0abd328830ab4;p=matches%2FMCTX3420.git diff --git a/server/pin_test.c b/server/pin_test.c index 2ef0612..77c0ef9 100644 --- a/server/pin_test.c +++ b/server/pin_test.c @@ -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,7 +27,7 @@ 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); } bool Pin_Configure(const char *type, int pin_export, int num) @@ -175,7 +175,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 +201,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 +212,4 @@ void Pin_Handler(FCGIContext *context, char * params) FCGI_RejectJSON(context, "Invalid pin type"); } -} \ No newline at end of file +}