Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the last time when the tx write buffer got emptied #17978

Closed
wants to merge 2 commits into from

Conversation

amilcarlucas
Copy link
Contributor

@amilcarlucas amilcarlucas commented Jul 9, 2021

Binary Name      Text [B]        Data [B]     BSS (B)        Total Flash Change [B] (%)      Flash Free After PR (B)
---------------  --------------  -----------  -------------  ----------------------------  -------------------------
ardurover        108 (+0.0066%)  0 (0.0000%)  -4 (-0.0015%)  108 (+0.0066%)                                   337492
blimp            108 (+0.0081%)  0 (0.0000%)  4 (+0.0015%)   108 (+0.0080%)                                   623048
arducopter       108 (+0.0061%)  0 (0.0000%)  -4 (-0.0015%)  108 (+0.0061%)                                   193140
arduplane        108 (+0.0061%)  0 (0.0000%)  -4 (-0.0015%)  108 (+0.0061%)                                   201456
ardusub          108 (+0.0069%)  0 (0.0000%)  4 (+0.0015%)   108 (+0.0069%)                                   400760
antennatracker   108 (+0.0082%)  0 (0.0000%)  -4 (-0.0015%)  108 (+0.0082%)                                   645924
arducopter-heli  108 (+0.0061%)  0 (0.0000%)  -4 (-0.0015%)  108 (+0.0061%)                                   186972

@@ -144,6 +144,9 @@ class ChibiOS::UARTDriver : public AP_HAL::UARTDriver {
*/
bool is_dma_enabled() const override { return rx_dma_enabled && tx_dma_enabled; }

// get the last time when the tx write buffer got emptied
uint32_t get_last_tx_empty_us() const override { return (tx_dma_enabled && _writebuf.is_empty()) ? _last_write_completed_us : 0; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this depends on DMA config ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the _last_write_completed_us only gets written to if tx_dma_enabled == true

@khancyr khancyr added the ChibiOS label Jul 9, 2021
@github-actions
Copy link

github-actions bot commented Jul 9, 2021

Heads up @bugobliterator - the "ChibiOS" label was applied to this issue.

@amilcarlucas amilcarlucas force-pushed the pr/empty_tx branch 3 times, most recently from 47a6bd4 to 42c1796 Compare August 3, 2021 23:22
@khancyr
Copy link
Contributor

khancyr commented Oct 13, 2021

@amilcarlucas do you still need this ?

@amilcarlucas
Copy link
Contributor Author

It is still needed.
@andyp1per this is probably better that your fix, should we add this one instead?

@andyp1per
Copy link
Collaborator

Ok with me. Does this affect the size? I have a feeling that inline virtuals are not optimal

@amilcarlucas
Copy link
Contributor Author

I rebased it now, will check size once CI is finished

@amilcarlucas
Copy link
Contributor Author

Size comparison added on the description

@amilcarlucas
Copy link
Contributor Author

I just realized that FETtec no longer needs this, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants