-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Manchester decoding should work on bitrow not entire bitbuffer #2413
base: master
Are you sure you want to change the base?
Conversation
Thanks! Much needed. I still think that numbers of bits and bytes are an integral core of decoder operations and not something to be abstracted away (as e.g. Or easier to discuss: same with CRC's where I don't like to see I realize this is far on the side of personal preference, but maintaining that may decoders needs to be dumb simple. E.g. I often grep or regex-replace int the sources and defines don't work with that approach. |
Well, I totally understand your point with regards to the CRC, but when it comes to number of bytes required to store a number of bits, I prefer to be on the (very) conservative side. And I find it clearer to have the Also, some decoders already have constants for the expected number of bits (or bytes) they are working with which I do not find inconvenient to read. If I really want the actual value, hovering the mouse on that symbol makes my IDE give me the actual value. See ced7000, danfoss, schraeder for example. I'm not one of those "no magic numbers" fanatic because I loathe In the end, it's your call, just let me know. |
Good and valid arguments, I do see that too -- that's why it's so hard to decide. I really don't want number defines and macros, but they are reasonable and could be nice maybe. |
How about I modify the other PR (#2378) to have the changes limited to devices files, leaving alone Would that be acceptable? |
93031a1
to
ed794ec
Compare
…e require a bitrow as output to reduce stack usage.
… bitbuffer_manchester_decode places its output in a bitrow_t
… bitrow_t based methods are available
… a given number of bits
…cate a uint8_t array of the appropriate size.
…r must be given the maximum byte size
… not give the false impression that it could be used as a general purpose buffer.
400653a
to
c4ffc70
Compare
As discussed in #1726, manchester decoding functions require a
bitbuffer_t
to place the result of their decoding, but only ever use the first row in that buffer.This pull request addresses this by having those method require a
uint8_t
array instead, which allows for far lower stack usage throughout the program.Note that it introduces the
NUM_BYTES
macro already suggested in #2378 as it is used in all decoders that now require auint8_t
array whose size should be able contain the expected number of bits to be decoded. Once on of the two PR is merged, I'll gladly rebase the other one to avoid any conflicts and give a cleaner history path.