mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-08 03:45:40 +00:00
fixing compile warnings etc
This commit is contained in:
@ -92,32 +92,6 @@ int http_fn_empty_url(http_request_t *request) {
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
}
|
||||
int h_isChannelPWM(int tg_ch){
|
||||
int i;
|
||||
for(i = 0; i < PLATFORM_GPIO_MAX; i++) {
|
||||
int ch = PIN_GetPinChannelForPinIndex(i);
|
||||
if(tg_ch != ch)
|
||||
continue;
|
||||
int role = PIN_GetPinRoleForPinIndex(i);
|
||||
if(role == IOR_PWM) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
int h_isChannelRelay(int tg_ch) {
|
||||
int i;
|
||||
for(i = 0; i < PLATFORM_GPIO_MAX; i++) {
|
||||
int ch = PIN_GetPinChannelForPinIndex(i);
|
||||
if(tg_ch != ch)
|
||||
continue;
|
||||
int role = PIN_GetPinRoleForPinIndex(i);
|
||||
if(role == IOR_Relay || role == IOR_Relay_n || role == IOR_LED || role == IOR_LED_n) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int http_fn_index(http_request_t *request) {
|
||||
@ -1396,10 +1370,17 @@ int http_tasmota_json_power(http_request_t *request) {
|
||||
int http_tasmota_json_status_SNS(http_request_t *request) {
|
||||
float power, factor, voltage, current;
|
||||
|
||||
#ifndef OBK_DISABLE_ALL_DRIVERS
|
||||
factor = 0; // TODO
|
||||
voltage = DRV_GetReading(OBK_VOLTAGE);
|
||||
current = DRV_GetReading(OBK_CURRENT);
|
||||
power = DRV_GetReading(OBK_POWER);
|
||||
#else
|
||||
factor = 0;
|
||||
voltage = 0;
|
||||
current = 0;
|
||||
power = 0;
|
||||
#endif
|
||||
|
||||
hprintf128(request,"{\"StatusSNS\":{\"ENERGY\":{");
|
||||
hprintf128(request,"\"Power\": %f,", power);
|
||||
|
||||
Reference in New Issue
Block a user