Skip to content

Commit

Permalink
ESP32-C3 upgrade for Standalone Edition: bringup of Wi-Fi, GNSS, SX12…
Browse files Browse the repository at this point in the history
…xx radio, BMP280 sensor, LED ring, buzzer and BLE is complete
  • Loading branch information
Linar Yusupov committed Feb 9, 2023
1 parent 780a7a4 commit 735ca4d
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Data|FLARM NMEA|<p align="center">![](https://github.com/lyusupov/SoftRF/raw/mas
Model(s)|Platform|First appearance|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|Notes
---|:---:|:---:|:---:|---
1&nbsp;[Prime](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition)<br>2&nbsp;[Standalone](https://github.com/lyusupov/SoftRF/wiki/Standalone-Edition)<br>3&nbsp;[UAV](https://github.com/lyusupov/SoftRF/wiki/UAV-Edition)<br>4&nbsp;[**WebTop&nbsp;Serial**](https://github.com/lyusupov/SoftRF/wiki/WebTop-Serial-adapter)|[Espressif<br>ESP8266](https://en.wikipedia.org/wiki/ESP8266)|Q4 2015|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_good.png)<!-- ![](https://via.placeholder.com/140x70/00A000/000000?text=Good) -->|[Prime](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition) model is no longer supported - use [Prime MkII](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition-MkII) instead.<br><!-- ESP8266 platform will be phased out through year 2020 in favour of ESP32.-->
1&nbsp;[**Prime Mark II**](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition-MkII)<br>2&nbsp;[**Standalone**](https://github.com/lyusupov/SoftRF/wiki/Standalone-Edition) + [adapter](https://github.com/lyusupov/ESP32-NODEMCU-ADAPTER)<br>3&nbsp;[UAV](https://github.com/lyusupov/SoftRF/wiki/UAV-Edition)<br>4&nbsp;[**SkyView EZ**](https://github.com/lyusupov/SoftRF/wiki/SkyView-EZ)<br>5&nbsp;[Flight Recorder](https://github.com/lyusupov/SoftRF/wiki/Flight-Recorder)<br>6&nbsp;[**WebTop USB**](https://github.com/lyusupov/SoftRF/wiki/WebTop-USB)![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)|[Espressif<br>ESP32](https://en.wikipedia.org/wiki/ESP32)<br>[ESP32-S2](https://en.wikipedia.org/wiki/ESP32#ESP32-S2)<br>[ESP32-S3](https://en.wikipedia.org/wiki/ESP32#ESP32-S3)|Q1 2018|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_good.png)|1&nbsp;today's best platform ;<br>2&nbsp;holds [**FCC** mark](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition-MkII#certificates)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)
1&nbsp;[**Prime Mark II**](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition-MkII)<br>2&nbsp;[**Standalone**](https://github.com/lyusupov/SoftRF/wiki/Standalone-Edition) + [adapter](https://github.com/lyusupov/ESP32-NODEMCU-ADAPTER)<br>3&nbsp;[UAV](https://github.com/lyusupov/SoftRF/wiki/UAV-Edition)<br>4&nbsp;[**SkyView EZ**](https://github.com/lyusupov/SoftRF/wiki/SkyView-EZ)<br>5&nbsp;[Flight Recorder](https://github.com/lyusupov/SoftRF/wiki/Flight-Recorder)<br>6&nbsp;[**WebTop USB**](https://github.com/lyusupov/SoftRF/wiki/WebTop-USB)![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)|[Espressif<br>ESP32](https://en.wikipedia.org/wiki/ESP32)<br>[ESP32-S2](https://en.wikipedia.org/wiki/ESP32#ESP32-S2)<br>[ESP32-S3](https://en.wikipedia.org/wiki/ESP32#ESP32-S3)<br>[ESP32-C3](https://en.wikipedia.org/wiki/ESP32#ESP32-C3)|Q1 2018|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_good.png)|1&nbsp;today's best platform ;<br>2&nbsp;holds [**FCC** mark](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition-MkII#certificates)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)
1&nbsp;[**Raspberry Edition**](https://github.com/lyusupov/SoftRF/wiki/Raspberry-Edition)<br>2&nbsp;[**SkyView Pi**](https://github.com/lyusupov/SoftRF/wiki/SkyView-Pi)|[Broadcom<br>BCM283X<br>(Raspberry Pi)](https://en.wikipedia.org/wiki/Raspberry_Pi)|Q4 2018|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_good.png)|Good for use together with RTL-SDR dongles to achieve additional 1090ES (and 978UAT) ADS-B air traffic reception.
1&nbsp;[UAT module](https://github.com/lyusupov/UAT-test-signal#variant-2-advanced)<br>2&nbsp;[**Uni**](https://github.com/lyusupov/SoftRF/wiki/Uni-Edition)|[Texas Instruments<br>CC1310](http://www.ti.com/product/CC1310) and [CC13x2R](http://www.ti.com/product/CC1352R)|Q1 2019|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_good.png)<!-- ![](https://via.placeholder.com/140x70/FFFF00/000000?text=In+progress) -->|1&nbsp;Unique RF radio specs are useful for [UAT978 **ADS-B** reception](https://github.com/lyusupov/SoftRF/tree/master/software/firmware/source/UATbridge) [ [1](https://raw.githubusercontent.com/lyusupov/SoftRF/master/documents/images/uat-normal-7.jpg) , [2](https://raw.githubusercontent.com/lyusupov/SoftRF/master/documents/images/uat-normal-8.jpg) , [3](https://raw.githubusercontent.com/lyusupov/SoftRF/master/documents/images/uat-normal-6.jpg) ] ; <br>2&nbsp;holds [**FCC/CE** mark](https://github.com/lyusupov/SoftRF/wiki/Uni-Edition#certificates)
1&nbsp;[Retro](https://github.com/lyusupov/SoftRF/wiki/Retro-Edition)<br>2&nbsp;[**Dongle**](https://github.com/lyusupov/SoftRF/wiki/Dongle-Edition)<!-- <br>3&nbsp;[**Bracelet**](https://github.com/lyusupov/SoftRF/wiki/Bracelet-Edition)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg) --><br>3&nbsp;[**Balkan**](https://github.com/lyusupov/SoftRF/wiki/Balkan-Edition)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)|[STMicroelectronics](https://en.wikipedia.org/wiki/STMicroelectronics)<br>[STM32**L073**](https://www.st.com/en/microcontrollers-microprocessors/stm32l073rz.html) and<br>[STM32**WLE5**](https://www.st.com/en/microcontrollers-microprocessors/stm32wle5cc.html)|Q3 2019|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_good.png)<!-- ![](https://via.placeholder.com/140x70/FFFF00/000000?text=In+progress)-->|<!-- [AcSiP **S76G**](http://www.acsip.com.tw/index.php?action=products-detail&fid1=19&fid2=&fid3=&id=41&lang=3) "3-in-1" system-in-package is doing good [ [1](https://raw.githubusercontent.com/lyusupov/SoftRF/master/documents/images/watch-1.jpg) , [2](https://raw.githubusercontent.com/lyusupov/SoftRF/master/documents/images/t-motion-4.jpg) , [3](https://raw.githubusercontent.com/lyusupov/SoftRF/master/documents/images/t-motion-5.jpg) ] .<br>As well as STM32F103C8 "**Blue Pill**" (same MCU that [STM32 OGN tracker](http://wiki.glidernet.org/stm32-ogn-tracker) uses) [ [4](https://raw.githubusercontent.com/lyusupov/SoftRF/master/documents/images/stm32_breadboard.jpg) , [5](https://raw.githubusercontent.com/lyusupov/SoftRF/master/documents/images/stm32_ognweb_1.JPG) ] . -->
Expand Down
2 changes: 1 addition & 1 deletion software/firmware/binaries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

Model|Instructions|Firmware folder
---|:---:|:---:
[Standalone Edition](https://github.com/lyusupov/SoftRF/wiki/Standalone-Edition)|[NodeMCU](https://github.com/lyusupov/SoftRF/blob/master/software/firmware/binaries/README.md#nodemcu)|[NodeMCU](https://github.com/lyusupov/SoftRF/tree/master/software/firmware/binaries/NodeMCU/SoftRF)
[Standalone Edition](https://github.com/lyusupov/SoftRF/wiki/Standalone-Edition)|[NodeMCU](https://github.com/lyusupov/SoftRF/blob/master/software/firmware/binaries/README.md#nodemcu)<br>ESP32-C3|[NodeMCU](https://github.com/lyusupov/SoftRF/tree/master/software/firmware/binaries/NodeMCU/SoftRF)<br>ESP32C3
[Prime Edition Mk2](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition-MkII)|[ESP32](https://github.com/lyusupov/SoftRF/blob/master/software/firmware/binaries/README.md#esp32)|[ESP32](https://github.com/lyusupov/SoftRF/tree/master/software/firmware/binaries/ESP32/SoftRF)
Prime Edition Mk3|[ESP32-S3](https://github.com/lyusupov/SoftRF/blob/master/software/firmware/binaries/README.md#esp32-s3)|[ESP32S3](https://github.com/lyusupov/SoftRF/tree/master/software/firmware/binaries/ESP32S3/SoftRF/MassStorage)
[Badge Edition](https://github.com/lyusupov/SoftRF/wiki/Badge-Edition)|[nRF52840](https://github.com/lyusupov/SoftRF/blob/master/software/firmware/binaries/README.md#nrf52840)|[nRF52840](https://github.com/lyusupov/SoftRF/tree/master/software/firmware/binaries/nRF52840)
Expand Down
4 changes: 4 additions & 0 deletions software/firmware/source/SoftRF/src/platform/ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,10 @@ static bool ESP32_Baro_setup()

Wire.setPins(SOC_GPIO_PIN_S3_SDA, SOC_GPIO_PIN_S3_SCL);

} else if (esp32_board == ESP32_C3_DEVKIT) {

Wire.setPins(SOC_GPIO_PIN_C3_SDA, SOC_GPIO_PIN_C3_SCL);

} else if (hw_info.model != SOFTRF_MODEL_PRIME_MK2) {

if ((hw_info.rf != RF_IC_SX1276 && hw_info.rf != RF_IC_SX1262) ||
Expand Down
27 changes: 14 additions & 13 deletions software/firmware/source/SoftRF/src/platform/ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

#define LED_STATE_ON HIGH // State when LED is litted

#if defined(CONFIG_IDF_TARGET_ESP32S3)
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
/* Adafruit_NeoPixel still has "flickering" issue of ESP32 caused by 1 ms scheduler */
#define USE_ADAFRUIT_NEO_LIBRARY

Expand Down Expand Up @@ -124,7 +124,7 @@ extern Adafruit_NeoPixel strip;
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
#define SOC_GPIO_PIN_LED SOC_UNUSED_PIN /* TBD 14? */
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
#define SOC_GPIO_PIN_LED SOC_UNUSED_PIN
#define SOC_GPIO_PIN_LED 19 /* D1 */
#else
#error "This ESP32 family build variant is not supported!"
#endif
Expand All @@ -147,10 +147,11 @@ extern Adafruit_NeoPixel strip;
SOC_UNUSED_PIN) : \
SOC_UNUSED_PIN))

#define SOC_GPIO_PIN_BUZZER (hw_info.model == SOFTRF_MODEL_PRIME_MK2 ?\
SOC_UNUSED_PIN : \
(esp32_board == ESP32_DEVKIT ? \
13 : SOC_UNUSED_PIN))
#define SOC_GPIO_PIN_BUZZER (hw_info.model == SOFTRF_MODEL_PRIME_MK2 ? \
SOC_UNUSED_PIN : \
(esp32_board == ESP32_DEVKIT ? 13 : \
(esp32_board == ESP32_C3_DEVKIT ? \
SOC_GPIO_PIN_C3_BUZZER : SOC_UNUSED_PIN)))

/* SPI (does match Heltec & TTGO LoRa32 pins mapping) */
#define SOC_GPIO_PIN_MOSI 27
Expand Down Expand Up @@ -371,8 +372,8 @@ extern Adafruit_NeoPixel strip;

// GNSS module
#define SOC_GPIO_PIN_C3_GNSS_RX 9 /* D3 */
#define SOC_GPIO_PIN_C3_GNSS_TX 19 /* D1 */
#define SOC_GPIO_PIN_C3_GNSS_PPS SOC_UNUSED_PIN // 7
#define SOC_GPIO_PIN_C3_GNSS_TX 7
#define SOC_GPIO_PIN_C3_GNSS_PPS SOC_UNUSED_PIN // 0

// SPI
#define SOC_GPIO_PIN_C3_MOSI 5 /* D7 */
Expand All @@ -387,15 +388,14 @@ extern Adafruit_NeoPixel strip;

// SX1276
#define SOC_GPIO_PIN_C3_RST 18 /* D2 */
#define SOC_GPIO_PIN_C3_DIO0 19 /* D0 */
#define SOC_GPIO_PIN_C3_DIO0 2 /* D0 */
#define SOC_GPIO_PIN_C3_SDA 18 /* D2 */
#define SOC_GPIO_PIN_C3_SCL 10 /* D4 */

// battery voltage (ADC)
#define SOC_GPIO_PIN_C3_BATTERY 1 /* A0 */

// auxillary
#define SOC_GPIO_PIN_C3_LED 19 /* D1 */
#define SOC_GPIO_PIN_C3_BUZZER 6 /* 10 */
#define SOC_GPIO_PIN_C3_STATUS SOC_UNUSED_PIN

Expand Down Expand Up @@ -478,10 +478,10 @@ struct rst_info {
//#define USE_GDL90_MSL
#define USE_OGN_ENCRYPTION

//#define EXCLUDE_GNSS_UBLOX /* Neo-6/7/8 */
//#define EXCLUDE_GNSS_UBLOX /* Neo-6/7/8, M10 */
#define ENABLE_UBLOX_RFS /* revert factory settings (when necessary) */
#define EXCLUDE_GNSS_GOKE /* 'Air530' GK9501 GPS/GLO/BDS (GAL inop.) */
//#define EXCLUDE_GNSS_AT65 /* 'fake Neo-6/8' on some 2018 T-Beam boards */
//#define EXCLUDE_GNSS_AT65 /* L76K, Air530Z */
#define EXCLUDE_GNSS_SONY
#define EXCLUDE_GNSS_MTK

Expand All @@ -493,9 +493,10 @@ struct rst_info {
#if !defined(CONFIG_IDF_TARGET_ESP32)
#define EXCLUDE_NRF905
#define EXCLUDE_UATM
#define EXCLUDE_LED_RING

#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
#define EXCLUDE_LED_RING

/* Experimental */
//#define USE_ADAFRUIT_MSC
//#define USE_USB_HOST
Expand Down
178 changes: 178 additions & 0 deletions software/firmware/source/libraries/Adafruit_NeoPixel/esp.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
// Implements the RMT peripheral on Espressif SoCs
// Copyright (c) 2020 Lucian Copeland for Adafruit Industries

/* Uses code from Espressif RGB LED Strip demo and drivers
* Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#if defined(ESP32)

#include <Arduino.h>
#include "driver/rmt.h"

#if defined(ESP_IDF_VERSION)
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
#define HAS_ESP_IDF_4
#endif
#endif

// This code is adapted from the ESP-IDF v3.4 RMT "led_strip" example, altered
// to work with the Arduino version of the ESP-IDF (3.2)

#define WS2812_T0H_NS (400)
#define WS2812_T0L_NS (850)
#define WS2812_T1H_NS (800)
#define WS2812_T1L_NS (450)

#define WS2811_T0H_NS (500)
#define WS2811_T0L_NS (2000)
#define WS2811_T1H_NS (1200)
#define WS2811_T1L_NS (1300)

static uint32_t t0h_ticks = 0;
static uint32_t t1h_ticks = 0;
static uint32_t t0l_ticks = 0;
static uint32_t t1l_ticks = 0;

// Limit the number of RMT channels available for the Neopixels. Defaults to all
// channels (8 on ESP32, 4 on ESP32-S2 and S3). Redefining this value will free
// any channels with a higher number for other uses, such as IR send-and-recieve
// libraries. Redefine as 1 to restrict Neopixels to only a single channel.
#define ADAFRUIT_RMT_CHANNEL_MAX RMT_CHANNEL_MAX

#define RMT_LL_HW_BASE (&RMT)

bool rmt_reserved_channels[ADAFRUIT_RMT_CHANNEL_MAX];

static void IRAM_ATTR ws2812_rmt_adapter(const void *src, rmt_item32_t *dest, size_t src_size,
size_t wanted_num, size_t *translated_size, size_t *item_num)
{
if (src == NULL || dest == NULL) {
*translated_size = 0;
*item_num = 0;
return;
}
const rmt_item32_t bit0 = {{{ t0h_ticks, 1, t0l_ticks, 0 }}}; //Logical 0
const rmt_item32_t bit1 = {{{ t1h_ticks, 1, t1l_ticks, 0 }}}; //Logical 1
size_t size = 0;
size_t num = 0;
uint8_t *psrc = (uint8_t *)src;
rmt_item32_t *pdest = dest;
while (size < src_size && num < wanted_num) {
for (int i = 0; i < 8; i++) {
// MSB first
if (*psrc & (1 << (7 - i))) {
pdest->val = bit1.val;
} else {
pdest->val = bit0.val;
}
num++;
pdest++;
}
size++;
psrc++;
}
*translated_size = size;
*item_num = num;
}

void espShow(uint8_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz) {
// Reserve channel
rmt_channel_t channel = ADAFRUIT_RMT_CHANNEL_MAX;
for (size_t i = 0; i < ADAFRUIT_RMT_CHANNEL_MAX; i++) {
if (!rmt_reserved_channels[i]) {
rmt_reserved_channels[i] = true;
channel = i;
break;
}
}
if (channel == ADAFRUIT_RMT_CHANNEL_MAX) {
// Ran out of channels!
return;
}

#if defined(HAS_ESP_IDF_4)
rmt_config_t config = RMT_DEFAULT_CONFIG_TX(pin, channel);
config.clk_div = 2;
#else
// Match default TX config from ESP-IDF version 3.4
rmt_config_t config = {
.rmt_mode = RMT_MODE_TX,
.channel = channel,
.gpio_num = pin,
.clk_div = 2,
.mem_block_num = 1,
.tx_config = {
.carrier_freq_hz = 38000,
.carrier_level = RMT_CARRIER_LEVEL_HIGH,
.idle_level = RMT_IDLE_LEVEL_LOW,
.carrier_duty_percent = 33,
.carrier_en = false,
.loop_en = false,
.idle_output_en = true,
}
};
#endif
rmt_config(&config);
rmt_driver_install(config.channel, 0, 0);

// Convert NS timings to ticks
uint32_t counter_clk_hz = 0;

#if defined(HAS_ESP_IDF_4)
rmt_get_counter_clock(channel, &counter_clk_hz);
#else
// this emulates the rmt_get_counter_clock() function from ESP-IDF 3.4
if (RMT_LL_HW_BASE->conf_ch[config.channel].conf1.ref_always_on == RMT_BASECLK_REF) {
uint32_t div_cnt = RMT_LL_HW_BASE->conf_ch[config.channel].conf0.div_cnt;
uint32_t div = div_cnt == 0 ? 256 : div_cnt;
counter_clk_hz = REF_CLK_FREQ / (div);
} else {
uint32_t div_cnt = RMT_LL_HW_BASE->conf_ch[config.channel].conf0.div_cnt;
uint32_t div = div_cnt == 0 ? 256 : div_cnt;
counter_clk_hz = APB_CLK_FREQ / (div);
}
#endif

// NS to tick converter
float ratio = (float)counter_clk_hz / 1e9;

if (is800KHz) {
t0h_ticks = (uint32_t)(ratio * WS2812_T0H_NS);
t0l_ticks = (uint32_t)(ratio * WS2812_T0L_NS);
t1h_ticks = (uint32_t)(ratio * WS2812_T1H_NS);
t1l_ticks = (uint32_t)(ratio * WS2812_T1L_NS);
} else {
t0h_ticks = (uint32_t)(ratio * WS2811_T0H_NS);
t0l_ticks = (uint32_t)(ratio * WS2811_T0L_NS);
t1h_ticks = (uint32_t)(ratio * WS2811_T1H_NS);
t1l_ticks = (uint32_t)(ratio * WS2811_T1L_NS);
}

// Initialize automatic timing translator
rmt_translator_init(config.channel, ws2812_rmt_adapter);

// Write and wait to finish
rmt_write_sample(config.channel, pixels, (size_t)numBytes, true);
rmt_wait_tx_done(config.channel, pdMS_TO_TICKS(100));

// Free channel again
rmt_driver_uninstall(config.channel);
rmt_reserved_channels[channel] = false;

gpio_set_direction(pin, GPIO_MODE_OUTPUT);
}

#endif
14 changes: 1 addition & 13 deletions software/firmware/source/libraries/Adafruit_NeoPixel/esp8266.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ESP8266 work for the NeoPixelBus library: github.com/Makuna/NeoPixelBus
// Needs to be a separate .c file to enforce ICACHE_RAM_ATTR execution.

#if defined(ESP8266) || defined(ESP32)
#if defined(ESP8266)

#include <Arduino.h>
#ifdef ESP8266
Expand Down Expand Up @@ -55,14 +55,6 @@ void espShow(
}
#endif

#if defined(ESP32)
delay(1); // required

portMUX_TYPE updateMux = portMUX_INITIALIZER_UNLOCKED;

taskENTER_CRITICAL(&updateMux);
#endif

for(t = time0;; t = time0) {
if(pix & mask) t = time1; // Bit high duration
while(((c = _getCycleCount()) - startTime) < period); // Wait for bit start
Expand All @@ -85,10 +77,6 @@ void espShow(
}
}

#if defined(ESP32)
taskEXIT_CRITICAL(&updateMux);
#endif

while((_getCycleCount() - startTime) < period); // Wait for last bit
}

Expand Down

0 comments on commit 735ca4d

Please sign in to comment.