Repository navigation
Fix typos and stale documentation comments (comments/docs only) - #570
stijncarelsbergh wants to merge 5 commits into
Conversation
Fixed broken link on README.md
Comment-only corrections found while auditing the documentation against the source. No behaviour change. - Commander.h: the 'E' command sub-commands are documented the wrong way round (E1 enables, E0 disables, as implemented in Commander::motor()). - BLDCDriver.h / StepperDriver.h: setPhaseState() @PARAM names were listed in reverse order (sc, sb, sa) compared to the actual signature (sa, sb, sc). - hardware_api.h: _configure1PWM() was documented as a '2PWM setting'; _configure6PWM() documented pinB/pinC as pinA. - HallSensor.h: constructor documented a non-existent 'doIndex' parameter and an 'index' pin that the class does not have (it is doC). - Encoder.h: @PARAM encA was described as 'encoder B pin'. - FOCMotor.h: sensor_direction comment said 'default is CW' while the default is Direction::UNKNOWN (set by calibration). - FOCMotor.cpp: inverted explanation of the angle/velocity limit cascade. - defaults.h: DEF_CURR_FILTER_Tf described as a 'velocity' filter. - StepperMotor.cpp / HybridStepperMotor.cpp: 'number od pole pairs'. - pid.cpp / lowpass_filter.cpp: fixed sampling '{tims}' -> 'time'. - library.properties: 'demistifying' -> 'demystifying'.
Spelling fixes in library sources, examples and docs. Applied only inside comments, string literals and markdown prose - verified with a scanner that strips comments/strings and compares the remaining code token-for-token, so no identifier, macro or expression is touched (0 code changes over 82 files, 228 words corrected). Notable ones: intial/intialisation, contoller, speciffic, variabels, currnet, hadware, overriden, interraction, listenning, number od pole pairs.
|
Ok so, a looooot of changes. I dont really like PRs like this one usually. They are really hard to check. But with AIs today we can do it a bit faster. Ok so first of all merge the dev into your branch so that it passes the checks. I'll go through it and try to verify that the changes are only comments. If they are I will probably merge it. |
Two conflicts, both 'our comment fix vs a code change on dev':
- FOCMotor.h: dev changed LPF_angle{0.0} to {0.0f}; kept dev's code and
re-applied the 'commad' -> 'command' comment fix.
- atmega32u4_mcu.cpp: dev fixed the _writeDutyCycle3PWM() signature (PR simplefoc#553);
kept dev's signature and re-applied 'speciffic' -> 'specific'.
Both resolutions keep upstream's code unchanged.
|
Merged
On verifying that it really is comments only - I did that mechanically instead of by eye, since i.e. token-for-token identical to dev's code, with only comment/prose text differing. Script is https://gist.github.com/stijncarelsbergh/ae11d6259850aa2082cba8985dff639e It also re-checks that every changed word in One honest caveat so it is not a surprise: the only non-comment changes in the PR are two |
Fix typos and stale documentation comments (comments/docs only - no behaviour change)
While auditing the library sources and examples against docs.simplefoc.com I collected a
large number of spelling mistakes and a handful of documentation comments that no longer
match the code. They are all comment/prose level, but they show up in the published Doxygen
output and in the Arduino examples, so it is worth cleaning them up.
This PR deliberately contains no behaviour change, so it can be merged without hardware
testing. The actual logic bugs found during the same audit are being submitted separately.
What is in here
1. Typos in comments, strings and markdown (
3652fa4) - 228 words in 92 filesRecurring ones:
intial/intialisation/intiallyinitial/initialization/initiallyspecifficspecificcontoller/controllcontroller/controlvariabels/vairablesvariablescurrnet/currrentcurrenthadware/harwarehardwareoverridenoverriddenlistenning/listennerlistening/listenerinterractioninteractioncompatibiltycompatibilitychanage/chaningchange/changingparamtersparametersnumber od pole pairsnumber of pole pairsinitalise ... sampling tims Tsinitialize ... sampling time Tsplus
aboout,addional,alignemt,architecure,assuning,begining,commad,complemetary,corrent,defintion,doen't,driectly,ecoder,electirical,ellapsed,explicilty,fammilies,fileter,han't,injeted,instad,lewline,measuremnt,numer,oscilating,perfomed,seperate,throught,wuing,demistifying,comunity,Arudinoand a few singles.2. Stale/incorrect documentation comments (
1fd4841)Commander.h- theEcommand is documented the wrong way round: it says'0' - enable,'1' - disable. The implementation inCommander::motor()andCommander::motion()doestarget == 0 -> disable(), i.e. E1 enables, E0 disables.Anyone following the current header comment disables their motor instead of enabling it.
BLDCDriver.h/StepperDriver.h-setPhaseState()lists its@params in reverseorder (
sc, sb, sa) compared to the signature(sa, sb, sc). Same for the 2-phasestepper
(sc, sb)vs(sa, sb).hardware_api.h-_configure1PWM()is documented asStepper driver - 2PWM setting;_configure6PWM()documentspinB/pinCaspinA(copied from the pinA lines).HallSensor.h- the constructor documents a parameterdoIndexand anindexpin.The class has neither: the parameter is
doCand there is no index channel.Encoder.h-@param encA encoder B pin.FOCMotor.h-sensor_directionclaimeddefault is CW, while the default isDirection::UNKNOWNand it is resolved during calibration.FOCMotor.cpp- the comment onupdateVelocityLimit()describes the cascade the wrongway round. It is the velocity limit that clips the angle controller output (the
velocity set point), not an angle controller limit.
defaults.h-DEF_CURR_FILTER_Tfis described as a "velocity filter" (both AVR anddefault sections carry the current-filter comment next to a current constant).
library.properties-demistifying->demystifying.How it was checked
The typo pass is applied by a small scanner that only rewrites text inside comments
(
//,/* */), inside string literals and in markdown prose - identifiers, macros andexpressions are never rewritten. To prove it, the changed sources are re-parsed with
comments and string contents stripped out and compared to the original:
The only non-comment change in the whole PR is the text of two
Serialmessages in thestep_dir_listener_*examples ("Step/Dir listenning."->"Step/Dir listening."), whichis the intent.
No build was run on purpose: since not a single code token changed, a compile would only
re-verify the compiler, not this PR.
Suggested review path
git diff --statshows 95 files / +237 -238, all one-line changes. Reviewinggit show 1fd4841(the documentation-comment commit, 12 hunks) is probably the mostuseful part.