Skip to content

Arduino 2.0.0 - Question: wants to use UART Rx interrupt but still keeps HardwareSerial API to handles data from Rx FIFO #5678

Closed
@MomePP

Description

@MomePP

Hardware:

Board: ESP32 Dev Module
Core Installation version: 2.0.0
IDE name: PlatformIO
Flash Frequency: 40Mhz
PSRAM enabled: no
Upload Speed: 921600
Computer OS: Mac OSX

Description:

Currently, I got UART interrupt working fine. I have created new class to inherits HardwareSerial then overrides begin() to enables interrupt routine. As my understanding from ESP32 docs, when registered interrupt isr, its override default isr handler. This means the Rx HardwareSerial that relies on IDF's API (eg. read, available, etc.) will be unusable, need to handles from isr by user. So, I have override HardwareSerial functions to points to a new create buffer, queue that handles the data from isr (likes an old implementation in 1.0.6).

I have take a look at uart-event but if i want to unpack my serial packet per byte, i think isr still the way to go. correct me if i misunderstood.

Is there any other solution to workaround this if i still want to use HardwareSerial functions (some libraries that based on default HardwareSerial functions) while using UART interrupt.

Cheers,
MomePP

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions