const__pageData=JSON.parse('{"title":"Word Per Minute (WPM) Calculation","description":"","frontmatter":{},"headers":[],"relativePath":"features/wpm.md","filePath":"features/wpm.md"}');
const_hoisted_1=/* @__PURE__ */createStaticVNode('<h1id="word-per-minute-wpm-calculation"tabindex="-1">WordPerMinute(WPM)Calculation<aclass="header-anchor"href="#word-per-minute-wpm-calculation"aria-label="Permalink to "Word Per Minute (WPM) Calculation""></a></h1><p>TheWPMfeatureusestimebetweenkeystrokestocomputearollingaveragewordsperminuterateandmakesthisavailableforvarioususes.</p><p>EnabletheWPMsystembyaddingthistoyour<code>rules.mk</code>:</p><pre><code>WPM_ENABLE=yes\n</code></pre><p>Forsplitkeyboardsusingsoftserial,thecomputedWPMscorewillbeavailableonthemasterANDslavehalf.</p><h2id="configuration"tabindex="-1">Configuration<aclass="header-anchor"href="#configuration"aria-label="Permalinkto"Configuration""></a></h2><table><thead><tr><th>Define</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>WPM_ESTIMATED_WORD_SIZE</code></td><td><code>5</code></td><td>Thisisthevalueusedwhenestimatingaveragewordsize(forregressionandnormaluse)</td></tr><tr><td><code>WPM_ALLOW_COUNT_REGRESSION</code></td><td><em>Notdefined</em></td><td>IfdefinedallowstheWPMtobedecreasedwhenhittingDeleteorBackspace</td></tr><tr><td><code>WPM_UNFILTERED</code></td><td><em>Notdefined</em></td><td>Ifundefined(thedefault),WPMvalueswillbesmoothedtoavoidsuddenchangesinvalue</td></tr><tr><td><code>WPM_SAMPLE_SECONDS</code></td><td><code>5</code></td><td>Thisdefineshowmanysecondsoftypingtoaverage,whencalculatingWPM</td></tr><tr><td><code>WPM_SAMPLE_PERIODS</code></td><td><code>25</code></td><td>ThisdefineshowmanysamplingperiodstousewhencalculatingWPM</td></tr><tr><td><code>WPM_LAUNCH_CONTROL</code></td><td><em>Notdefined</em></td><td>Ifdefined,WPMvalueswillbecalculatedusingpartialbufferswhentypingbegins</td></tr></tbody></table><p>'WPM_UNFILTERED'ispotentiallyusefulifyou'refilteringdatainsomeotherway(andalsobecauseitreducesthecoderequiredfortheWPMfeature),orifreducingmeasurementlatencytoaminimumisimportantforyou.</p><p>Increasing'WPM_SAMPLE_SECONDS'willgivemoresmoothlychangingWPMvaluesattheexpenseofslightlymorelatencytotheWPMcalculation.</p><p>Increasing'WPM_SAMPLE_PERIODS'willimprovethesmoothnessatwhichWPMdecaysoncetypingstops,atacostofapproximatelythismanybytesoffirmwarespace.</p><p>If'WPM_LAUNCH_CONTROL'isdefined,wheneverWPMdropstozero,thenexttimetypingbeginsWPMwillbecalculatedbasedonlyonthetimesincethattypingbegan,insteadofthewholeperiodoftimespecifiedbyWPM_SAMPLE_SECONDS.ThisresultsinreachinganaccurateWPMvaluemuchfaster,evenwhenfilteringisenabledandalargeWPM_SAMPLE_SECONDSvalueisspecified.</p><h2id="public-functions"tabindex="-1">PublicFunctions<aclass="header-anchor"href="#public-functions"aria-label="Permalinkto"PublicFunctions""></a></h2><table><thead><tr><th>Function</th><th>Description</th></tr></thead><tbody><tr><td><code>get_current_wpm(void)</code></td><td>ReturnsthecurrentWPMasavaluebetween0-255</td></tr><tr><td><code>set_current_wpm(x)</code></td><td>SetsthecurrentWPMto<code>x</code>(between0-255)</td></tr></tbody></table><h2id="callbacks"tabindex="-1">Callbacks<aclass="header-anchor"href="#callbacks"aria-label="Permalinkto"Callbacks""></a></h2><p>Bydefault,theWPMscoreonlyincludesletters,numbers,spaceandsomepunctuation.IfyouwanttochangethesetofcharactersconsideredaspartoftheWPMcalculation,youcanimplementyourown<code>boolwpm_keycode_user(uint16_tkeycode)</code>andreturntrueforanycharactersyouwouldlikeincludedinthecalculation,orfalsetonotcountthatparticularkeycode.</p><p>Forinstance,thedefaultis:</p><divclass="language-cvp-adaptive-theme"><buttontitle="CopyCode"class="copy"></button><spanclass="lang">c</span><preclass="shikishiki-themesgithub-lightgithu