Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 0411a97

Browse files
author
Daniel Campora
committed
esp32: Merge with master up to version 1.12.0.b1.
1 parent 5ee2f63 commit 0411a97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+217
-264
lines changed

Jenkinsfile

+21-16
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
def buildVersion
22
def boards_to_build_1 = ["LoPy_868", "WiPy"]
3-
def boards_to_build_2 = ["LopY_915", "SiPy"]
3+
def boards_to_build_2 = ["LoPy_915", "SiPy"]
44
def boards_to_build_3 = ["FiPy_868", "GPy"]
55
def boards_to_build_4 = ["FiPy_915"]
6-
def boards_to_test = ["GPy"]
6+
def boards_to_test = ["FiPy_868"]
77
def remote_node = "UDOO"
88

99
node {
@@ -16,9 +16,11 @@ node {
1616

1717
stage('mpy-cross') {
1818
// build the cross compiler first
19-
sh '''cd mpy-cross;
20-
make clean;
21-
make all'''
19+
sh '''export GIT_TAG=$(git rev-parse --short HEAD)
20+
git tag -fa v1.8.6-849-$GIT_TAG -m \\"v1.8.6-849-$GIT_TAG\\";
21+
cd mpy-cross;
22+
make clean;
23+
make all'''
2224
}
2325

2426
// build the boards in four cycles
@@ -98,11 +100,11 @@ node {
98100
sleep(5) //Delay to skip all bootlog
99101
dir('tests') {
100102
timeout(30) {
101-
sh '''./run-tests --target=esp32-''' + name + ''' --device /dev/ttyACM1'''
103+
sh '''./run-tests --target=esp32-''' + name + ''' --device /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00'''
102104
}
103105
}
104-
sh 'python esp32/tools/pypic.py --port /dev/ttyACM1 --enter'
105-
sh 'python esp32/tools/pypic.py --port /dev/ttyACM1 --exit'
106+
sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --enter'
107+
sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --exit'
106108
}
107109
}
108110
}
@@ -116,11 +118,11 @@ def flashBuild(name) {
116118
unstash 'esp32Tools'
117119
unstash 'tests'
118120
unstash 'tools'
119-
sh 'python esp32/tools/pypic.py --port /dev/ttyACM1 --enter'
120-
sh 'esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyACM1 --baud 921600 erase_flash'
121-
sh 'python esp32/tools/pypic.py --port /dev/ttyACM1 --enter'
122-
sh 'esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyACM1 --baud 921600 --before no_reset --after no_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 esp32/build/'+ name +'/release/bootloader/bootloader.bin 0x8000 esp32/build/'+ name +'/release/lib/partitions.bin 0x10000 esp32/build/'+ name +'/release/appimg.bin'
123-
sh 'python esp32/tools/pypic.py --port /dev/ttyACM1 --exit'
121+
sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --enter'
122+
sh 'esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --baud 921600 erase_flash'
123+
sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --enter'
124+
sh 'esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --baud 921600 --before no_reset --after no_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 esp32/build/'+ name +'/release/bootloader/bootloader.bin 0x8000 esp32/build/'+ name +'/release/lib/partitions.bin 0x10000 esp32/build/'+ name +'/release/appimg.bin'
125+
sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --exit'
124126
}
125127
}
126128
}
@@ -153,15 +155,18 @@ def boardBuild(name) {
153155
make TARGET=app -j2 BOARD=''' + name_short + lora_band
154156

155157
sh '''cd esp32/build/'''+ name_u +'''/release;
156-
mkdir -p firmware_package;
158+
export PYCOM_VERSION=$(cat ../../../pycom_version.h |grep SW_VERSION_NUMBER|cut -d\\" -f2);
159+
export GIT_TAG=$(git rev-parse --short HEAD);
160+
mkdir -p firmware_package;
161+
mkdir -p /var/lib/jenkins/release/\$PYCOM_VERSION/\$GIT_TAG;
157162
cd firmware_package;
158163
cp ../bootloader/bootloader.bin .;
159-
mv ../application.elf /var/lib/jenkins/release/''' + name + '''-$(cat ../../../../pycom_version.h |grep SW_VERSION_NUMBER|cut -d\\" -f2)-application.elf;
164+
mv ../application.elf /var/lib/jenkins/release/\$PYCOM_VERSION/\$GIT_TAG/''' + name + '''-\$PYCOM_VERSION-application.elf;
160165
cp ../appimg.bin .;
161166
cp ../lib/partitions.bin .;
162167
cp ../../../../boards/''' + name_short + '''/''' + name_u + '''/script .;
163168
cp ../''' + app_bin + ''' .;
164-
tar -cvzf /var/lib/jenkins/release/''' + name + '''-$(cat ../../../../pycom_version.h |grep SW_VERSION_NUMBER|cut -d\\" -f2).tar.gz appimg.bin bootloader.bin partitions.bin script ''' + app_bin
169+
tar -cvzf /var/lib/jenkins/release/\$PYCOM_VERSION/\$GIT_TAG/''' + name + '''-\$PYCOM_VERSION.tar.gz appimg.bin bootloader.bin partitions.bin script ''' + app_bin
165170
}
166171
}
167172

drivers/sx127x/sx1272/sx1272.c

+14-4
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ void SX1272Send( uint8_t *buffer, uint8_t size )
637637
SX1272SetTx( txTimeout );
638638
}
639639

640-
void SX1272SetSleep( void )
640+
IRAM_ATTR void SX1272SetSleep( void )
641641
{
642642
TimerStop( &RxTimeoutTimer );
643643
TimerStop( &TxTimeoutTimer );
@@ -854,10 +854,15 @@ IRAM_ATTR void SX1272SetOpMode( uint8_t opMode )
854854

855855
IRAM_ATTR void SX1272SetModem( RadioModems_t modem )
856856
{
857-
if( SX1272.Spi.Spi == NULL )
857+
if( ( SX1272Read( REG_OPMODE ) & RFLR_OPMODE_LONGRANGEMODE_ON ) != 0 )
858858
{
859-
while( 1 );
859+
SX1272.Settings.Modem = MODEM_LORA;
860860
}
861+
else
862+
{
863+
SX1272.Settings.Modem = MODEM_FSK;
864+
}
865+
861866
if( SX1272.Settings.Modem == modem )
862867
{
863868
return;
@@ -868,9 +873,14 @@ IRAM_ATTR void SX1272SetModem( RadioModems_t modem )
868873
{
869874
default:
870875
case MODEM_FSK:
876+
SX1272SetSleep( );
877+
SX1272Write( REG_OPMODE, ( SX1272Read( REG_OPMODE ) & RFLR_OPMODE_LONGRANGEMODE_MASK ) | RFLR_OPMODE_LONGRANGEMODE_OFF );
878+
879+
SX1272Write( REG_DIOMAPPING1, 0x00 );
880+
SX1272Write( REG_DIOMAPPING2, 0x30 ); // DIO5=ModeReady
871881
break;
872882
case MODEM_LORA:
873-
SX1272SetOpMode( RF_OPMODE_SLEEP );
883+
SX1272SetSleep( );
874884
SX1272Write( REG_OPMODE, ( SX1272Read( REG_OPMODE ) & RFLR_OPMODE_LONGRANGEMODE_MASK ) | RFLR_OPMODE_LONGRANGEMODE_ON );
875885

876886
SX1272Write( REG_DIOMAPPING1, 0x00 );

esp32/Makefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ LIBS = -L$(ESP_IDF_COMP_PATH)/esp32/lib -L$(ESP_IDF_COMP_PATH)/esp32/ld -L$(ESP_
6767
$(ESP_IDF_COMP_PATH)/newlib/lib/libm-psram-workaround.a \
6868
$(ESP_IDF_COMP_PATH)/newlib/lib/libc-psram-workaround.a \
6969
-lfreertos -ljson -ljsmn -llwip -lnewlib -lvfs -lopenssl -lmbedtls -lwpa_supplicant \
70-
-lxtensa-debug-module -lbt -lsdmmc -lsoc -lheap sigfox/modsigfox.a -u ld_include_panic_highint_hdl \
70+
-lxtensa-debug-module -lbt -lsdmmc -lsoc -lheap -u ld_include_panic_highint_hdl \
71+
72+
ifeq ($(BOARD), $(filter $(BOARD), FIPY))
73+
LIBS += sigfox/modsigfox_fipy.a
74+
endif
75+
76+
ifeq ($(BOARD), $(filter $(BOARD), SIPY))
77+
LIBS += sigfox/modsigfox.a
78+
endif
7179

7280
B_LIBS = -Lbootloader/lib -Lbootloader -L$(BUILD)/bootloader \
7381
-L$(ESP_IDF_COMP_PATH)/esp32/lib -llog -lcore -lbootloader_support \

esp32/application.mk

+20-8
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ APP_SX1272_SRC_C = $(addprefix drivers/sx127x/,\
194194
sx1272/sx1272.c \
195195
)
196196

197-
APP_SIGFOX_SRC_C = $(addprefix sigfox/,\
197+
APP_SIGFOX_SRC_SIPY_C = $(addprefix sigfox/,\
198198
manufacturer_api.c \
199199
radio.c \
200200
ti_aes_128.c \
@@ -203,6 +203,15 @@ APP_SIGFOX_SRC_C = $(addprefix sigfox/,\
203203
modsigfox.c \
204204
)
205205

206+
APP_SIGFOX_SRC_FIPY_C = $(addprefix sigfox/,\
207+
manufacturer_api.c \
208+
radio_sx127x.c \
209+
ti_aes_128.c \
210+
timer.c \
211+
transmission.c \
212+
modsigfox.c \
213+
)
214+
206215
APP_SIGFOX_MOD_SRC_C = $(addprefix mods/,\
207216
modsigfox_api.c \
208217
)
@@ -253,6 +262,9 @@ endif
253262
ifeq ($(BOARD), SIPY)
254263
OBJ += $(addprefix $(BUILD)/, $(APP_SIGFOX_MOD_SRC_C:.c=.o))
255264
endif
265+
ifeq ($(BOARD), $(filter $(BOARD), FIPY))
266+
OBJ += $(addprefix $(BUILD)/, $(APP_SIGFOX_MOD_SRC_C:.c=.o))
267+
endif
256268
ifeq ($(BOARD),$(filter $(BOARD), FIPY GPY))
257269
OBJ += $(addprefix $(BUILD)/, $(APP_LTE_SRC_C:.c=.o) $(APP_MODS_LTE_SRC_C:.c=.o))
258270
endif
@@ -270,7 +282,7 @@ SRC_QSTR += $(APP_MODS_SRC_C) $(APP_UTIL_SRC_C) $(APP_STM_SRC_C)
270282
ifeq ($(BOARD), $(filter $(BOARD), LOPY FIPY))
271283
SRC_QSTR += $(APP_MODS_LORA_SRC_C)
272284
endif
273-
ifeq ($(BOARD), $(filter $(BOARD), SIPY))
285+
ifeq ($(BOARD), $(filter $(BOARD), SIPY FIPY))
274286
SRC_QSTR += $(APP_SIGFOX_MOD_SRC_C)
275287
endif
276288
ifeq ($(BOARD),$(filter $(BOARD), FIPY GPY))
@@ -334,14 +346,14 @@ ifeq ($(BOARD), SIPY)
334346
$(BUILD)/sigfox/targets/%.o: CFLAGS = $(CFLAGS_SIGFOX)
335347
endif
336348
ifeq ($(BOARD), GPY)
337-
APP_BIN = $(BUILD)/gpy.bin
349+
APP_BIN = $(BUILD)/gpy.bin
338350
endif
339351
ifeq ($(BOARD), FIPY)
340352
APP_BIN = $(BUILD)/fipy_$(LORA_FREQ).bin
341-
# $(BUILD)/sigfox/radio.o: CFLAGS = $(CFLAGS_SIGFOX)
342-
# $(BUILD)/sigfox/timer.o: CFLAGS = $(CFLAGS_SIGFOX)
343-
# $(BUILD)/sigfox/transmission.o: CFLAGS = $(CFLAGS_SIGFOX)
344-
# $(BUILD)/sigfox/targets/%.o: CFLAGS = $(CFLAGS_SIGFOX)
353+
$(BUILD)/sigfox/radio_sx127x.o: CFLAGS = $(CFLAGS_SIGFOX)
354+
$(BUILD)/sigfox/timer.o: CFLAGS = $(CFLAGS_SIGFOX)
355+
$(BUILD)/sigfox/transmission.o: CFLAGS = $(CFLAGS_SIGFOX)
356+
$(BUILD)/sigfox/targets/%.o: CFLAGS = $(CFLAGS_SIGFOX)
345357
endif
346358

347359
APP_IMG = $(BUILD)/appimg.bin
@@ -396,7 +408,7 @@ $(BUILD)/application.a: $(OBJ)
396408
$(ECHO) "AR $@"
397409
$(Q) rm -f $@
398410
$(Q) $(AR) cru $@ $^
399-
ifeq ($(BOARD), SIPY)
411+
ifeq ($(BOARD), $(filter $(BOARD), SIPY FIPY))
400412
$(BUILD)/application.elf: $(BUILD)/application.a $(BUILD)/esp32_out.ld
401413
$(ECHO) "LINK $@"
402414
$(Q) $(CC) $(APP_LDFLAGS) $(APP_LIBS) -o $@

esp32/bootloader/bootloader.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,18 @@ static void clock_configure(void);
9191
static void uart_console_configure(void);
9292
static void wdt_reset_check(void);
9393

94-
static void read_mac(uint8_t* mac)
95-
{
96-
uint32_t mac_low = REG_READ(EFUSE_BLK0_RDATA1_REG);
97-
uint32_t mac_high = REG_READ(EFUSE_BLK0_RDATA2_REG);
98-
99-
mac[0] = mac_high >> 8;
100-
mac[1] = mac_high;
101-
mac[2] = mac_low >> 24;
102-
mac[3] = mac_low >> 16;
103-
mac[4] = mac_low >> 8;
104-
mac[5] = mac_low;
105-
}
94+
// static void read_mac(uint8_t* mac)
95+
// {
96+
// uint32_t mac_low = REG_READ(EFUSE_BLK0_RDATA1_REG);
97+
// uint32_t mac_high = REG_READ(EFUSE_BLK0_RDATA2_REG);
98+
99+
// mac[0] = mac_high >> 8;
100+
// mac[1] = mac_high;
101+
// mac[2] = mac_low >> 24;
102+
// mac[3] = mac_low >> 16;
103+
// mac[4] = mac_low >> 8;
104+
// mac[5] = mac_low;
105+
// }
106106

107107
void call_start_cpu0()
108108
{
0 Bytes
Binary file not shown.

esp32/bootloader/lib/liblog.a

0 Bytes
Binary file not shown.

esp32/bootloader/lib/libmicro-ecc.a

0 Bytes
Binary file not shown.

esp32/bootloader/lib/libsoc.a

0 Bytes
Binary file not shown.

esp32/bootloader/lib/libspi_flash.a

0 Bytes
Binary file not shown.

esp32/fatfs/src/drivers/sflash_diskio.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include "freertos/semphr.h"
1313
#include "freertos/queue.h"
1414

15+
#include "esp_spi_flash.h"
16+
1517

1618
static uint8_t *sflash_block_cache;
1719
static bool sflash_cache_is_dirty;
@@ -33,7 +35,7 @@ static bool sflash_write (void) {
3335

3436
DRESULT sflash_disk_init (void) {
3537
if (!sflash_init_done) {
36-
if (esp_get_revision() > 0) {
38+
if (spi_flash_get_chip_size() > (4 * 1024 * 1024)) {
3739
sflash_start_address = SFLASH_START_ADDR_8MB;
3840
sflash_fs_sector_count = SFLASH_FS_SECTOR_COUNT_8MB;
3941
} else {

esp32/lib/libbt.a

0 Bytes
Binary file not shown.

esp32/lib/libcxx.a

0 Bytes
Binary file not shown.

esp32/lib/libdriver.a

0 Bytes
Binary file not shown.

esp32/lib/libesp32.a

-8 Bytes
Binary file not shown.

esp32/lib/libesp_adc_cal.a

0 Bytes
Binary file not shown.

esp32/lib/libexpat.a

0 Bytes
Binary file not shown.

esp32/lib/libfreertos.a

0 Bytes
Binary file not shown.

esp32/lib/libheap.a

0 Bytes
Binary file not shown.

esp32/lib/libjsmn.a

0 Bytes
Binary file not shown.

esp32/lib/libjson.a

0 Bytes
Binary file not shown.

esp32/lib/liblog.a

0 Bytes
Binary file not shown.

esp32/lib/liblwip.a

0 Bytes
Binary file not shown.

esp32/lib/libmbedtls.a

0 Bytes
Binary file not shown.

esp32/lib/libmicro-ecc.a

0 Bytes
Binary file not shown.

esp32/lib/libnewlib.a

0 Bytes
Binary file not shown.

esp32/lib/libnghttp.a

0 Bytes
Binary file not shown.

esp32/lib/libnvs_flash.a

0 Bytes
Binary file not shown.

esp32/lib/libopenssl.a

0 Bytes
Binary file not shown.

esp32/lib/libpthread.a

0 Bytes
Binary file not shown.

esp32/lib/libsdmmc.a

0 Bytes
Binary file not shown.

esp32/lib/libsoc.a

0 Bytes
Binary file not shown.

esp32/lib/libspi_flash.a

0 Bytes
Binary file not shown.

esp32/lib/libtcpip_adapter.a

0 Bytes
Binary file not shown.

esp32/lib/libvfs.a

0 Bytes
Binary file not shown.

esp32/lib/libwpa_supplicant.a

0 Bytes
Binary file not shown.

esp32/lib/libxtensa-debug-module.a

0 Bytes
Binary file not shown.

esp32/lora/board.h

+7-6
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,16 @@ Maintainer: Miguel Luis and Gregory Cristian
5959
* Board MCU pins definitions
6060
*/
6161
#if defined (LOPY) || defined (FIPY)
62-
#define RADIO_RESET micropy_lpwan_reset_pin_index
62+
#define RADIO_RESET micropy_lpwan_reset_pin_index
6363

64-
#define RADIO_MOSI GPIO27
65-
#define RADIO_MISO GPIO19
66-
#define RADIO_SCLK GPIO5
67-
#define RADIO_NSS micropy_lpwan_ncs_pin_index
64+
#define RADIO_MOSI GPIO27
65+
#define RADIO_MISO GPIO19
66+
#define RADIO_SCLK GPIO5
67+
#define RADIO_NSS micropy_lpwan_ncs_pin_index
6868

69-
#define RADIO_DIO micropy_lpwan_dio_pin_index
69+
#define RADIO_DIO micropy_lpwan_dio_pin_index
7070
#endif
71+
7172
void BoardInitPeriph( void );
7273

7374
void BoardInitMcu( void );

esp32/lora/spi-board.c

+9
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ void SpiFrequency( Spi_t *obj, uint32_t hz ) {
165165
#if defined(LOPY) || defined(FIPY)
166166
IRAM_ATTR uint16_t SpiInOut(Spi_t *obj, uint16_t outData) {
167167
uint32_t spiNum = (uint32_t)obj->Spi;
168+
169+
#if defined(FIPY)
170+
// set data send buffer length (1 byte)
171+
SET_PERI_REG_BITS(SPI_MOSI_DLEN_REG(spiNum), SPI_USR_MOSI_DBITLEN, 7, SPI_USR_MOSI_DBITLEN_S);
172+
SET_PERI_REG_BITS(SPI_MISO_DLEN_REG(spiNum), SPI_USR_MISO_DBITLEN, 7, SPI_USR_MISO_DBITLEN_S);
173+
#endif
174+
168175
// load the send buffer
169176
WRITE_PERI_REG(SPI_W0_REG(spiNum), outData);
170177
// start to send data
@@ -189,7 +196,9 @@ IRAM_ATTR uint8_t SpiInOut(uint32_t spiNum, uint32_t outData) {
189196
// read data out
190197
return READ_PERI_REG(SPI_W0_REG(spiNum));
191198
}
199+
#endif
192200

201+
#if defined(SIPY) || defined(FIPY)
193202
/*!
194203
* \brief Sends outData
195204
*

esp32/main.c

+2-6
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,10 @@
5353

5454
TaskHandle_t mpTaskHandle;
5555
TaskHandle_t svTaskHandle;
56-
#if defined(LOPY)
56+
#if defined(LOPY) || defined (FIPY)
5757
TaskHandle_t xLoRaTaskHndl;
5858
#endif
59-
#if defined(SIPY)
60-
TaskHandle_t xSigfoxTaskHndl;
61-
#endif
62-
#if defined(FIPY)
63-
TaskHandle_t xLoRaTaskHndl;
59+
#if defined(SIPY) || defined (FIPY)
6460
TaskHandle_t xSigfoxTaskHndl;
6561
#endif
6662

esp32/mods/machpin.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ DECLARE PRIVATE DATA
107107
DEFINE PUBLIC FUNCTIONS
108108
******************************************************************************/
109109
void pin_preinit(void) {
110-
gpio_isr_register(machpin_intr_process, NULL, 0, NULL);
110+
gpio_isr_register(machpin_intr_process, NULL, ESP_INTR_FLAG_IRAM, NULL);
111111
}
112112

113113
void pin_init0(void) {

esp32/mods/machtimer_alarm.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ STATIC void alarm_set_callback_helper(mp_obj_t self_in, mp_obj_t handler, mp_obj
5151
DEFINE PUBLIC FUNCTIONS
5252
******************************************************************************/
5353
void alarm_preinit(void) {
54-
timer_isr_register(TIMER_GROUP_0, TIMER_0, timer_alarm_isr, NULL, ESP_INTR_FLAG_IRAM, NULL);
54+
timer_isr_register(TIMER_GROUP_0, TIMER_0, timer_alarm_isr, NULL, 0, NULL);
5555
}
5656

5757
void init_alarm_heap(void) {
@@ -256,7 +256,7 @@ STATIC void alarm_set_callback_helper(mp_obj_t self_in, mp_obj_t handler, mp_obj
256256

257257
if (alarm_heap.count == ALARM_HEAP_MAX_ELEMENTS) {
258258
error = true;
259-
} else {
259+
} else if (self->handler != mp_const_none) {
260260
mp_irq_add(self, handler);
261261
set_alarm_when(self, self->interval);
262262
insert_alarm(self);

esp32/mods/machuart.c

+1
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mach_uart_any_obj, mach_uart_any);
495495

496496
STATIC mp_obj_t mach_uart_tx_done(mp_obj_t self_in) {
497497
mach_uart_obj_t *self = self_in;
498+
ets_delay_us(MACHUART_TX_WAIT_US(self->config.baud_rate));
498499
if (uart_tx_done(self->uart_id)) {
499500
return mp_const_true;
500501
}

0 commit comments

Comments
 (0)