tasmota forc of if2.0.3

This commit is contained in:
MichaelDvP
2022-05-01 18:14:09 +02:00
parent 53e3600af7
commit 7dc65a8c98
3 changed files with 9 additions and 8 deletions

View File

@@ -61,7 +61,8 @@ extra_scripts =
pre:scripts/build_interface.py pre:scripts/build_interface.py
scripts/rename_fw.py scripts/rename_fw.py
board = esp32dev board = esp32dev
platform = espressif32 ; platform = espressif32
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.3rc1/platform-espressif32-2.0.3.zip; board_build.f_cpu = 160000000L ; 160MHz
board_build.partitions = esp32_partition_app1984k_spiffs64k.csv board_build.partitions = esp32_partition_app1984k_spiffs64k.csv
build_flags = ${common.build_flags} build_flags = ${common.build_flags}
build_unflags = ${common.unbuild_flags} build_unflags = ${common.unbuild_flags}

View File

@@ -45,10 +45,6 @@ void EMSuart::uart_event_task(void * pvParameters) {
if (xQueueReceive(uart_queue, (void *)&event, (portTickType)portMAX_DELAY)) { if (xQueueReceive(uart_queue, (void *)&event, (portTickType)portMAX_DELAY)) {
switch (event.type) { switch (event.type) {
case UART_DATA: case UART_DATA:
uart_read_bytes(EMSUART_NUM, dtmp, event.size, portMAX_DELAY);
dtmp += event.size;
len += event.size;
break;
case UART_BUFFER_FULL: case UART_BUFFER_FULL:
uart_read_bytes(EMSUART_NUM, dtmp, event.size, portMAX_DELAY); uart_read_bytes(EMSUART_NUM, dtmp, event.size, portMAX_DELAY);
dtmp += event.size; dtmp += event.size;
@@ -85,10 +81,13 @@ void EMSuart::start(const uint8_t tx_mode, const uint8_t rx_gpio, const uint8_t
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE, .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.source_clk = UART_SCLK_APB, .source_clk = UART_SCLK_APB,
}; };
uart_driver_install(EMSUART_NUM, 256, 0, 34, &uart_queue, 0); // buffer 512 ok, 128 crash uart_driver_install(EMSUART_NUM, 256, 0, 34, &uart_queue, 0); // buffer 128 crash
uart_param_config(EMSUART_NUM, &uart_config); uart_param_config(EMSUART_NUM, &uart_config);
uart_set_pin(EMSUART_NUM, tx_gpio, rx_gpio, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); uart_set_pin(EMSUART_NUM, tx_gpio, rx_gpio, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
uart_set_rx_full_threshold(EMSUART_NUM, 1); uart_set_rx_full_threshold(EMSUART_NUM, 1);
// using own interrupt
// uart_isr_free(EMSUART_NUM);
// uart_isr_register(EMSUART_NUM, uart_intr_handle, NULL, ESP_INTR_FLAG_IRAM, &handle_console));
xTaskCreate(uart_event_task, "uart_event_task", 2048, NULL, configMAX_PRIORITIES - 1, NULL); xTaskCreate(uart_event_task, "uart_event_task", 2048, NULL, configMAX_PRIORITIES - 1, NULL);
} }
tx_mode_ = tx_mode; tx_mode_ = tx_mode;
@@ -154,6 +153,8 @@ uint16_t EMSuart::transmit(const uint8_t * buf, const uint8_t len) {
// mode 1: wait for echo after each byte // mode 1: wait for echo after each byte
for (uint8_t i = 0; i < len; i++) { for (uint8_t i = 0; i < len; i++) {
// or use
// uart_get_buffered_data_len(EMSUART_NUM, size_t *size);
uint8_t _usrxc = uxQueueMessagesWaiting(uart_queue); uint8_t _usrxc = uxQueueMessagesWaiting(uart_queue);
uart_write_bytes(EMSUART_NUM, &buf[i], 1); uart_write_bytes(EMSUART_NUM, &buf[i], 1);
uint16_t timeoutcnt = EMSUART_TX_TIMEOUT; uint16_t timeoutcnt = EMSUART_TX_TIMEOUT;

View File

@@ -34,8 +34,7 @@ WebStatusService::WebStatusService(AsyncWebServer * server, SecurityManager * se
void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) { void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) {
switch (event) { switch (event) {
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED: case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
EMSESP::logger().info(F("WiFi disconnected. Reason code=%d"), info.prov_fail_reason); // IDF 4.0 EMSESP::logger().info(F("WiFi disconnected. Reason code=%d"), info.wifi_sta_disconneced.reason); // IDF 4.0
// EMSESP::logger().info(F("WiFi disconnected. Reason code=%d"), info.disconnected.reason);
WiFi.disconnect(true); WiFi.disconnect(true);
break; break;