Skip to content

Commit

Permalink
port of betaflight#10229 - Remove unnecessary drawScreen() calls for …
Browse files Browse the repository at this point in the history
…MSP displayPort OSD (#389)

* make rate dynamics change based on rc input

* better cpu load

don't calculate updateRateCorrection if you aren't using dynamic rates.

* better math, not quite right :(

only works for rates slower than 150hz speeds above 150hz can have issues with the dterm making the sticks move without your input :(

* rate dynamics update

can see rate dynamics in the configurator as well now.

* ability to turn off sharpness

0 turns off sharpness, going to rework sharpness and kalmanState->e later.

* Update fc_rc.c

* Update kalman.c

* new sharpness style

* allow kalman sharpness 0

* Update kalman.c

* Revert "Merge branch 'dynamic-calculation-of-rate-dynamics' into kalman-sharpness"

This reverts commit ba7542a, reversing
changes made to 75eda4f.

* fix kalmanState->p

now we always update p even if kalmanState->lastX is == to 0.0f

* port of https://github.com/betaflight/betaflight/pull/10229/files - Remove unnecessary drawScreen() calls for MSP displayPort OSD

Co-authored-by: Quick-Flash <[email protected]>
Co-authored-by: nerdCopter <[email protected]>
  • Loading branch information
3 people authored Nov 16, 2020
1 parent 692166d commit 0ac4c3a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/io/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1570,6 +1570,18 @@ void osdUpdate(timeUs_t currentTimeUs) {
} else {
// rest of time redraw screen 10 chars per idle so it doesn't lock the main idle
displayDrawScreen(osdDisplayPort);


bool doDrawScreen = true;
#if defined(USE_CMS) && defined(USE_MSP_DISPLAYPORT) && defined(USE_OSD_OVER_MSP_DISPLAYPORT)
// For the MSP displayPort device only do the drawScreen once per
// logical OSD cycle as there is no output buffering needing to be flushed.
doDrawScreen = (counter % DRAW_FREQ_DENOM == 1);
#endif
// Redraw a portion of the chars per idle to spread out the load and SPI bus utilization
if (doDrawScreen) {
displayDrawScreen(osdDisplayPort);
}
}
++counter;
#ifdef USE_CMS
Expand Down

0 comments on commit 0ac4c3a

Please sign in to comment.