This commit is contained in:
pvvx 2017-05-11 21:21:23 +03:00
parent ca69e76c51
commit f8c731241d
6 changed files with 27 additions and 9 deletions

View file

@ -163,6 +163,10 @@ a lot of data that needs to be copied, this should be set high. */
/* ---------- ARP options ----------- */
#define LWIP_ARP 1
/**
* LWIP_AUTOIP==1: Enable AUTOIP module.
*/
#define LWIP_AUTOIP 0 //Realtek modified (0->1)
/* ---------- DHCP options ---------- */
/* Define LWIP_DHCP to 1 if you want DHCP configuration of

View file

@ -12,6 +12,9 @@
/*
* Target Platform Selection
*/
#define CONFIG_USE_TCM_HEAP 1
#define configUSE_STACK_TCM_HEAP 5 // min priority use tcm ?
#define CONFIG_WITHOUT_MONITOR 1
#undef CONFIG_RTL8195A

View file

@ -11,6 +11,8 @@
#define WEB_DEBUG_FUNCTIONS 1 // =1 - включить в WEB отладочные функции, =0 отключить (остается только конфигурация WiFi)
#define WEB_INA219_DRV 1
#endif // _user_config_h_

View file

@ -405,13 +405,6 @@ void ICACHE_FLASH_ATTR web_int_callback(TCP_SERV_CONN *ts_conn, uint8 *cstr)
else ifcmp("clkcpu") tcp_puts("%u", HalGetCpuClk());
else ifcmp("debug") tcp_put('1' - (print_off & 1)); // rtl_print on/off
#if WEB_DEBUG_FUNCTIONS
#if 1 // WEB_INA219_DRV
else ifcmp("ina219") {
if(CheckSCB(SCB_WEBSOC)) {
ina219_ws(val);
}
}
#endif
else ifcmp("restart") {
#if USE_WEB_AUTH_LEVEL
if(web_conn->auth_level < WEB_AUTH_LEVEL_USER) return;
@ -433,6 +426,16 @@ void ICACHE_FLASH_ATTR web_int_callback(TCP_SERV_CONN *ts_conn, uint8 *cstr)
#endif
else tcp_put('?');
}
#ifdef WEB_INA219_DRV
else ifcmp("ina219") {
if(CheckSCB(SCB_WEBSOC)) {
extern int ina219_ws(TCP_SERV_CONN *ts_conn, char cmd);
int x = ina219_ws(ts_conn, cstr[6]);
if(x < 0) SetSCB(SCB_FCLOSE|SCB_DISCONNECT);
else tcp_puts("%d", x);
}
}
#endif
else ifcmp("cfg_") {
cstr += 4;
ifcmp("web_") {

View file

@ -155,6 +155,7 @@ websock_rx_data(TCP_SERV_CONN *ts_conn)
SetSCB(SCB_FCLOSE|SCB_DISCONNECT);
return false;
}
web_conn->msgbufsize -= 16;
if(ws->frame_len == (sizeof(txt_wsping)-1) && rom_xstrcmp(pstr, txt_wsping) != 0){
copy_s4d1(pstr, (void *)txt_wspong, sizeof(txt_wspong) - 1);
if(websock_tx_frame(ts_conn, WS_OPCODE_TEXT | WS_FRAGMENT_FIN, pstr, sizeof(txt_wspong) - 1) != ERR_OK) {

View file

@ -1,3 +1,5 @@
WEB_INA219_DRV = 1
#USE_AT = 1
#USE_FATFS = 1
#USE_SDIOH = 1
@ -436,8 +438,11 @@ ADD_SRC_C += project/src/console/wifi_console.c
#ADD_SRC_C += project/src/console/pwm_tst.c
#ADD_SRC_C += project/src/console/wlan_tst.c
#ADD_SRC_C += project/src/ina219/ina219drv.c
##ADD_SRC_C += project/src/driver/i2c_drv.c
##ADD_SRC_C += project/src/ina219/ina219drv.c
ifdef WEB_INA219_DRV
ADD_SRC_C += project/src/driver/i2c_drv.c
ADD_SRC_C += project/src/ina219/ina219drv.c
CFLAGS += -DWEB_INA219_DRV=1
endif
#Web-свалка
INCLUDES += project/inc/web