git.ucc.asn.au
/
matches
/
MCTX3420.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make usercake work on marbles
[matches/MCTX3420.git]
/
server
/
pin_test.c
diff --git
a/server/pin_test.c
b/server/pin_test.c
index
86685e8
..
77c0ef9
100644
(file)
--- a/
server/pin_test.c
+++ b/
server/pin_test.c
@@
-1,6
+1,6
@@
/**
* @file pin_test.c
/**
* @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"
*/
#include "pin_test.h"
@@
-27,7
+27,7
@@
void Pin_Close()
ADC_Unexport(i);
for (int i = 0; i < PWM_NUM_PINS; ++i)
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)
}
bool Pin_Configure(const char *type, int pin_export, int num)
@@
-118,7
+118,7
@@
void Pin_Handler(FCGIContext *context, char * params)
if (strcmp(type, "gpo") == 0)
{
if (strcmp(type, "gpo") == 0)
{
- if (num <= 0 || num > GPIO_
NUM_PINS
)
+ if (num <= 0 || num > GPIO_
MAX_NUMBER
)
{
FCGI_RejectJSON(context, "Invalid GPIO pin");
return;
{
FCGI_RejectJSON(context, "Invalid GPIO pin");
return;
@@
-137,7
+137,7
@@
void Pin_Handler(FCGIContext *context, char * params)
}
else if (strcmp(type, "gpi") == 0)
{
}
else if (strcmp(type, "gpi") == 0)
{
- if (num < 0 || num >
= GPIO_NUM_PINS
)
+ if (num < 0 || num >
GPIO_MAX_NUMBER
)
{
FCGI_RejectJSON(context, "Invalid GPIO pin");
return;
{
FCGI_RejectJSON(context, "Invalid GPIO pin");
return;
@@
-175,7
+175,7
@@
void Pin_Handler(FCGIContext *context, char * params)
}
else if (strcmp(type, "pwm") == 0)
{
}
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;
{
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);
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);
}
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");
}
FCGI_RejectJSON(context, "Invalid pin type");
}
-}
\ No newline at end of file
+}
UCC
git Repository :: git.ucc.asn.au