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

Only write to FLASH once 64 bytes are buffered #11697

Merged
merged 1 commit into from
Jun 27, 2022

Conversation

SteveCEvans
Copy link
Member

Black box data to be written to FLASH is buffered in a 128 byte buffer, but is being written more often than necessary, typically 28 bytes at a time. This PR changes that to write no less than 64 bytes.

This reduces CPU load as fewer write operations are required.

@SteveCEvans SteveCEvans added this to the 4.3.1 milestone Jun 26, 2022
@SteveCEvans SteveCEvans self-assigned this Jun 26, 2022
@blckmn
Copy link
Member

blckmn commented Jun 26, 2022

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> FAIL
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> FAIL
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> FAIL
  • Tested label found -> FAIL
  • assigned to an approver -> PASS
  • approver count at least three -> FAIL

@blckmn blckmn merged commit 5f00765 into betaflight:master Jun 27, 2022
@hydra
Copy link
Contributor

hydra commented Jul 5, 2022

@SteveCEvans It has been a preference to avoid boolean arguments in favor or two methods, one that behaves as though 'true' was specified, and one that behaves as if 'false' was specified. This leads to greater readability as you always have to look up what the 'true' or false does. A private (static) 'inner' method that uses a boolean argument is better, as the public api wouldn't contain the inner method.

i.e.

public:

flashfsFlushAsync(void)
flashfsForceFlushAsync(void)

private:

flashfsFlushAsyncInner(bool force)

another preferred approach is to use an enum instead of the bool so that the argument is named.

flashfsFlushAsync(FLUSH_FORCE);
flashfsFlushAsync(FLUSH_NORMAL);

blckmn added a commit to blckmn/betaflight that referenced this pull request Jul 11, 2022
blckmn added a commit that referenced this pull request Jul 11, 2022
Only write to FLASH once 64 bytes are buffered #11697 @SteveCEvans
alexeystn added a commit to alexeystn/betaflight that referenced this pull request Nov 6, 2022
…n_custom

* commit '8d4f00532dfdd36467ed4b5f3395f5445b521dd6':
  Update version.h
  Fix compilation error when USE_RX_MSP_OVERRIDE is defined without USE_RX_MSP.
  Add STM32F411SX1280 unified target
  Add ICM42688P for all unified builds
  Make sure to write dshot stop cmd to all other motors when targeting less than max motor count
  Fix data overwriting in VCP_DataTx on F4 betaflight#11713 @daleckystepan
  Only write to FLASH once 64 bytes are buffered betaflight#11697 @SteveCEvans
  Backport Ghost jitter fix betaflight#11234
  Fix Ghost RSSI values
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.

5 participants