add debug led code
This commit is contained in:
parent
8d5f623b6a
commit
8cdf981c8f
1 changed files with 9 additions and 2 deletions
|
@ -179,9 +179,12 @@ led1_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_
|
|||
if (!strcmp(mode, "on")) {
|
||||
led1_on();
|
||||
led1 = 1;
|
||||
optriac_sensor.configure(OPTRIAC_SENSOR_A,1);
|
||||
|
||||
} else if (!strcmp(mode, "off")) {
|
||||
led1_off();
|
||||
led1 = 0;
|
||||
optriac_sensor.configure(OPTRIAC_SENSOR_A,0);
|
||||
} else {
|
||||
success = 0;
|
||||
}
|
||||
|
@ -266,9 +269,9 @@ optriac_handler(void* request, void* response, uint8_t *buffer, uint16_t preferr
|
|||
if (strncmp(type, "a", len)==0) {
|
||||
triac = OPTRIAC_SENSOR_A;
|
||||
} else if(strncmp(type,"b", len)==0) {
|
||||
triac = OPTRIAC_SENSOR_A;
|
||||
triac = OPTRIAC_SENSOR_B;
|
||||
} else {
|
||||
success = 0;
|
||||
triac = OPTRIAC_SENSOR_A;
|
||||
}
|
||||
} else {
|
||||
success = 0;
|
||||
|
@ -279,8 +282,12 @@ optriac_handler(void* request, void* response, uint8_t *buffer, uint16_t preferr
|
|||
|
||||
if (strncmp(mode, "on", len)==0) {
|
||||
optriac_sensor.configure(triac,1);
|
||||
led1_on();
|
||||
led1 = 1;
|
||||
} else if (strncmp(mode, "off", len)==0) {
|
||||
optriac_sensor.configure(triac,1);
|
||||
led1_off();
|
||||
led1 = 0;
|
||||
} else {
|
||||
success = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue