fixing compile warnings etc

This commit is contained in:
openshwprojects
2022-07-31 20:20:13 +02:00
parent b4c975d888
commit 7fbcd110f9
5 changed files with 40 additions and 29 deletions

View File

@ -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);