diff --git a/src/hal/bl602/hal_wifi_bl602.c b/src/hal/bl602/hal_wifi_bl602.c index 2112eb8df..da4a7db53 100644 --- a/src/hal/bl602/hal_wifi_bl602.c +++ b/src/hal/bl602/hal_wifi_bl602.c @@ -33,9 +33,9 @@ void HAL_ConnectToWiFi(const char *ssid, const char *psk) int HAL_SetupWiFiOpenAccessPoint(const char *ssid) { uint8_t hidden_ssid = 0; - int channel; + //int channel; wifi_interface_t wifi_interface; - struct netif *net; + //struct netif *net; wifi_interface = wifi_mgmr_ap_enable(); /*no password when only one param*/ diff --git a/src/httpserver/http_fns.c b/src/httpserver/http_fns.c index 5d678f623..7e1005aac 100644 --- a/src/httpserver/http_fns.c +++ b/src/httpserver/http_fns.c @@ -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); diff --git a/src/httpserver/http_tcp_server.c b/src/httpserver/http_tcp_server.c index 35c3bb2af..2ab4ede4e 100644 --- a/src/httpserver/http_tcp_server.c +++ b/src/httpserver/http_tcp_server.c @@ -22,7 +22,7 @@ int sendfn(int fd, char * data, int len){ static void tcp_client_thread( int fd, char *buf, char *reply ) { - OSStatus err = kNoErr; + //OSStatus err = kNoErr; http_request_t request; os_memset(&request, 0, sizeof(request)); diff --git a/src/new_pins.c b/src/new_pins.c index 320213936..a612e3b33 100644 --- a/src/new_pins.c +++ b/src/new_pins.c @@ -1021,6 +1021,32 @@ static int CMD_SetChannelType(const void *context, const char *cmd, const char * 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; +} static int showgpi(const void *context, const char *cmd, const char *args, int cmdFlags){ int i; unsigned int value = 0; diff --git a/src/new_pins.h b/src/new_pins.h index 835bcae51..2da24dc68 100644 --- a/src/new_pins.h +++ b/src/new_pins.h @@ -193,6 +193,10 @@ bool CHANNEL_IsInUse(int ch); void Channel_SaveInFlashIfNeeded(int ch); bool CHANNEL_HasChannelSomeOutputPin(int ch); +int h_isChannelPWM(int tg_ch); +int h_isChannelRelay(int tg_ch); + + int PIN_GetPWMIndexForPinIndex(int pin); int PIN_ParsePinRoleName(const char *name);