Jump to content
43oh

Recommended Posts

Energia does not implement an API for UART TX/RX interrupt callback. You could however easily modify HardwareSerial.cpp/.h and insert an optional hardware callback.

I would add a function e.g. HardwareSerial::attachTxInterrupt(void (*userFunc)(void)) / HardwareSerial::attachRxInterrupt(void (*userFunc)(void)). Use attachInterrupt(void (*userFunc)(void)) in WInterrupts.c as an example. Add the TX and RX userFunc as a private member in HardwareSerial.h. Then in the tx/rx ISR check if the a function has been registered, if so call it.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...