mirror of
https://github.com/ADElectronics/RTL00_WEB_WS2812.git
synced 2026-07-01 04:05:39 +00:00
first release
This commit is contained in:
parent
9e39a46764
commit
8d743effde
63 changed files with 90030 additions and 93047 deletions
|
|
@ -45,9 +45,10 @@ int32_t ledFilter_Init(strip_handler_t *strip, ws2812_t *ws2812)
|
|||
memset(strip, 0xff, sizeof(strip_handler_t));
|
||||
strip->check = LEDFILTERS_CFG_CHECKWORD;
|
||||
strip->strip_len = DEF_STRIP_LEN;
|
||||
strip->delay = 10;
|
||||
strip->delay = 10; // îáùàÿ ñêîðîñòü
|
||||
strip->brightness = MAX_STRIP_BRIGHT;
|
||||
strip->isEnable = 1;
|
||||
strip->enable = 1;
|
||||
strip->try_enable = 0;
|
||||
cfg_updated = 1;
|
||||
}
|
||||
|
||||
|
|
@ -114,7 +115,7 @@ void ledFilter_Rainbow(ctx_rainbow_t *ctx, strip_handler_t *strip)
|
|||
ws2812_hsv_t tmp_hsv;
|
||||
uint8_t tmp_hue;
|
||||
|
||||
if (ctx->enabled == 0 || strip->isEnable == 0) return;
|
||||
if (ctx->enabled == 0 || strip->enable == 0) return;
|
||||
|
||||
tmp_hue = ctx->curr_hue;
|
||||
tmp_hsv.sat = 255;
|
||||
|
|
@ -165,7 +166,7 @@ void ledFilter_Fade(ctx_fade_t *ctx, strip_handler_t *strip)
|
|||
{
|
||||
uint32_t i;
|
||||
|
||||
if (ctx->enabled == 0 || strip->isEnable == 0) return;
|
||||
if (ctx->enabled == 0 || strip->enable == 0) return;
|
||||
|
||||
if (ctx->curr_val == 0)
|
||||
{
|
||||
|
|
@ -239,7 +240,7 @@ void ledFilter_Wave(ctx_wave_t *ctx, strip_handler_t *strip)
|
|||
{
|
||||
uint32_t i, j;
|
||||
uint8_t tmp_angle = 0;
|
||||
if (ctx->enabled == 0 || strip->isEnable == 0) return;
|
||||
if (ctx->enabled == 0 || strip->enable == 0) return;
|
||||
|
||||
tmp_angle = ctx->angle;
|
||||
for (i = 0, j = ctx->wave_steps; i < strip->strip_len; i++)
|
||||
|
|
@ -249,7 +250,7 @@ void ledFilter_Wave(ctx_wave_t *ctx, strip_handler_t *strip)
|
|||
j += ctx->wave_steps;
|
||||
tmp_angle = ctx->angle;
|
||||
}
|
||||
strip->hsv_vals[i].value = sin_table[tmp_angle]/2;
|
||||
strip->hsv_vals[i].value = sin_table[tmp_angle];
|
||||
tmp_angle += 255 / ctx->wave_steps;
|
||||
//tmp_angle %= 256;
|
||||
}
|
||||
|
|
@ -276,7 +277,22 @@ void ledFilter_InitConstant(ctx_const_t *ctx)
|
|||
void ledFilter_Constant(ctx_const_t *ctx, strip_handler_t *strip)
|
||||
{
|
||||
uint32_t i;
|
||||
if (strip->isEnable == 0)
|
||||
if (strip->try_enable)
|
||||
{
|
||||
for (i = 0; i < strip->strip_len; i++)
|
||||
{
|
||||
if (strip->hsv_vals[i].value < strip->brightness)
|
||||
strip->hsv_vals[i].value++;
|
||||
else
|
||||
{
|
||||
strip->enable = 1;
|
||||
strip->try_enable = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else if (strip->enable == 0)
|
||||
{
|
||||
for (i = 0; i < strip->strip_len; i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ typedef struct
|
|||
uint32_t strip_len;
|
||||
uint32_t brightness;
|
||||
uint32_t delay;
|
||||
uint8_t isEnable;
|
||||
uint8_t enable;
|
||||
uint8_t try_enable;
|
||||
} strip_handler_t;
|
||||
|
||||
int32_t ledFilter_Init(strip_handler_t *strip, ws2812_t *ws2812);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#define UTS_VERSION "2017/12/26-19:51:38"
|
||||
#define RTL8195AFW_COMPILE_TIME "2017/12/26-19:51:38"
|
||||
#define RTL8195AFW_COMPILE_DATE "20171226"
|
||||
#define UTS_VERSION "2017/12/28-23:03:40"
|
||||
#define RTL8195AFW_COMPILE_TIME "2017/12/28-23:03:40"
|
||||
#define RTL8195AFW_COMPILE_DATE "20171228"
|
||||
#define RTL8195AFW_COMPILE_BY "Andrew"
|
||||
#define RTL8195AFW_COMPILE_HOST ""
|
||||
#define RTL8195AFW_COMPILE_DOMAIN
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ int main(void)
|
|||
#endif
|
||||
|
||||
// wlan & user_start intialization
|
||||
xTaskCreate(user_init_thrd, "user_init", 1024, NULL, tskIDLE_PRIORITY + 1 + PRIORITIE_OFFSET, NULL);
|
||||
xTaskCreate(user_ws_thrd, "user_ws", 1024, NULL, tskIDLE_PRIORITY + 1 + PRIORITIE_OFFSET, NULL);
|
||||
xTaskCreate(user_init_thrd, "user_init", 512, NULL, tskIDLE_PRIORITY + 2 + PRIORITIE_OFFSET, NULL);
|
||||
xTaskCreate(user_ws_thrd, "user_ws", 512, NULL, tskIDLE_PRIORITY + 1 + PRIORITIE_OFFSET, NULL);
|
||||
|
||||
// Enable Schedule, Start Kernel
|
||||
#if defined(CONFIG_KERNEL) && !TASK_SCHEDULER_DISABLED
|
||||
|
|
|
|||
|
|
@ -4,23 +4,18 @@
|
|||
#define SYS_VERSION "1.0.1"
|
||||
#include "sdk_ver.h"
|
||||
|
||||
#define USE_WEB 80 // включить в трансялцию порт Web, если =0 - по умолчанию выключен
|
||||
#define WEBSOCKET_ENA 1 // включить WEBSOCKET
|
||||
#define USE_SNTP 1 // включить в трансялцию драйвер SNTP, если =0 - по умолчанию выключен, = 1 - по умолчанию включен.
|
||||
#define USE_NETBIOS 1 // включить в трансялцию драйвер NETBIOS, если =0 - по умолчанию выключен.
|
||||
#define USE_WEB 80 // включить в трансялцию порт Web, если =0 - по умолчанию выключен
|
||||
//#define WEBSOCKET_ENA 0 // включить WEBSOCKET
|
||||
//#define USE_SNTP 0 // включить в трансялцию драйвер SNTP, если =0 - по умолчанию выключен, = 1 - по умолчанию включен.
|
||||
//#define USE_NETBIOS 0 // включить в трансялцию драйвер NETBIOS, если =0 - по умолчанию выключен.
|
||||
|
||||
#define WEB_DEBUG_FUNCTIONS 1 // =1 - включить в WEB отладочные функции, =0 отключить (остается только конфигурация WiFi)
|
||||
|
||||
// #define WEB_INA219_DRV 1 (set in project.mk !)
|
||||
// #define WEB_ADC_DRV 1 (set in project.mk !)
|
||||
|
||||
|
||||
#ifdef _MSC_VER // IntelliSense
|
||||
#define __attribute__(packed)
|
||||
//typedef int8_t err_t;
|
||||
#endif
|
||||
|
||||
|
||||
#endif // _user_config_h_
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ struct SystemCfg syscfg = {
|
|||
|
||||
SemaphoreHandle_t sema_WEBReady = NULL;
|
||||
|
||||
extern void ShowMemInfo(void);
|
||||
void connect_start(void)
|
||||
{
|
||||
info_printf("\%s: Time at start %d ms.\n", __func__, xTaskGetTickCount());
|
||||
|
|
@ -106,7 +107,7 @@ void user_init_thrd(void)
|
|||
|
||||
if (!syscfg.cfg.b.debug_print_enable) print_off = 1;
|
||||
|
||||
console_init();
|
||||
//console_init();
|
||||
WEBFSInit();
|
||||
wifi_init(); // Load cfg, init WiFi + LwIP init, WiFi start if wifi_cfg.mode != RTW_MODE_NONE
|
||||
|
||||
|
|
@ -126,6 +127,7 @@ void user_init_thrd(void)
|
|||
|
||||
xSemaphoreGive(sema_WEBReady);
|
||||
}
|
||||
ShowMemInfo();
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ void ICACHE_FLASH_ATTR web_int_callback(TCP_SERV_CONN *ts_conn, uint8 *cstr)
|
|||
else ifcmp("value") tcp_puts("%d", filt_const.value);
|
||||
}
|
||||
}
|
||||
else ifcmp("isenable") tcp_puts("%d", strip.isEnable);
|
||||
else ifcmp("isenable") tcp_puts("%d", strip.enable);
|
||||
else ifcmp("striplen") tcp_puts("%d", strip.strip_len);
|
||||
}
|
||||
// **************************************************************************************************** //
|
||||
|
|
|
|||
|
|
@ -132,7 +132,13 @@ void ICACHE_FLASH_ATTR web_int_vars(TCP_SERV_CONN *ts_conn, uint8 *pcmd, uint8 *
|
|||
else ifcmp("update") filt_const.update = (uint8_t)val;
|
||||
}
|
||||
}
|
||||
else ifcmp("isenable") strip.isEnable = (uint8_t)val;
|
||||
else ifcmp("isenable")
|
||||
{
|
||||
if(val > 0)
|
||||
strip.try_enable = (uint8_t)val;
|
||||
else
|
||||
strip.enable = 0;
|
||||
}
|
||||
//else ifcmp("striplen") strip.strip_len = (uint8_t)val;
|
||||
}
|
||||
// **************************************************************************************************** //
|
||||
|
|
@ -295,7 +301,9 @@ void ICACHE_FLASH_ATTR web_int_vars(TCP_SERV_CONN *ts_conn, uint8 *pcmd, uint8 *
|
|||
os_memset(lwip_host_name[1], 0, LWIP_NETIF_HOSTNAME_SIZE);
|
||||
os_memcpy(lwip_host_name[1], pvar, len);
|
||||
}
|
||||
#ifdef USE_NETBIOS
|
||||
netbios_set_name(WLAN_AP_NETIF_NUM, lwip_host_name[1]);
|
||||
#endif
|
||||
if(wifi_cfg.save_flg & BID_AP_HOSTNAME) {
|
||||
WEB_SRV_QFNK x;
|
||||
x.fnc = write_wifi_cfg;
|
||||
|
|
@ -351,7 +359,9 @@ void ICACHE_FLASH_ATTR web_int_vars(TCP_SERV_CONN *ts_conn, uint8 *pcmd, uint8 *
|
|||
if(len) {
|
||||
os_memset(lwip_host_name[0], 0, LWIP_NETIF_HOSTNAME_SIZE);
|
||||
os_memcpy(lwip_host_name[0], pvar, len);
|
||||
#ifdef USE_NETBIOS
|
||||
netbios_set_name(WLAN_ST_NETIF_NUM, lwip_host_name[0]);
|
||||
#endif
|
||||
}
|
||||
if(wifi_cfg.save_flg & BID_ST_HOSTNAME) {
|
||||
WEB_SRV_QFNK x;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue