π“Ÿ host1.bitchan.one

𓀐 @VVKtCG2t

⏱ 1d seenβ›“ 0πŸ‘ 0β§– 1

filter [-]

languages:onother

On the coding front, the firmware for the ESC tests is still coming along. I found one interesting bug I wanted to share. So I'd mentioned commands look like this: [FORWARD 5 5 5] and the starting and ending "[" brackets mark the start and end points of the command. So my code searches for the bit pattern that forms those and uses that to mark out the boundaries of the command in the memory buffer. Well, funny enough, it turns out the bits that form a closing bracket, "01011101" were found inside the command itself! Not good! That meant the code thought the command ended but it didn't. It was the W and the A in FORWARD that had 01011101 nested in them. W = 01010111 A = 01000001 --- Combined: 01010111 01000001 you can see two bits in starts the 01011101 signature the code was looking for! So to resolve this edge case/bug I just made all my commands use [[FORWARD 5 5 5]] and the code now looks for double opening brackets and double closing brackets to weed out that particular edge case from happening. However, funny enough, if one of my commands contained the characters "mut" "or "uut" or "!ut" consecutively, then double brackets are also hidden in those sequences and would still trigger the code to think it found double brackets and act accordingly to this false flag set of edge cases. Triple brackets to encapsulate commands would be foolproof, but for now I decided not to bother looking for triple brackets which would rule that out because its overkill since none of my planned commands involve "mut" or "uut" character groupings. I think we're good. Can always add triple brackets later if we need it.⏱ 42m↩ 1