XUart driver accesses status register directly rather than using XUartLite_GetSR
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.2k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
There are quite a few places in the XUartLite driver which access the status register directly rather than calling XUartLite_GetSR which means that the receive error stats don't get updated.
The following functions/macros access the status register directly:
From xuartlite.c:
XUartLite_ResetFifos
XUartLite_IsSending
From: xuartlite_selftest.c
XUartLite_SelfTest
From xuartlite_intr.c:
XUartLite_InterruptHandler - this function is the biggest offender and it even has the InstancePtr as an argument.
I understand the low level functions from xuartlite_l.c/.h not using XUartLite_GetSR, but it would be nice if there were high-level equivalent functions.
From xuartlite_l.h
XUartLite_GetStatusReg
XUartLite_IsReceiveEmpty (goes through XUartLite_GetStatusReg)
XUartLite_IsTransmitFull (goes through XUartLite_GetStatusReg)
XUartLite_IsIntrEnabled (goes through XUartLite_GetStatusReg)
From xuartlite_l.c
XUartLite_SendByte (goes through XUartLite_IsTransmitFull)
XUartLite_RecvByte (goes through XUartLite_IsReceiveEmpty)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing XUartLite_GetSR and the direct status-register accesses listed in xuartlite.c, xuartlite_selftest.c, xuartlite_intr.c, xuartlite_l.h, and xuartlite_l.c. Review XUartLite_InterruptHandler first, then compare the other high-level functions and macros. Done means the listed high-level accesses consistently update receive error statistics while the low-level functions remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100